cascading-configuration-array 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/Accessors.rb +0 -16
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/ModuleInstance.rb +6 -7
- data/lib/cascading-configuration-array/CascadingConfiguration/Array.rb +3 -11
- data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/Instance.rb +7 -9
- data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/_private_/Instance.rb +5 -4
- data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray.rb +2 -1
- metadata +3 -3
@@ -3,22 +3,6 @@ module CascadingConfiguration::Array::Accessors
|
|
3
3
|
|
4
4
|
extend CascadingConfiguration::InternalModuleStub
|
5
5
|
|
6
|
-
###################
|
7
|
-
# self.extended #
|
8
|
-
###################
|
9
|
-
|
10
|
-
def self.extended( class_or_module )
|
11
|
-
class_or_module.instance_eval do
|
12
|
-
# accessor support in module to permit method overriding with super
|
13
|
-
unless const_defined?( :AccessorSupportModule )
|
14
|
-
accessor_support_module = Module.new { extend CascadingConfiguration::InternalModuleStub }
|
15
|
-
const_set( :AccessorSupportModule, accessor_support_module )
|
16
|
-
include class_or_module::AccessorSupportModule
|
17
|
-
extend class_or_module::AccessorSupportModule
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
6
|
###################################
|
23
7
|
# define_cascading_array_setter #
|
24
8
|
###################################
|
@@ -2,22 +2,21 @@
|
|
2
2
|
module CascadingConfiguration::Array::ModuleInstance
|
3
3
|
|
4
4
|
extend CascadingConfiguration::InternalModuleStub
|
5
|
-
|
5
|
+
|
6
6
|
##############
|
7
7
|
# included #
|
8
8
|
##############
|
9
9
|
|
10
10
|
def included( class_or_module )
|
11
11
|
super if method_defined?( :super )
|
12
|
+
# CascadingConfiguration::Array
|
12
13
|
module_self = self
|
13
14
|
class_or_module.instance_eval do
|
14
|
-
|
15
|
-
# when we extend a module (which has happened if we got here)
|
16
|
-
# then we need to make sure when the module we are extending is included
|
17
|
-
# * CascadingConfiguration is included
|
18
|
-
# * the module we extended is used to extend the class/module that included
|
15
|
+
# whichever module included CascadingConfiguration::Array
|
19
16
|
extend module_self
|
17
|
+
# cascade CascadingConfiguration::Array
|
18
|
+
include CascadingConfiguration::Array
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
|
-
end
|
22
|
+
end
|
@@ -12,9 +12,9 @@ module CascadingConfiguration::Array
|
|
12
12
|
class_or_module.instance_eval do
|
13
13
|
include CascadingConfiguration::Variable
|
14
14
|
extend module_self
|
15
|
-
extend
|
16
|
-
extend
|
17
|
-
|
15
|
+
extend module_self::Accessors
|
16
|
+
extend module_self::ClassInstance
|
17
|
+
include CascadingConfiguration::CompositingArray::Instance
|
18
18
|
# module support
|
19
19
|
unless is_a?( Class )
|
20
20
|
extend CascadingConfiguration::Array::ModuleInstance
|
@@ -22,12 +22,4 @@ module CascadingConfiguration::Array
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
#########################
|
26
|
-
# ancestors_to_Object #
|
27
|
-
#########################
|
28
|
-
|
29
|
-
def ancestors_to_Object
|
30
|
-
return ancestors_to_class_or_module_interpolating_module_branches( Object, CascadingConfiguration::Array::ModuleInstance )
|
31
|
-
end
|
32
|
-
|
33
25
|
end
|
@@ -1,25 +1,23 @@
|
|
1
1
|
|
2
2
|
module CascadingConfiguration::CompositingArray::Instance
|
3
3
|
|
4
|
-
extend CascadingConfiguration::InternalModuleStub
|
5
|
-
|
6
4
|
###################
|
7
5
|
# self.included #
|
8
6
|
###################
|
9
7
|
|
10
8
|
def self.included( class_or_module )
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
module_self = self
|
10
|
+
class_or_module.instance_eval do
|
11
|
+
extend module_self
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
17
15
|
#################################################
|
18
16
|
# composite_array_for_cascading_configuration #
|
19
17
|
#################################################
|
20
18
|
|
21
19
|
def composite_array_for_cascading_configuration( cascading_name )
|
22
|
-
|
20
|
+
|
23
21
|
# initialize composite array if necessary or acquire it from object
|
24
22
|
composite_array_variable = composite_array_variable_name( cascading_name )
|
25
23
|
|
data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/_private_/Instance.rb
CHANGED
@@ -4,13 +4,14 @@ module CascadingConfiguration::CompositingArray::Instance
|
|
4
4
|
###########################################################################################################
|
5
5
|
private ###############################################################################################
|
6
6
|
###########################################################################################################
|
7
|
-
|
7
|
+
|
8
8
|
###################################
|
9
9
|
# composite_array_variable_name #
|
10
10
|
###################################
|
11
11
|
|
12
12
|
def composite_array_variable_name( configuration_name )
|
13
|
-
|
13
|
+
klass = ( is_a?( Module ) ? self : self.class )
|
14
|
+
return ( klass::AccessorSupportModule.cascading_variable_name( configuration_name ).to_s + '__' + 'compositing_array' ).to_sym
|
14
15
|
end
|
15
|
-
|
16
|
-
end
|
16
|
+
|
17
|
+
end
|
@@ -9,7 +9,8 @@ class CascadingConfiguration::CompositingArray < Array
|
|
9
9
|
|
10
10
|
def initialize( cascading_name, working_instance )
|
11
11
|
@cascading_name = cascading_name
|
12
|
-
|
12
|
+
working_class = ( working_instance.is_a?( Module ) ? working_instance : working_instance.class )
|
13
|
+
@cascading_variable = working_class::AccessorSupportModule.cascading_variable_name( @cascading_name )
|
13
14
|
@working_instance = working_instance
|
14
15
|
# if first ancestor can have a composite array, register self with it in case it gets updated in the future
|
15
16
|
if ( first_ancestor = @working_instance.first_ancestor ).respond_to?( :composite_array_for_cascading_configuration )
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 1
|
9
|
+
version: 1.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Asher
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-07-
|
17
|
+
date: 2011-07-15 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|