Module: Serializable
- Defined in:
- lib/acts_as_serializable.rb,
lib/serializable/version.rb,
lib/serializable/versions.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods, SingletonMethods
Classes: Version, Versions
Constant Summary
collapse
- SERIALIZE_TO_VERSION_REGEXP =
/^serialize_to_version_((:?\d+_?)+)$/
- SERIALIZED_CLASS_NAME_REGEXP =
/\/version_((:?\d+_?)+)\.rb$/
- SERIALIZATION_PROJECT_PATHS =
Serializable.scan_rails_app_paths
Class Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
9
10
11
|
# File 'lib/acts_as_serializable.rb', line 9
def self.included(base)
base.extend(ClassMethods)
end
|
.scan_rails_app_paths ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/acts_as_serializable.rb', line 13
def self.scan_rails_app_paths
if defined?(RAILS_ROOT)
project_paths = Array.new
$LOAD_PATH.each do |path|
if path.match(/#{Regexp.escape(RAILS_ROOT)}.*\/app$/)
project_paths << path
end
end
project_paths
else
Array.new
end
end
|