cascading-configuration-array-unique 2.0.0 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ else
5
5
  require 'cascading-configuration-variable'
6
6
  end
7
7
 
8
- module CascadingConfiguration
8
+ module ::CascadingConfiguration
9
9
  module Array
10
10
  module Unique
11
11
  class CompositingArray < ::CascadingConfiguration::Array::CompositingArray
@@ -13,15 +13,12 @@ module CascadingConfiguration
13
13
  module ModuleSupportMethods
14
14
  end
15
15
  module Interface
16
- module GettersSetters
17
- end
18
16
  end
19
17
  end
20
18
  end
21
19
  end
22
20
 
23
21
  require_relative 'cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/CompositingArray.rb'
24
- require_relative 'cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/Interface/GettersSetters.rb'
25
22
  require_relative 'cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/ModuleSupportMethods.rb'
26
23
 
27
24
  require_relative 'cascading-configuration-array-unique/CascadingConfiguration/Array/Unique/Interface.rb'
@@ -1,8 +1,36 @@
1
1
 
2
2
  module ::CascadingConfiguration::Array::Unique::Interface
3
3
 
4
- # Support methods that define configuration settings array methods
5
- include ::CascadingConfiguration::Array::Unique::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::Unique.set_composite_unique_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::Unique.composite_unique_array( self,
29
+ configuration_name )
30
+
31
+ end
32
+
33
+ end
6
34
 
7
35
  #####################################
8
36
  # attr_configuration_unique_array #
@@ -12,14 +40,10 @@ module ::CascadingConfiguration::Array::Unique::Interface
12
40
  # configuration cascades downward to instance including all classes or modules in-between
13
41
  def attr_configuration_unique_array( *configuration_names )
14
42
 
15
- configuration_names.each do |this_configuration_name|
16
- # define configuration setter
17
- define_cascading_unique_array_setter( this_configuration_name )
18
- # define configuration getter
19
- define_cascading_unique_array_getter( this_configuration_name )
20
- end
21
-
22
- return self
43
+ return ::CascadingConfiguration::Variable.
44
+ define_cascading_configuration( self,
45
+ ::CascadingConfiguration::Array::Unique::Interface,
46
+ *configuration_names )
23
47
 
24
48
  end
25
49
 
@@ -31,14 +55,10 @@ module ::CascadingConfiguration::Array::Unique::Interface
31
55
  # configuration cascades downward to last class or module
32
56
  def attr_module_configuration_unique_array( *configuration_names )
33
57
 
34
- configuration_names.each do |this_configuration_name|
35
- # define configuration setter
36
- define_class_configuration_unique_array_setter( this_configuration_name )
37
- # define configuration getter
38
- define_class_configuration_unique_array_getter( this_configuration_name )
39
- end
40
-
41
- return self
58
+ return ::CascadingConfiguration::Variable.
59
+ define_module_configuration( self,
60
+ ::CascadingConfiguration::Array::Unique::Interface,
61
+ *configuration_names )
42
62
 
43
63
  end
44
64
  alias_method :attr_class_configuration_unique_array, :attr_module_configuration_unique_array
@@ -51,16 +71,10 @@ module ::CascadingConfiguration::Array::Unique::Interface
51
71
  # configuration does not cascade
52
72
  def attr_local_configuration_unique_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_unique_array_setter( this_configuration_name )
59
- # define configuration getter
60
- define_local_configuration_unique_array_getter( this_configuration_name )
61
- end
62
-
63
- return self
74
+ return ::CascadingConfiguration::Variable.
75
+ define_local_configuration( self,
76
+ ::CascadingConfiguration::Array::Unique::Interface,
77
+ *configuration_names )
64
78
 
65
79
  end
66
80
 
@@ -72,16 +86,10 @@ module ::CascadingConfiguration::Array::Unique::Interface
72
86
  # configuration does not cascade
73
87
  def attr_object_configuration_unique_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_unique_array_setter( this_configuration_name )
80
- # define configuration getter
81
- define_object_configuration_unique_array_getter( this_configuration_name )
82
- end
83
-
84
- return self
89
+ return ::CascadingConfiguration::Variable.
90
+ define_object_configuration( self,
91
+ ::CascadingConfiguration::Array::Unique::Interface,
92
+ *configuration_names )
85
93
 
86
94
  end
87
95
 
@@ -93,14 +101,10 @@ module ::CascadingConfiguration::Array::Unique::Interface
93
101
  # configuration does not cascade
94
102
  def attr_instance_configuration_unique_array( *configuration_names )
95
103
 
96
- configuration_names.each do |this_configuration_name|
97
- # define configuration setter
98
- define_instance_configuration_unique_array_setter( this_configuration_name )
99
- # define configuration getter
100
- define_instance_configuration_unique_array_getter( this_configuration_name )
101
- end
102
-
103
- return self
104
+ return ::CascadingConfiguration::Variable.
105
+ define_instance_configuration( self,
106
+ ::CascadingConfiguration::Array::Unique::Interface,
107
+ *configuration_names )
104
108
 
105
109
  end
106
110
 
@@ -25,7 +25,7 @@ describe CascadingConfiguration::Array::Unique 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::Unique::ConfigurationMockModuleExtended
28
+ module ::CascadingConfiguration::Array::Unique::ConfigurationMockModuleExtended
29
29
  extend CascadingConfiguration::Array::Unique
30
30
  # => singleton gets attr_configuration and configurations
31
31
  respond_to?( :attr_configuration_unique_array ).should == true
@@ -66,7 +66,7 @@ describe CascadingConfiguration::Array::Unique do
66
66
  end
67
67
 
68
68
  # * module included with setting
69
- module CascadingConfiguration::Array::Unique::ConfigurationMockModuleIncluded
69
+ module ::CascadingConfiguration::Array::Unique::ConfigurationMockModuleIncluded
70
70
  include CascadingConfiguration::Array::Unique
71
71
  # => singleton gets attr_configuration and configurations
72
72
  respond_to?( :attr_configuration_unique_array ).should == true
@@ -205,7 +205,7 @@ describe CascadingConfiguration::Array::Unique do
205
205
  # => instances of including classes get configurations
206
206
  # => extending modules and classes get attr_configuration and configurations
207
207
  # => instances of extending classes get nothing
208
- module CascadingConfiguration::Array::Unique::ClassConfigurationMockModuleExtended
208
+ module ::CascadingConfiguration::Array::Unique::ClassConfigurationMockModuleExtended
209
209
  extend CascadingConfiguration::Array::Unique
210
210
  # => singleton gets attr_configuration and configurations
211
211
  respond_to?( :attr_module_configuration_unique_array ).should == true
@@ -247,7 +247,7 @@ describe CascadingConfiguration::Array::Unique do
247
247
  end
248
248
 
249
249
  # * module included with setting
250
- module CascadingConfiguration::Array::Unique::ClassConfigurationMockModuleIncluded
250
+ module ::CascadingConfiguration::Array::Unique::ClassConfigurationMockModuleIncluded
251
251
  include CascadingConfiguration::Array::Unique
252
252
  # => singleton gets attr_configuration and configurations
253
253
  respond_to?( :attr_module_configuration_unique_array ).should == true
@@ -372,7 +372,7 @@ describe CascadingConfiguration::Array::Unique do
372
372
  # => instances of including classes get configurations
373
373
  # => extending modules and classes get attr_configuration and configurations
374
374
  # => instances of extending classes get nothing
375
- module CascadingConfiguration::Array::Unique::LocalConfigurationMockModuleExtended
375
+ module ::CascadingConfiguration::Array::Unique::LocalConfigurationMockModuleExtended
376
376
  extend CascadingConfiguration::Array::Unique
377
377
  # => singleton gets attr_configuration and configurations
378
378
  respond_to?( :attr_local_configuration_unique_array ).should == true
@@ -413,7 +413,7 @@ describe CascadingConfiguration::Array::Unique do
413
413
  end
414
414
 
415
415
  # * module included with setting
416
- module CascadingConfiguration::Array::Unique::LocalConfigurationMockModuleIncluded
416
+ module ::CascadingConfiguration::Array::Unique::LocalConfigurationMockModuleIncluded
417
417
  include CascadingConfiguration::Array::Unique
418
418
  # => singleton gets attr_configuration and configurations
419
419
  respond_to?( :attr_local_configuration_unique_array ).should == true
@@ -506,7 +506,7 @@ describe CascadingConfiguration::Array::Unique do
506
506
  # => instances of including classes get configurations
507
507
  # => extending modules and classes get attr_configuration and configurations
508
508
  # => instances of extending classes get nothing
509
- module CascadingConfiguration::Array::Unique::InstanceConfigurationMockModuleExtended
509
+ module ::CascadingConfiguration::Array::Unique::InstanceConfigurationMockModuleExtended
510
510
  extend CascadingConfiguration::Array::Unique
511
511
  # => singleton gets attr_configuration and configurations
512
512
  instance_variables.empty?.should == true
@@ -540,7 +540,7 @@ describe CascadingConfiguration::Array::Unique do
540
540
  end
541
541
 
542
542
  # * module included with setting
543
- module CascadingConfiguration::Array::Unique::InstanceConfigurationMockModuleIncluded
543
+ module ::CascadingConfiguration::Array::Unique::InstanceConfigurationMockModuleIncluded
544
544
  include CascadingConfiguration::Array::Unique
545
545
  # => singleton gets attr_configuration and configurations
546
546
  respond_to?( :attr_instance_configuration_unique_array ).should == true
@@ -632,7 +632,7 @@ describe CascadingConfiguration::Array::Unique do
632
632
  # => instances of including classes get configurations
633
633
  # => extending modules and classes get attr_configuration and configurations
634
634
  # => instances of extending classes get nothing
635
- module CascadingConfiguration::Array::Unique::ObjectConfigurationMockModuleExtended
635
+ module ::CascadingConfiguration::Array::Unique::ObjectConfigurationMockModuleExtended
636
636
  extend CascadingConfiguration::Array::Unique
637
637
  # => singleton gets attr_configuration and configurations
638
638
  respond_to?( :attr_object_configuration_unique_array ).should == true
@@ -673,7 +673,7 @@ describe CascadingConfiguration::Array::Unique do
673
673
  end
674
674
 
675
675
  # * module included with setting
676
- module CascadingConfiguration::Array::Unique::ObjectConfigurationMockModuleIncluded
676
+ module ::CascadingConfiguration::Array::Unique::ObjectConfigurationMockModuleIncluded
677
677
  include CascadingConfiguration::Array::Unique
678
678
  # => singleton gets attr_configuration and configurations
679
679
  respond_to?( :attr_object_configuration_unique_array ).should == true
@@ -9,12 +9,12 @@ describe CascadingConfiguration::Array::Unique::CompositingArray do
9
9
 
10
10
  before :all do
11
11
 
12
- module CascadingConfiguration::Array::Unique::CompositingArray::MockA
12
+ module ::CascadingConfiguration::Array::Unique::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::Unique::CompositingArray::MockB
17
+ module ::CascadingConfiguration::Array::Unique::CompositingArray::MockB
18
18
  end
19
19
 
20
20
  @configuration_instance = CascadingConfiguration::Array::Unique::CompositingArray::MockA
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cascading-configuration-array-unique
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
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-02-29 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: &70210719719300 !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: *70210719719300
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: cascading-configuration-variable
27
- requirement: &70210716474940 !ruby/object:Gem::Requirement
16
+ requirement: &70231469214740 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ! '>='
@@ -32,10 +21,10 @@ dependencies:
32
21
  version: '0'
33
22
  type: :runtime
34
23
  prerelease: false
35
- version_requirements: *70210716474940
24
+ version_requirements: *70231469214740
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: cascading-configuration-array
38
- requirement: &70210716474520 !ruby/object:Gem::Requirement
27
+ requirement: &70231469214200 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ! '>='
@@ -43,7 +32,7 @@ dependencies:
43
32
  version: '0'
44
33
  type: :runtime
45
34
  prerelease: false
46
- version_requirements: *70210716474520
35
+ version_requirements: *70231469214200
47
36
  description: Provides :attr_configuration_array.
48
37
  email: asher@ridiculouspower.com
49
38
  executables: []
@@ -51,7 +40,6 @@ extensions: []
51
40
  extra_rdoc_files: []
52
41
  files:
53
42
  - lib/cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/CompositingArray.rb
54
- - lib/cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/Interface/GettersSetters.rb
55
43
  - lib/cascading-configuration-array-unique/_private_/CascadingConfiguration/Array/Unique/ModuleSupportMethods.rb
56
44
  - lib/cascading-configuration-array-unique/CascadingConfiguration/Array/Unique/Interface.rb
57
45
  - lib/cascading-configuration-array-unique/CascadingConfiguration/Array/Unique.rb
@@ -1,220 +0,0 @@
1
-
2
- module ::CascadingConfiguration::Array::Unique::Interface::GettersSetters
3
-
4
- ##########################################
5
- # define_cascading_unique_array_setter #
6
- ##########################################
7
-
8
- def define_cascading_unique_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::Unique.
15
- set_composite_unique_array( self,
16
- configuration_name,
17
- array )
18
-
19
- end
20
-
21
- ::CascadingConfiguration::Variable.define_module_method( self,
22
- configuration_setter_name,
23
- & array_setter_proc )
24
- ::CascadingConfiguration::Variable.
25
- define_instance_method_if_support_exists( self,
26
- configuration_setter_name,
27
- & array_setter_proc )
28
-
29
- end
30
-
31
- ##########################################
32
- # define_cascading_unique_array_getter #
33
- ##########################################
34
-
35
- def define_cascading_unique_array_getter( configuration_name )
36
-
37
- configuration_getter_name = configuration_name
38
-
39
- array_getter_proc = Proc.new do
40
-
41
- return ::CascadingConfiguration::Array::Unique.composite_unique_array( self,
42
- configuration_name )
43
-
44
- end
45
-
46
- ::CascadingConfiguration::Variable.define_module_method( self,
47
- configuration_getter_name,
48
- & array_getter_proc )
49
- ::CascadingConfiguration::Variable.
50
- define_instance_method_if_support_exists( self,
51
- configuration_getter_name,
52
- & array_getter_proc )
53
-
54
- end
55
-
56
- ####################################################
57
- # define_class_configuration_unique_array_setter #
58
- ####################################################
59
-
60
- def define_class_configuration_unique_array_setter( configuration_name )
61
-
62
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
63
-
64
- ::CascadingConfiguration::Variable.define_module_method( self,
65
- configuration_setter_name ) do |array|
66
-
67
- return ::CascadingConfiguration::Array::Unique.
68
- set_composite_unique_array( self,
69
- configuration_name,
70
- array )
71
-
72
- end
73
-
74
- end
75
-
76
- ####################################################
77
- # define_class_configuration_unique_array_getter #
78
- ####################################################
79
-
80
- def define_class_configuration_unique_array_getter( configuration_name )
81
-
82
- configuration_getter_name = configuration_name
83
-
84
- ::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name ) do
85
-
86
- return ::CascadingConfiguration::Array::Unique.composite_unique_array( self,
87
- configuration_name )
88
-
89
- end
90
-
91
- end
92
-
93
- ####################################################
94
- # define_local_configuration_unique_array_setter #
95
- ####################################################
96
-
97
- def define_local_configuration_unique_array_setter( configuration_name )
98
-
99
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
100
-
101
- local_setter_proc = Proc.new do |array|
102
-
103
- return ::CascadingConfiguration::Array::Unique.
104
- set_composite_unique_array( self,
105
- configuration_name,
106
- array )
107
-
108
- end
109
-
110
- ::CascadingConfiguration::Variable.define_local_instance_method( self,
111
- configuration_setter_name,
112
- & local_setter_proc )
113
- ::CascadingConfiguration::Variable.
114
- define_instance_method_if_support_exists( self,
115
- configuration_setter_name,
116
- & local_setter_proc )
117
-
118
- end
119
-
120
- ####################################################
121
- # define_local_configuration_unique_array_getter #
122
- ####################################################
123
-
124
- def define_local_configuration_unique_array_getter( configuration_name )
125
-
126
- configuration_getter_name = configuration_name
127
-
128
- local_getter_proc = Proc.new do
129
-
130
- return ::CascadingConfiguration::Array::Unique.composite_unique_array( self,
131
- configuration_name )
132
-
133
- end
134
-
135
- ::CascadingConfiguration::Variable.define_local_instance_method( self,
136
- configuration_getter_name,
137
- & local_getter_proc )
138
- ::CascadingConfiguration::Variable.
139
- define_instance_method_if_support_exists( self,
140
- configuration_getter_name,
141
- & local_getter_proc )
142
-
143
- end
144
-
145
- #######################################################
146
- # define_instance_configuration_unique_array_setter #
147
- #######################################################
148
-
149
- def define_instance_configuration_unique_array_setter( configuration_name )
150
-
151
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
152
-
153
- ::CascadingConfiguration::Variable.
154
- define_instance_method( self, configuration_setter_name ) do |array|
155
-
156
- return ::CascadingConfiguration::Array::Unique.
157
- set_composite_unique_array( self,
158
- configuration_name,
159
- array )
160
-
161
- end
162
-
163
- end
164
-
165
- #######################################################
166
- # define_instance_configuration_unique_array_getter #
167
- #######################################################
168
-
169
- def define_instance_configuration_unique_array_getter( configuration_name )
170
-
171
- configuration_getter_name = configuration_name
172
-
173
- ::CascadingConfiguration::Variable.define_instance_method( self, configuration_getter_name ) do
174
-
175
- return ::CascadingConfiguration::Array::Unique.composite_unique_array( self,
176
- configuration_name )
177
-
178
- end
179
-
180
- end
181
-
182
- #####################################################
183
- # define_object_configuration_unique_array_setter #
184
- #####################################################
185
-
186
- def define_object_configuration_unique_array_setter( configuration_name )
187
-
188
- configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
189
-
190
- ::CascadingConfiguration::Variable.
191
- define_local_instance_method( self, configuration_setter_name ) do |array|
192
-
193
- return ::CascadingConfiguration::Array::Unique.
194
- set_composite_unique_array( self,
195
- configuration_name,
196
- array )
197
-
198
- end
199
-
200
- end
201
-
202
- #####################################################
203
- # define_object_configuration_unique_array_getter #
204
- #####################################################
205
-
206
- def define_object_configuration_unique_array_getter( configuration_name )
207
-
208
- configuration_getter_name = configuration_name
209
-
210
- ::CascadingConfiguration::Variable.define_local_instance_method( self,
211
- configuration_getter_name ) do
212
-
213
- return ::CascadingConfiguration::Array::Unique.composite_unique_array( self,
214
- configuration_name )
215
-
216
- end
217
-
218
- end
219
-
220
- end