cascading-configuration-array 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,21 +5,18 @@ else
5
5
  require 'cascading-configuration-variable'
6
6
  end
7
7
 
8
- module CascadingConfiguration
8
+ module ::CascadingConfiguration
9
9
  module Array
10
10
  class CompositingArray < ::Array
11
11
  end
12
12
  module ModuleSupportMethods
13
13
  end
14
14
  module Interface
15
- module GettersSetters
16
- end
17
15
  end
18
16
  end
19
17
  end
20
18
 
21
19
  require_relative 'cascading-configuration-array/_private_/CascadingConfiguration/Array/CompositingArray.rb'
22
- require_relative 'cascading-configuration-array/_private_/CascadingConfiguration/Array/Interface/GettersSetters.rb'
23
20
  require_relative 'cascading-configuration-array/_private_/CascadingConfiguration/Array/ModuleSupportMethods.rb'
24
21
 
25
22
  require_relative 'cascading-configuration-array/CascadingConfiguration/Array/Interface.rb'
@@ -1,8 +1,36 @@
1
1
 
2
2
  module ::CascadingConfiguration::Array::Interface
3
3
 
4
- # Support methods that define configuration settings array methods
5
- include ::CascadingConfiguration::Array::Interface::GettersSetters
4
+ ######################
5
+ # self.setter_proc #
6
+ ######################
7
+
8
+ def self.setter_proc( configuration_name )
9
+
10
+ return Proc.new do |array|
11
+
12
+ return ::CascadingConfiguration::Array.set_composite_array( self,
13
+ configuration_name,
14
+ array )
15
+
16
+ end
17
+
18
+ end
19
+
20
+ ######################
21
+ # self.getter_proc #
22
+ ######################
23
+
24
+ def self.getter_proc( configuration_name )
25
+
26
+ return Proc.new do
27
+
28
+ return ::CascadingConfiguration::Array.composite_array( self,
29
+ configuration_name )
30
+
31
+ end
32
+
33
+ end
6
34
 
7
35
  ##############################
8
36
  # attr_configuration_array #
@@ -12,14 +40,10 @@ module ::CascadingConfiguration::Array::Interface
12
40
  # configuration cascades downward to instance including all classes or modules in-between
13
41
  def attr_configuration_array( *configuration_names )
14
42
 
15
- configuration_names.each do |this_configuration_name|
16
- # define configuration setter
17
- define_cascading_array_setter( this_configuration_name )
18
- # define configuration getter
19
- define_cascading_array_getter( this_configuration_name )
20
- end
21
-
22
- return self
43
+ return ::CascadingConfiguration::Variable.
44
+ define_cascading_configuration( self,
45
+ ::CascadingConfiguration::Array::Interface,
46
+ *configuration_names )
23
47
 
24
48
  end
25
49
 
@@ -31,14 +55,10 @@ module ::CascadingConfiguration::Array::Interface
31
55
  # configuration cascades downward to last class or module
32
56
  def attr_module_configuration_array( *configuration_names )
33
57
 
34
- configuration_names.each do |this_configuration_name|
35
- # define configuration setter
36
- define_class_configuration_array_setter( this_configuration_name )
37
- # define configuration getter
38
- define_class_configuration_array_getter( this_configuration_name )
39
- end
40
-
41
- return self
58
+ return ::CascadingConfiguration::Variable.
59
+ define_module_configuration( self,
60
+ ::CascadingConfiguration::Array::Interface,
61
+ *configuration_names )
42
62
 
43
63
  end
44
64
  alias_method :attr_class_configuration_array, :attr_module_configuration_array
@@ -51,16 +71,10 @@ module ::CascadingConfiguration::Array::Interface
51
71
  # configuration does not cascade
52
72
  def attr_local_configuration_array( *configuration_names )
53
73
 
54
- ::CascadingConfiguration::Variable.create_local_instance_configuration_support_module( self )
55
-
56
- configuration_names.each do |this_configuration_name|
57
- # define configuration setter
58
- define_local_configuration_array_setter( this_configuration_name )
59
- # define configuration getter
60
- define_local_configuration_array_getter( this_configuration_name )
61
- end
62
-
63
- return self
74
+ return ::CascadingConfiguration::Variable.
75
+ define_local_configuration( self,
76
+ ::CascadingConfiguration::Array::Interface,
77
+ *configuration_names )
64
78
 
65
79
  end
66
80
 
@@ -72,16 +86,10 @@ module ::CascadingConfiguration::Array::Interface
72
86
  # configuration does not cascade
73
87
  def attr_object_configuration_array( *configuration_names )
74
88
 
75
- ::CascadingConfiguration::Variable.create_local_instance_configuration_support_module( self )
76
-
77
- configuration_names.each do |this_configuration_name|
78
- # define configuration setter
79
- define_object_configuration_array_setter( this_configuration_name )
80
- # define configuration getter
81
- define_object_configuration_array_getter( this_configuration_name )
82
- end
83
-
84
- return self
89
+ return ::CascadingConfiguration::Variable.
90
+ define_object_configuration( self,
91
+ ::CascadingConfiguration::Array::Interface,
92
+ *configuration_names )
85
93
 
86
94
  end
87
95
 
@@ -93,14 +101,10 @@ module ::CascadingConfiguration::Array::Interface
93
101
  # configuration does not cascade
94
102
  def attr_instance_configuration_array( *configuration_names )
95
103
 
96
- configuration_names.each do |this_configuration_name|
97
- # define configuration setter
98
- define_instance_configuration_array_setter( this_configuration_name )
99
- # define configuration getter
100
- define_instance_configuration_array_getter( this_configuration_name )
101
- end
102
-
103
- return self
104
+ return ::CascadingConfiguration::Variable.
105
+ define_instance_configuration( self,
106
+ ::CascadingConfiguration::Array::Interface,
107
+ *configuration_names )
104
108
 
105
109
  end
106
110
 
@@ -25,7 +25,7 @@ describe CascadingConfiguration::Array do
25
25
  # => instances of including classes get configurations
26
26
  # => extending modules and classes get attr_configuration and configurations
27
27
  # => instances of extending classes get nothing
28
- module CascadingConfiguration::Array::ConfigurationMockModuleExtended
28
+ module ::CascadingConfiguration::Array::ConfigurationMockModuleExtended
29
29
  extend CascadingConfiguration::Array
30
30
  # => singleton gets attr_configuration and configurations
31
31
  respond_to?( :attr_configuration_array ).should == true
@@ -66,7 +66,7 @@ describe CascadingConfiguration::Array do
66
66
  end
67
67
 
68
68
  # * module included with setting
69
- module CascadingConfiguration::Array::ConfigurationMockModuleIncluded
69
+ module ::CascadingConfiguration::Array::ConfigurationMockModuleIncluded
70
70
  include CascadingConfiguration::Array
71
71
  # => singleton gets attr_configuration and configurations
72
72
  respond_to?( :attr_configuration_array ).should == true
@@ -201,7 +201,7 @@ describe CascadingConfiguration::Array do
201
201
  # => instances of including classes get configurations
202
202
  # => extending modules and classes get attr_configuration and configurations
203
203
  # => instances of extending classes get nothing
204
- module CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
204
+ module ::CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
205
205
  extend CascadingConfiguration::Array
206
206
  # => singleton gets attr_configuration and configurations
207
207
  respond_to?( :attr_module_configuration_array ).should == true
@@ -243,7 +243,7 @@ describe CascadingConfiguration::Array do
243
243
  end
244
244
 
245
245
  # * module included with setting
246
- module CascadingConfiguration::Array::ClassConfigurationMockModuleIncluded
246
+ module ::CascadingConfiguration::Array::ClassConfigurationMockModuleIncluded
247
247
  include CascadingConfiguration::Array
248
248
  # => singleton gets attr_configuration and configurations
249
249
  respond_to?( :attr_module_configuration_array ).should == true
@@ -368,7 +368,7 @@ describe CascadingConfiguration::Array do
368
368
  # => instances of including classes get configurations
369
369
  # => extending modules and classes get attr_configuration and configurations
370
370
  # => instances of extending classes get nothing
371
- module CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
371
+ module ::CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
372
372
  extend CascadingConfiguration::Array
373
373
  # => singleton gets attr_configuration and configurations
374
374
  respond_to?( :attr_local_configuration_array ).should == true
@@ -409,7 +409,7 @@ describe CascadingConfiguration::Array do
409
409
  end
410
410
 
411
411
  # * module included with setting
412
- module CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded
412
+ module ::CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded
413
413
  include CascadingConfiguration::Array
414
414
  # => singleton gets attr_configuration and configurations
415
415
  respond_to?( :attr_local_configuration_array ).should == true
@@ -502,7 +502,7 @@ describe CascadingConfiguration::Array do
502
502
  # => instances of including classes get configurations
503
503
  # => extending modules and classes get attr_configuration and configurations
504
504
  # => instances of extending classes get nothing
505
- module CascadingConfiguration::Array::InstanceConfigurationMockModuleExtended
505
+ module ::CascadingConfiguration::Array::InstanceConfigurationMockModuleExtended
506
506
  extend CascadingConfiguration::Array
507
507
  # => singleton gets attr_configuration and configurations
508
508
  instance_variables.empty?.should == true
@@ -536,7 +536,7 @@ describe CascadingConfiguration::Array do
536
536
  end
537
537
 
538
538
  # * module included with setting
539
- module CascadingConfiguration::Array::InstanceConfigurationMockModuleIncluded
539
+ module ::CascadingConfiguration::Array::InstanceConfigurationMockModuleIncluded
540
540
  include CascadingConfiguration::Array
541
541
  # => singleton gets attr_configuration and configurations
542
542
  respond_to?( :attr_instance_configuration_array ).should == true
@@ -628,7 +628,7 @@ describe CascadingConfiguration::Array do
628
628
  # => instances of including classes get configurations
629
629
  # => extending modules and classes get attr_configuration and configurations
630
630
  # => instances of extending classes get nothing
631
- module CascadingConfiguration::Array::ObjectConfigurationMockModuleExtended
631
+ module ::CascadingConfiguration::Array::ObjectConfigurationMockModuleExtended
632
632
  extend CascadingConfiguration::Array
633
633
  # => singleton gets attr_configuration and configurations
634
634
  respond_to?( :attr_object_configuration_array ).should == true
@@ -669,7 +669,7 @@ describe CascadingConfiguration::Array do
669
669
  end
670
670
 
671
671
  # * module included with setting
672
- module CascadingConfiguration::Array::ObjectConfigurationMockModuleIncluded
672
+ module ::CascadingConfiguration::Array::ObjectConfigurationMockModuleIncluded
673
673
  include CascadingConfiguration::Array
674
674
  # => singleton gets attr_configuration and configurations
675
675
  respond_to?( :attr_object_configuration_array ).should == true
@@ -9,12 +9,12 @@ describe CascadingConfiguration::Array::CompositingArray do
9
9
 
10
10
  before :all do
11
11
 
12
- module CascadingConfiguration::Array::CompositingArray::MockA
12
+ module ::CascadingConfiguration::Array::CompositingArray::MockA
13
13
  # needed for ccv ancestor determination
14
14
  def self.some_configuration
15
15
  end
16
16
  end
17
- module CascadingConfiguration::Array::CompositingArray::MockB
17
+ module ::CascadingConfiguration::Array::CompositingArray::MockB
18
18
  end
19
19
 
20
20
  @configuration_instance = CascadingConfiguration::Array::CompositingArray::MockA
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cascading-configuration-array
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-02 00:00:00.000000000 Z
12
+ date: 2012-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: module-cluster
16
- requirement: &70165363277020 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *70165363277020
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: cascading-configuration-variable
27
- requirement: &70165363276340 !ruby/object:Gem::Requirement
16
+ requirement: &70108328808940 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ! '>='
@@ -32,7 +21,7 @@ dependencies:
32
21
  version: '0'
33
22
  type: :runtime
34
23
  prerelease: false
35
- version_requirements: *70165363276340
24
+ version_requirements: *70108328808940
36
25
  description: Provides :attr_configuration_array.
37
26
  email: asher@ridiculouspower.com
38
27
  executables: []
@@ -40,7 +29,6 @@ extensions: []
40
29
  extra_rdoc_files: []
41
30
  files:
42
31
  - lib/cascading-configuration-array/_private_/CascadingConfiguration/Array/CompositingArray.rb
43
- - lib/cascading-configuration-array/_private_/CascadingConfiguration/Array/Interface/GettersSetters.rb
44
32
  - lib/cascading-configuration-array/_private_/CascadingConfiguration/Array/ModuleSupportMethods.rb
45
33
  - lib/cascading-configuration-array/CascadingConfiguration/Array/Interface.rb
46
34
  - lib/cascading-configuration-array/CascadingConfiguration/Array.rb
@@ -1,213 +0,0 @@
1
-
2
- module ::CascadingConfiguration::Array::Interface::GettersSetters
3
-
4
- ###################################
5
- # define_cascading_array_setter #
6
- ###################################
7
-
8
- def define_cascading_array_setter( configuration_name )
9
-
10
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
11
-
12
- array_setter_proc = Proc.new do |array|
13
-
14
- return ::CascadingConfiguration::Array.set_composite_array( self,
15
- configuration_name,
16
- array )
17
-
18
- end
19
-
20
- ::CascadingConfiguration::Variable.define_module_method( self,
21
- configuration_setter_name,
22
- & array_setter_proc )
23
- ::CascadingConfiguration::Variable.
24
- define_instance_method_if_support_exists( self,
25
- configuration_setter_name,
26
- & array_setter_proc )
27
-
28
- end
29
-
30
- ###################################
31
- # define_cascading_array_getter #
32
- ###################################
33
-
34
- def define_cascading_array_getter( configuration_name )
35
-
36
- configuration_getter_name = configuration_name
37
-
38
- array_getter_proc = Proc.new do
39
-
40
- return ::CascadingConfiguration::Array.composite_array( self,
41
- configuration_name )
42
-
43
- end
44
-
45
- ::CascadingConfiguration::Variable.define_module_method( self,
46
- configuration_getter_name,
47
- & array_getter_proc )
48
- ::CascadingConfiguration::Variable.
49
- define_instance_method_if_support_exists( self,
50
- configuration_getter_name,
51
- & array_getter_proc )
52
-
53
- end
54
-
55
- #############################################
56
- # define_class_configuration_array_setter #
57
- #############################################
58
-
59
- def define_class_configuration_array_setter( configuration_name )
60
-
61
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
62
-
63
- ::CascadingConfiguration::Variable.define_module_method( self,
64
- configuration_setter_name ) do |array|
65
-
66
- return ::CascadingConfiguration::Array.set_composite_array( self,
67
- configuration_name,
68
- array )
69
-
70
- end
71
-
72
- end
73
-
74
- #############################################
75
- # define_class_configuration_array_getter #
76
- #############################################
77
-
78
- def define_class_configuration_array_getter( configuration_name )
79
-
80
- configuration_getter_name = configuration_name
81
-
82
- ::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name ) do
83
-
84
- return ::CascadingConfiguration::Array.composite_array( self,
85
- configuration_name )
86
-
87
- end
88
-
89
- end
90
-
91
- #############################################
92
- # define_local_configuration_array_setter #
93
- #############################################
94
-
95
- def define_local_configuration_array_setter( configuration_name )
96
-
97
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
98
-
99
- local_setter_proc = Proc.new do |array|
100
-
101
- return ::CascadingConfiguration::Array.set_composite_array( self,
102
- configuration_name,
103
- array )
104
-
105
- end
106
-
107
- ::CascadingConfiguration::Variable.define_local_instance_method( self,
108
- configuration_setter_name,
109
- & local_setter_proc )
110
- ::CascadingConfiguration::Variable.
111
- define_instance_method_if_support_exists( self,
112
- configuration_setter_name,
113
- & local_setter_proc )
114
-
115
- end
116
-
117
- #############################################
118
- # define_local_configuration_array_getter #
119
- #############################################
120
-
121
- def define_local_configuration_array_getter( configuration_name )
122
-
123
- configuration_getter_name = configuration_name
124
-
125
- local_getter_proc = Proc.new do
126
-
127
- return ::CascadingConfiguration::Array.composite_array( self,
128
- configuration_name )
129
-
130
- end
131
-
132
- ::CascadingConfiguration::Variable.define_local_instance_method( self,
133
- configuration_getter_name,
134
- & local_getter_proc )
135
- ::CascadingConfiguration::Variable.
136
- define_instance_method_if_support_exists( self,
137
- configuration_getter_name,
138
- & local_getter_proc )
139
-
140
- end
141
-
142
- ################################################
143
- # define_instance_configuration_array_setter #
144
- ################################################
145
-
146
- def define_instance_configuration_array_setter( configuration_name )
147
-
148
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
149
-
150
- ::CascadingConfiguration::Variable.
151
- define_instance_method( self, configuration_setter_name ) do |array|
152
-
153
- return ::CascadingConfiguration::Array.set_composite_array( self,
154
- configuration_name,
155
- array )
156
-
157
- end
158
-
159
- end
160
-
161
- ################################################
162
- # define_instance_configuration_array_getter #
163
- ################################################
164
-
165
- def define_instance_configuration_array_getter( configuration_name )
166
-
167
- configuration_getter_name = configuration_name
168
-
169
- ::CascadingConfiguration::Variable.define_instance_method( self, configuration_getter_name ) do
170
-
171
- return ::CascadingConfiguration::Array.composite_array( self,
172
- configuration_name )
173
-
174
- end
175
-
176
- end
177
-
178
- ##############################################
179
- # define_object_configuration_array_setter #
180
- ##############################################
181
-
182
- def define_object_configuration_array_setter( configuration_name )
183
-
184
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
185
-
186
- ::CascadingConfiguration::Variable.
187
- define_local_instance_method( self, configuration_setter_name ) do |array|
188
-
189
- return ::CascadingConfiguration::Array.set_composite_array( self,
190
- configuration_name,
191
- array )
192
-
193
- end
194
-
195
- end
196
-
197
- ##############################################
198
- # define_object_configuration_array_getter #
199
- ##############################################
200
-
201
- def define_object_configuration_array_getter( configuration_name )
202
-
203
- configuration_getter_name = configuration_name
204
-
205
- ::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_getter_name ) do
206
-
207
- return ::CascadingConfiguration::Array.composite_array( self, configuration_name )
208
-
209
- end
210
-
211
- end
212
-
213
- end