cascading-configuration-array 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,9 @@ module CascadingConfiguration::Array
3
3
 
4
4
  extend CascadingConfiguration::InternalModuleStub
5
5
 
6
+ include CascadingConfiguration::Variable
7
+ include CascadingConfiguration::CompositingArray::Instance
8
+
6
9
  ###################
7
10
  # self.included #
8
11
  ###################
@@ -10,15 +13,11 @@ module CascadingConfiguration::Array
10
13
  def self.included( class_or_module )
11
14
  module_self = self
12
15
  class_or_module.instance_eval do
13
- include CascadingConfiguration::Variable
14
16
  extend module_self
15
17
  extend module_self::Accessors
16
18
  extend module_self::ClassInstance
17
- include CascadingConfiguration::CompositingArray::Instance
18
19
  # module support
19
- unless is_a?( Class )
20
- extend CascadingConfiguration::Array::ModuleInstance
21
- end
20
+ extend CascadingConfiguration::Array::ModuleInstance unless is_a?( Class )
22
21
  end
23
22
  end
24
23
 
@@ -18,5 +18,19 @@ module CascadingConfiguration::Array::ModuleInstance
18
18
  include CascadingConfiguration::Array
19
19
  end
20
20
  end
21
+
22
+ ##############
23
+ # extended #
24
+ ##############
25
+
26
+ def extended( class_or_module )
27
+ super if method_defined?( :super )
28
+ # CascadingConfiguration::Array
29
+ module_self = self
30
+ class_or_module.instance_eval do
31
+ # cascade CascadingConfiguration::Array
32
+ include CascadingConfiguration::Array
33
+ end
34
+ end
21
35
 
22
36
  end
@@ -1,6 +1,8 @@
1
1
 
2
2
  module CascadingConfiguration::CompositingArray::Instance
3
3
 
4
+ extend CascadingConfiguration::InternalModuleStub
5
+
4
6
  ###################
5
7
  # self.included #
6
8
  ###################
@@ -70,6 +70,21 @@ describe CascadingConfiguration::Array do
70
70
  CascadingConfiguration::Array::MockClassSub1.configuration_setting.should == [ :a_configuration, :a_yet_unused_configuration, :another_configuration ]
71
71
  object_instance_two.configuration_setting.should == [ :a_configuration, :a_yet_unused_configuration, :another_configuration, :some_other_configuration ]
72
72
 
73
+ # test two
74
+
75
+ module CascadingConfiguration::Array::MockModuleExtended
76
+ include CascadingConfiguration::Array
77
+ attr_configuration_array :configuration_setting
78
+ configuration_setting.should == []
79
+ configuration_setting.push( :a_configuration )
80
+ configuration_setting.should == [ :a_configuration ]
81
+ end
82
+
83
+ class CascadingConfiguration::Array::MockClassExtended
84
+ extend CascadingConfiguration::Array::MockModuleExtended
85
+ configuration_setting.should == [ :a_configuration ]
86
+ end
87
+
73
88
  end
74
89
 
75
90
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 2
9
- version: 1.1.2
8
+ - 3
9
+ version: 1.1.3
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-16 00:00:00 -04:00
17
+ date: 2011-07-18 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency