cascading-configuration-setting 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,7 @@ module CascadingConfiguration::Setting::Interface
53
53
  # * first class to include module (inherited)
54
54
  def attr_local_configuration( *configuration_names )
55
55
 
56
- CascadingConfiguration::Variable::ConfigurationSupport.create_local_instance_configuration_support_module( self )
56
+ CascadingConfiguration::Variable.create_local_instance_configuration_support_module( self )
57
57
 
58
58
  configuration_names.each do |this_configuration_name|
59
59
  # define configuration setter
@@ -74,7 +74,7 @@ module CascadingConfiguration::Setting::Interface
74
74
  # * only in the instance that declares it
75
75
  def attr_object_configuration( *configuration_names )
76
76
 
77
- CascadingConfiguration::Variable::ConfigurationSupport.create_local_instance_configuration_support_module( self )
77
+ CascadingConfiguration::Variable.create_local_instance_configuration_support_module( self )
78
78
 
79
79
  configuration_names.each do |this_configuration_name|
80
80
  # define configuration setter
@@ -9,20 +9,12 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
9
9
 
10
10
  configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
11
11
 
12
- configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.configuration_support_module( self )
13
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
14
-
15
12
  setter_proc = Proc.new do |value|
16
- ::CascadingConfiguration::Variable::ConfigurationSupport.set_configuration_variable( self, configuration_name, value )
13
+ ::CascadingConfiguration::Variable.set_configuration_variable( self, configuration_name, value )
17
14
  end
18
15
 
19
- configuration_support_module.module_eval do
20
- define_method( configuration_setter_name, & setter_proc )
21
- end
22
-
23
- instance_configuration_support_module.module_eval do
24
- define_method( configuration_setter_name, & setter_proc )
25
- end if instance_configuration_support_module
16
+ ::CascadingConfiguration::Variable.define_module_method( self, configuration_setter_name, & setter_proc )
17
+ ::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_setter_name, & setter_proc )
26
18
 
27
19
  end
28
20
 
@@ -34,20 +26,12 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
34
26
 
35
27
  configuration_getter_name = configuration_name
36
28
 
37
- configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.configuration_support_module( self )
38
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
39
-
40
29
  getter_proc = Proc.new do
41
- return ::CascadingConfiguration::Variable::ConfigurationSupport.get_configuration_searching_upward( self, configuration_name )
30
+ return ::CascadingConfiguration::Variable.get_configuration_searching_upward( self, configuration_name )
42
31
  end
43
32
 
44
- configuration_support_module.module_eval do
45
- define_method( configuration_getter_name, & getter_proc )
46
- end
47
-
48
- instance_configuration_support_module.module_eval do
49
- define_method( configuration_getter_name, & getter_proc )
50
- end if instance_configuration_support_module
33
+ ::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name, & getter_proc )
34
+ ::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_getter_name, & getter_proc )
51
35
 
52
36
  end
53
37
 
@@ -59,17 +43,13 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
59
43
 
60
44
  configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
61
45
 
62
- configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.configuration_support_module( self )
63
-
64
- configuration_support_module.module_eval do
65
- define_method( configuration_setter_name ) do |value|
46
+ ::CascadingConfiguration::Variable.define_module_method( self, configuration_setter_name ) do |value|
66
47
 
67
- # configuration setter returns setting variable (variable from self), which is now the ID of value
68
- return ::CascadingConfiguration::Variable::ConfigurationSupport.set_configuration_variable( self,
69
- configuration_name,
70
- value )
48
+ # configuration setter returns setting variable (variable from self), which is now the ID of value
49
+ return ::CascadingConfiguration::Variable.set_configuration_variable( self,
50
+ configuration_name,
51
+ value )
71
52
 
72
- end
73
53
  end
74
54
 
75
55
  end
@@ -82,17 +62,15 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
82
62
 
83
63
  configuration_getter_name = configuration_name
84
64
 
85
- configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.configuration_support_module( self )
65
+ configuration_support_module = ::CascadingConfiguration::Variable.configuration_support_module( self )
86
66
 
87
- configuration_support_module.module_eval do
88
- define_method( configuration_getter_name ) do
67
+ ::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name ) do
89
68
 
90
- # configuration getter returns current setting value (taken from first superclass with setting)
91
- # that means first variable that has been set
92
- return ::CascadingConfiguration::Variable::ConfigurationSupport.get_configuration_searching_upward( self,
93
- configuration_name )
69
+ # configuration getter returns current setting value (taken from first superclass with setting)
70
+ # that means first variable that has been set
71
+ return ::CascadingConfiguration::Variable.get_configuration_searching_upward( self,
72
+ configuration_name )
94
73
 
95
- end
96
74
  end
97
75
 
98
76
  end
@@ -105,23 +83,15 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
105
83
 
106
84
  configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
107
85
 
108
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
109
- local_instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.local_instance_configuration_support_module( self )
110
-
111
86
  local_setter_proc = Proc.new do |value|
112
87
 
113
88
  # configuration setter returns setting variable (variable from self), which is now the ID of value
114
- return ::CascadingConfiguration::Variable::ConfigurationSupport.set_configuration_variable( self, configuration_name, value )
89
+ return ::CascadingConfiguration::Variable.set_configuration_variable( self, configuration_name, value )
115
90
 
116
91
  end
117
92
 
118
- instance_configuration_support_module.module_eval do
119
- define_method( configuration_setter_name, & local_setter_proc )
120
- end if instance_configuration_support_module
121
-
122
- local_instance_configuration_support_module.module_eval do
123
- define_method( configuration_setter_name, & local_setter_proc )
124
- end
93
+ ::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_setter_name, & local_setter_proc )
94
+ ::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_setter_name, & local_setter_proc )
125
95
 
126
96
  end
127
97
 
@@ -133,24 +103,16 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
133
103
 
134
104
  configuration_getter_name = configuration_name
135
105
 
136
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
137
- local_instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.local_instance_configuration_support_module( self )
138
-
139
106
  local_getter_proc = Proc.new do
140
107
 
141
108
  # configuration getter returns current setting value (taken from first superclass with setting)
142
109
  # that means first variable that has been set
143
- return ::CascadingConfiguration::Variable::ConfigurationSupport.get_configuration_variable( self, configuration_name )
110
+ return ::CascadingConfiguration::Variable.get_configuration_variable( self, configuration_name )
144
111
 
145
112
  end
146
113
 
147
- instance_configuration_support_module.module_eval do
148
- define_method( configuration_getter_name, & local_getter_proc )
149
- end if instance_configuration_support_module
150
-
151
- local_instance_configuration_support_module.module_eval do
152
- define_method( configuration_getter_name, & local_getter_proc )
153
- end
114
+ ::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_getter_name, & local_getter_proc )
115
+ ::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_getter_name, & local_getter_proc )
154
116
 
155
117
  end
156
118
 
@@ -162,15 +124,11 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
162
124
 
163
125
  configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
164
126
 
165
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
166
-
167
- instance_configuration_support_module.module_eval do
168
- define_method( configuration_setter_name ) do |value|
127
+ ::CascadingConfiguration::Variable.define_instance_method( self, configuration_setter_name ) do |value|
169
128
 
170
129
  # configuration setter returns setting variable (variable from self), which is now the ID of value
171
- return ::CascadingConfiguration::Variable::ConfigurationSupport.set_configuration_variable( self, configuration_name, value )
130
+ return ::CascadingConfiguration::Variable.set_configuration_variable( self, configuration_name, value )
172
131
 
173
- end
174
132
  end
175
133
 
176
134
  end
@@ -183,16 +141,12 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
183
141
 
184
142
  configuration_getter_name = configuration_name
185
143
 
186
- instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.instance_configuration_support_module( self )
187
-
188
- instance_configuration_support_module.module_eval do
189
- define_method( configuration_getter_name ) do
144
+ ::CascadingConfiguration::Variable.define_instance_method( self, configuration_getter_name ) do
190
145
 
191
- # configuration getter returns current setting value (taken from first superclass with setting)
192
- # that means first variable that has been set
193
- return ::CascadingConfiguration::Variable::ConfigurationSupport.get_configuration_variable( self, configuration_name )
146
+ # configuration getter returns current setting value (taken from first superclass with setting)
147
+ # that means first variable that has been set
148
+ return ::CascadingConfiguration::Variable.get_configuration_variable( self, configuration_name )
194
149
 
195
- end
196
150
  end
197
151
 
198
152
  end
@@ -205,15 +159,13 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
205
159
 
206
160
  configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
207
161
 
208
- local_instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.local_instance_configuration_support_module( self )
162
+ local_instance_configuration_support_module = ::CascadingConfiguration::Variable.local_instance_configuration_support_module( self )
209
163
 
210
- local_instance_configuration_support_module.module_eval do
211
- define_method( configuration_setter_name ) do |value|
164
+ ::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_setter_name ) do |value|
212
165
 
213
- # configuration setter returns setting variable (variable from self), which is now the ID of value
214
- return ::CascadingConfiguration::Variable::ConfigurationSupport.set_configuration_variable( self, configuration_name, value )
166
+ # configuration setter returns setting variable (variable from self), which is now the ID of value
167
+ return ::CascadingConfiguration::Variable.set_configuration_variable( self, configuration_name, value )
215
168
 
216
- end
217
169
  end
218
170
 
219
171
  end
@@ -226,16 +178,14 @@ module CascadingConfiguration::Setting::Interface::GettersSetters
226
178
 
227
179
  configuration_getter_name = configuration_name
228
180
 
229
- local_instance_configuration_support_module = ::CascadingConfiguration::Variable::ConfigurationSupport.local_instance_configuration_support_module( self )
181
+ local_instance_configuration_support_module = ::CascadingConfiguration::Variable.local_instance_configuration_support_module( self )
230
182
 
231
- local_instance_configuration_support_module.module_eval do
232
- define_method( configuration_getter_name ) do
183
+ ::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_getter_name ) do
233
184
 
234
- # configuration getter returns current setting value (taken from first superclass with setting)
235
- # that means first variable that has been set
236
- return ::CascadingConfiguration::Variable::ConfigurationSupport.get_configuration_variable( self, configuration_name )
185
+ # configuration getter returns current setting value (taken from first superclass with setting)
186
+ # that means first variable that has been set
187
+ return ::CascadingConfiguration::Variable.get_configuration_variable( self, configuration_name )
237
188
 
238
- end
239
189
  end
240
190
 
241
191
  end
@@ -60,6 +60,7 @@ describe CascadingConfiguration::Setting do
60
60
  module CascadingConfiguration::Setting::ConfigurationMockIncluded
61
61
  include CascadingConfiguration::Setting
62
62
  # => singleton gets attr_configuration and configurations
63
+ eigenclass = class << self ; self ; end
63
64
  respond_to?( :attr_configuration ).should == true
64
65
  attr_configuration :some_configuration
65
66
  respond_to?( :some_configuration ).should == true
metadata CHANGED
@@ -1,48 +1,44 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cascading-configuration-setting
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.2
4
5
  prerelease:
5
- version: 1.6.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Asher
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-02-03 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: module-cluster
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70225223590020 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: cascading-configuration-variable
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70225223590020
25
+ - !ruby/object:Gem::Dependency
26
+ name: cascading-configuration-variable
27
+ requirement: &70225223588760 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
35
33
  type: :runtime
36
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *70225223588760
37
36
  description: Provides :attr_configuration.
38
37
  email: asher@ridiculouspower.com
39
38
  executables: []
40
-
41
39
  extensions: []
42
-
43
40
  extra_rdoc_files: []
44
-
45
- files:
41
+ files:
46
42
  - lib/cascading-configuration-setting/_private_/CascadingConfiguration/Setting/Interface/GettersSetters.rb
47
43
  - lib/cascading-configuration-setting/CascadingConfiguration/Setting/Interface.rb
48
44
  - lib/cascading-configuration-setting/CascadingConfiguration/Setting.rb
@@ -52,30 +48,26 @@ files:
52
48
  - README.rdoc
53
49
  homepage: http://rubygems.org/gems/cascading-configuration-setting
54
50
  licenses: []
55
-
56
51
  post_install_message:
57
52
  rdoc_options: []
58
-
59
- require_paths:
53
+ require_paths:
60
54
  - lib
61
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
62
56
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
67
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
62
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
73
67
  requirements: []
74
-
75
68
  rubyforge_project: cascading-configuration-setting
76
69
  rubygems_version: 1.8.10
77
70
  signing_key:
78
71
  specification_version: 3
79
72
  summary: Support package for cascading-configuration.
80
73
  test_files: []
81
-