cascading-configuration-hash 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::Hash
3
3
 
4
4
  extend CascadingConfiguration::InternalModuleStub
5
5
 
6
+ include CascadingConfiguration::Variable
7
+ include CascadingConfiguration::CompositingHash::Instance
8
+
6
9
  ###################
7
10
  # self.included #
8
11
  ###################
@@ -10,15 +13,11 @@ module CascadingConfiguration::Hash
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::CompositingHash::Instance
18
19
  # module support
19
- unless is_a?( Class )
20
- extend CascadingConfiguration::Hash::ModuleInstance
21
- end
20
+ extend CascadingConfiguration::Hash::ModuleInstance unless is_a?( Class )
22
21
  end
23
22
  end
24
23
 
@@ -18,5 +18,19 @@ module CascadingConfiguration::Hash::ModuleInstance
18
18
  include CascadingConfiguration::Hash
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::Hash
29
+ module_self = self
30
+ class_or_module.instance_eval do
31
+ # cascade CascadingConfiguration::Hash
32
+ include CascadingConfiguration::Hash
33
+ end
34
+ end
21
35
 
22
36
  end
@@ -123,6 +123,21 @@ describe CascadingConfiguration::Hash do
123
123
  self.some_hash.replace( { :one => 1, :two => 2 } )
124
124
  self.some_hash.should == { :one => 0, :two => 0 }
125
125
  end
126
+
127
+ # test two
128
+
129
+ module CascadingConfiguration::Hash::MockModuleExtended
130
+ include CascadingConfiguration::Hash
131
+ attr_configuration_hash :configuration_setting
132
+ configuration_setting.should == {}
133
+ configuration_setting[ :a_configuration ] = :some_value
134
+ configuration_setting.should == { :a_configuration => :some_value }
135
+ end
136
+
137
+ class CascadingConfiguration::Hash::MockClassExtended
138
+ extend CascadingConfiguration::Hash::MockModuleExtended
139
+ configuration_setting.should == { :a_configuration => :some_value }
140
+ end
126
141
 
127
142
  end
128
143
 
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