cascading-configuration-setting 1.1.1 → 1.1.3

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.
@@ -3,6 +3,8 @@ module CascadingConfiguration::Setting
3
3
 
4
4
  extend CascadingConfiguration::InternalModuleStub
5
5
 
6
+ include CascadingConfiguration::Variable
7
+
6
8
  ###################
7
9
  # self.included #
8
10
  ###################
@@ -10,15 +12,11 @@ module CascadingConfiguration::Setting
10
12
  def self.included( class_or_module )
11
13
  module_self = self
12
14
  class_or_module.instance_eval do
13
- include CascadingConfiguration::Variable
14
15
  extend module_self
15
- include module_self::ObjectInstance
16
16
  extend module_self::ClassInstance
17
17
  extend module_self::Accessors
18
18
  # module support
19
- unless is_a?( Class )
20
- extend CascadingConfiguration::Setting::ModuleInstance
21
- end
19
+ extend CascadingConfiguration::Setting::ModuleInstance unless is_a?( Class )
22
20
  end
23
21
  end
24
22
 
@@ -12,11 +12,25 @@ module CascadingConfiguration::Setting::ModuleInstance
12
12
  # CascadingConfiguration::Setting
13
13
  module_self = self
14
14
  class_or_module.instance_eval do
15
- # whichever module included CascadingConfiguration::Setting
15
+ # whichever module included CascadingConfiguration::Setting, which is now being included
16
16
  extend module_self
17
17
  # cascade CascadingConfiguration::Setting
18
18
  include CascadingConfiguration::Setting
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::Setting
29
+ module_self = self
30
+ class_or_module.instance_eval do
31
+ # cascade CascadingConfiguration::Setting
32
+ include CascadingConfiguration::Setting
33
+ end
34
+ end
21
35
 
22
36
  end
@@ -39,5 +39,20 @@ describe CascadingConfiguration::Setting do
39
39
  some_other_configuration.should == :a_third_setting_value
40
40
  end
41
41
  end
42
-
42
+
43
+ # test two
44
+
45
+ module CascadingConfiguration::Setting::MockModuleExtended
46
+ include CascadingConfiguration::Setting
47
+ attr_configuration :some_other_configuration
48
+ self.some_other_configuration = :our_setting_value
49
+ some_other_configuration.should == :our_setting_value
50
+ end
51
+
52
+ class CascadingConfiguration::Setting::MockClassExtended
53
+ extend CascadingConfiguration::Setting::MockModuleExtended
54
+ self.some_other_configuration = :our_setting_value
55
+ some_other_configuration.should == :our_setting_value
56
+ end
57
+
43
58
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
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-15 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