cascading-configuration-array 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -239,30 +239,6 @@ module SomeModule
239
239
  end
240
240
  ```
241
241
 
242
- ### Hidden Configuration ###
243
-
244
- #### :attr_hide ####
245
-
246
- Coming soon.
247
-
248
- ```ruby
249
- module SomeModule
250
-
251
- include CascadingConfiguration
252
-
253
- attr_configuration :some_array_setting
254
-
255
- instance_variables.include?( :@some_array_setting ) # => true
256
-
257
- attr_hide :some_array_setting
258
-
259
- instance_variables.include?( :@some_array_setting ) # => false
260
-
261
- end
262
- ```
263
-
264
- Causes configuration variable to be stored in external context so that it is not included in instance variables.
265
-
266
242
  # License #
267
243
 
268
244
  (The MIT License)
@@ -35,6 +35,7 @@ module CascadingConfiguration::Array
35
35
  extend module_self
36
36
  extend module_self::Interface
37
37
  extend module_self::AccessorDefinitionMethods
38
+ extend CascadingConfiguration::Variable::Interface
38
39
  extend CascadingConfiguration::Array::ModuleInclusionExtensionSupport unless is_a?( Class )
39
40
  end
40
41
  end
@@ -48,6 +49,7 @@ module CascadingConfiguration::Array
48
49
  class_or_module.instance_eval do
49
50
  extend module_self::Interface
50
51
  extend module_self::AccessorDefinitionMethods
52
+ extend CascadingConfiguration::Variable::Interface
51
53
  end
52
54
  end
53
55
 
@@ -10,7 +10,6 @@ class CascadingConfiguration::CompositingArray < Array
10
10
  def initialize( cascading_name, working_instance )
11
11
  @cascading_name = cascading_name
12
12
  @working_class = ( working_instance.is_a?( Module ) ? working_instance : working_instance.class )
13
- @cascading_variable = @working_class.accessor_module_support.cascading_variable_name( @cascading_name )
14
13
  @working_instance = working_instance
15
14
  # if first ancestor can have a composite array, register self with it in case it gets updated in the future
16
15
  if ( first_ancestor = @working_instance.first_ancestor ).respond_to?( :composite_array_for_cascading_configuration )
@@ -2,7 +2,7 @@
2
2
  require_relative '../../lib/cascading-configuration-array.rb'
3
3
 
4
4
  describe CascadingConfiguration::Array do
5
-
5
+
6
6
  ##############################
7
7
  # attr_configuration_array #
8
8
  ##############################
@@ -31,28 +31,33 @@ describe CascadingConfiguration::Array do
31
31
  configuration_setting.push( :a_configuration )
32
32
  configuration_setting.should == [ :a_configuration ]
33
33
  instance_methods.include?( :configuration_setting ).should == false
34
+ instance_variables.empty?.should == true
34
35
  # => including modules and classes get nothing
35
36
  module SubmoduleIncluding
36
37
  include CascadingConfiguration::Array::ConfigurationMockModuleExtended
37
38
  instance_methods.include?( :configuration_setting ).should == false
38
39
  respond_to?( :configuration_setting ).should == false
40
+ instance_variables.empty?.should == true
39
41
  end
40
42
  # => extending modules and classes get nothing
41
43
  module SubmoduleExtending
42
44
  extend CascadingConfiguration::Array::ConfigurationMockModuleExtended
43
45
  instance_methods.include?( :configuration_setting ).should == false
44
46
  respond_to?( :configuration_setting ).should == false
47
+ instance_variables.empty?.should == true
45
48
  end
46
49
  # => instances of including and extending classes get nothing
47
50
  class ClassIncluding
48
51
  include CascadingConfiguration::Array::ConfigurationMockModuleExtended
49
52
  instance_methods.include?( :configuration_setting ).should == false
50
53
  respond_to?( :configuration_setting ).should == false
54
+ instance_variables.empty?.should == true
51
55
  end
52
56
  class ClassExtending
53
57
  extend CascadingConfiguration::Array::ConfigurationMockModuleExtended
54
58
  instance_methods.include?( :configuration_setting ).should == false
55
59
  respond_to?( :configuration_setting ).should == false
60
+ instance_variables.empty?.should == true
56
61
  end
57
62
  end
58
63
 
@@ -67,6 +72,7 @@ describe CascadingConfiguration::Array do
67
72
  configuration_setting.push( :a_configuration )
68
73
  configuration_setting.should == [ :a_configuration ]
69
74
  instance_methods.include?( :configuration_setting ).should == true
75
+ instance_variables.empty?.should == true
70
76
  # => including modules and classes get attr_configuration and configurations
71
77
  module SubmoduleIncluding
72
78
  include CascadingConfiguration::Array::ConfigurationMockModuleIncluded
@@ -75,6 +81,7 @@ describe CascadingConfiguration::Array do
75
81
  configuration_setting.should == [ :a_configuration ]
76
82
  configuration_setting.push( :another_configuration )
77
83
  configuration_setting.should == [ :a_configuration, :another_configuration ]
84
+ instance_variables.empty?.should == true
78
85
  end
79
86
  # => extending modules and classes get attr_configuration and configurations
80
87
  module SubmoduleExtending
@@ -87,6 +94,7 @@ describe CascadingConfiguration::Array do
87
94
  configuration_setting.push( :some_other_configuration )
88
95
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
89
96
  instance_methods.include?( :configuration_setting ).should == false
97
+ instance_variables.empty?.should == true
90
98
  end
91
99
  # => instances of including classes get configurations
92
100
  class ClassIncluding
@@ -96,6 +104,7 @@ describe CascadingConfiguration::Array do
96
104
  configuration_setting.should == [ :a_configuration ]
97
105
  configuration_setting.push( :some_other_configuration )
98
106
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
107
+ instance_variables.empty?.should == true
99
108
  end
100
109
  setting_class_including_instance = ClassIncluding.new
101
110
  setting_class_including_instance.respond_to?( :configuration_setting ).should == true
@@ -103,6 +112,7 @@ describe CascadingConfiguration::Array do
103
112
  setting_class_including_instance.configuration_setting.delete( :some_other_configuration )
104
113
  setting_class_including_instance.configuration_setting = [ :our_setting_value ]
105
114
  setting_class_including_instance.configuration_setting.should == [ :our_setting_value ]
115
+ setting_class_including_instance.instance_variables.empty?.should == true
106
116
  # => instances of extending classes get nothing
107
117
  class ClassExtending
108
118
  extend CascadingConfiguration::Array::ConfigurationMockModuleIncluded
@@ -110,9 +120,11 @@ describe CascadingConfiguration::Array do
110
120
  configuration_setting.should == [ :a_configuration ]
111
121
  configuration_setting.push( :some_other_configuration )
112
122
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
123
+ instance_variables.empty?.should == true
113
124
  end
114
125
  setting_class_including_instance = ClassExtending.new
115
126
  setting_class_including_instance.respond_to?( :configuration_setting ).should == false
127
+ setting_class_including_instance.instance_variables.empty?.should == true
116
128
  end
117
129
 
118
130
  class CascadingConfiguration::Array::ConfigurationMockClass
@@ -120,24 +132,29 @@ describe CascadingConfiguration::Array do
120
132
  configuration_setting.should == [ :a_configuration, :another_configuration ]
121
133
  configuration_setting.push( :some_other_configuration )
122
134
  configuration_setting.should == [ :a_configuration, :another_configuration, :some_other_configuration ]
135
+ instance_variables.empty?.should == true
123
136
  end
124
137
  object_instance_one = CascadingConfiguration::Array::ConfigurationMockClass.new
125
138
  object_instance_one.configuration_setting.should == [ :a_configuration, :another_configuration, :some_other_configuration ]
126
139
  object_instance_one.configuration_setting.delete( :a_configuration )
127
140
  object_instance_one.configuration_setting.should == [ :another_configuration, :some_other_configuration ]
141
+ object_instance_one.instance_variables.empty?.should == true
128
142
  class CascadingConfiguration::Array::ConfigurationMockClassSub1 < CascadingConfiguration::Array::ConfigurationMockClass
129
143
  configuration_setting.should == [ :a_configuration, :another_configuration, :some_other_configuration ]
130
144
  configuration_setting.delete( :a_configuration )
131
145
  configuration_setting.should == [ :another_configuration, :some_other_configuration ]
146
+ instance_variables.empty?.should == true
132
147
  end
133
148
  object_instance_two = CascadingConfiguration::Array::ConfigurationMockClassSub1.new
134
149
  object_instance_two.configuration_setting.should == [ :another_configuration, :some_other_configuration ]
135
150
  object_instance_two.configuration_setting.delete( :another_configuration )
136
151
  object_instance_two.configuration_setting.should == [ :some_other_configuration ]
152
+ object_instance_two.instance_variables.empty?.should == true
137
153
  class CascadingConfiguration::Array::ConfigurationMockClassSub2 < CascadingConfiguration::Array::ConfigurationMockClassSub1
138
154
  configuration_setting.should == [ :another_configuration, :some_other_configuration ]
139
155
  configuration_setting.push( :yet_another_configuration )
140
156
  configuration_setting.should == [ :another_configuration, :some_other_configuration, :yet_another_configuration ]
157
+ instance_variables.empty?.should == true
141
158
  end
142
159
 
143
160
  # change ancestor setting
@@ -191,28 +208,33 @@ describe CascadingConfiguration::Array do
191
208
  configuration_setting.push( :a_configuration )
192
209
  configuration_setting.should == [ :a_configuration ]
193
210
  instance_methods.include?( :configuration_setting ).should == false
211
+ instance_variables.empty?.should == true
194
212
  # => including modules and classes get nothing
195
213
  module SubmoduleIncluding
196
214
  include CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
197
215
  instance_methods.include?( :configuration_setting ).should == false
198
216
  respond_to?( :configuration_setting ).should == false
217
+ instance_variables.empty?.should == true
199
218
  end
200
219
  # => extending modules and classes get nothing
201
220
  module SubmoduleExtending
202
221
  extend CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
203
222
  instance_methods.include?( :configuration_setting ).should == false
204
223
  respond_to?( :configuration_setting ).should == false
224
+ instance_variables.empty?.should == true
205
225
  end
206
226
  # => instances of including and extending classes get nothing
207
227
  class ClassIncluding
208
228
  include CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
209
229
  instance_methods.include?( :configuration_setting ).should == false
210
230
  respond_to?( :configuration_setting ).should == false
231
+ instance_variables.empty?.should == true
211
232
  end
212
233
  class ClassExtending
213
234
  extend CascadingConfiguration::Array::ClassConfigurationMockModuleExtended
214
235
  instance_methods.include?( :configuration_setting ).should == false
215
236
  respond_to?( :configuration_setting ).should == false
237
+ instance_variables.empty?.should == true
216
238
  end
217
239
  end
218
240
 
@@ -227,6 +249,7 @@ describe CascadingConfiguration::Array do
227
249
  configuration_setting.push( :a_configuration )
228
250
  configuration_setting.should == [ :a_configuration ]
229
251
  instance_methods.include?( :configuration_setting ).should == false
252
+ instance_variables.empty?.should == true
230
253
  # => including modules and classes get attr_configuration and configurations
231
254
  module SubmoduleIncluding
232
255
  include CascadingConfiguration::Array::ClassConfigurationMockModuleIncluded
@@ -236,6 +259,7 @@ describe CascadingConfiguration::Array do
236
259
  configuration_setting.push( :another_configuration )
237
260
  configuration_setting.should == [ :a_configuration, :another_configuration ]
238
261
  instance_methods.include?( :configuration_setting ).should == false
262
+ instance_variables.empty?.should == true
239
263
  end
240
264
  # => extending modules and classes get attr_configuration and configurations
241
265
  module SubmoduleExtending
@@ -248,6 +272,7 @@ describe CascadingConfiguration::Array do
248
272
  configuration_setting.push( :some_other_configuration )
249
273
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
250
274
  instance_methods.include?( :configuration_setting ).should == false
275
+ instance_variables.empty?.should == true
251
276
  end
252
277
  # => instances of including classes get configurations
253
278
  class ClassIncluding
@@ -257,9 +282,11 @@ describe CascadingConfiguration::Array do
257
282
  configuration_setting.should == [ :a_configuration ]
258
283
  configuration_setting.push( :some_other_configuration )
259
284
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
285
+ instance_variables.empty?.should == true
260
286
  end
261
287
  setting_class_including_instance = ClassIncluding.new
262
288
  setting_class_including_instance.respond_to?( :configuration_setting ).should == false
289
+ setting_class_including_instance.instance_variables.empty?.should == true
263
290
  # => instances of extending classes get nothing
264
291
  class ClassExtending
265
292
  extend CascadingConfiguration::Array::ClassConfigurationMockModuleIncluded
@@ -268,9 +295,11 @@ describe CascadingConfiguration::Array do
268
295
  configuration_setting.should == [ :a_configuration ]
269
296
  configuration_setting.push( :some_other_configuration )
270
297
  configuration_setting.should == [ :a_configuration, :some_other_configuration ]
298
+ instance_variables.empty?.should == true
271
299
  end
272
300
  setting_class_including_instance = ClassExtending.new
273
301
  setting_class_including_instance.respond_to?( :configuration_setting ).should == false
302
+ setting_class_including_instance.instance_variables.empty?.should == true
274
303
  end
275
304
 
276
305
  class CascadingConfiguration::Array::ClassConfigurationMockClass
@@ -279,22 +308,27 @@ describe CascadingConfiguration::Array do
279
308
  configuration_setting.should == [ :a_configuration, :another_configuration ]
280
309
  configuration_setting.push( :some_other_configuration )
281
310
  configuration_setting.should == [ :a_configuration, :another_configuration, :some_other_configuration ]
311
+ instance_variables.empty?.should == true
282
312
  end
283
313
  object_instance_one = CascadingConfiguration::Array::ClassConfigurationMockClass.new
284
314
  object_instance_one.respond_to?( :configuration_setting ).should == false
315
+ object_instance_one.instance_variables.empty?.should == true
285
316
  class CascadingConfiguration::Array::ClassConfigurationMockClassSub1 < CascadingConfiguration::Array::ClassConfigurationMockClass
286
317
  instance_methods.include?( :configuration_setting ).should == false
287
318
  configuration_setting.should == [ :a_configuration, :another_configuration, :some_other_configuration ]
288
319
  configuration_setting.delete( :a_configuration )
289
320
  configuration_setting.should == [ :another_configuration, :some_other_configuration ]
321
+ instance_variables.empty?.should == true
290
322
  end
291
323
  object_instance_two = CascadingConfiguration::Array::ClassConfigurationMockClassSub1.new
292
324
  object_instance_two.respond_to?( :configuration_setting ).should == false
325
+ object_instance_two.instance_variables.empty?.should == true
293
326
  class CascadingConfiguration::Array::ClassConfigurationMockClassSub2 < CascadingConfiguration::Array::ClassConfigurationMockClassSub1
294
327
  instance_methods.include?( :configuration_setting ).should == false
295
328
  configuration_setting.should == [ :another_configuration, :some_other_configuration ]
296
329
  configuration_setting.push( :yet_another_configuration )
297
330
  configuration_setting.should == [ :another_configuration, :some_other_configuration, :yet_another_configuration ]
331
+ instance_variables.empty?.should == true
298
332
  end
299
333
 
300
334
  # change ancestor setting
@@ -340,28 +374,33 @@ describe CascadingConfiguration::Array do
340
374
  configuration_setting.push( :a_configuration )
341
375
  configuration_setting.should == [ :a_configuration ]
342
376
  instance_methods.include?( :configuration_setting ).should == false
377
+ instance_variables.empty?.should == true
343
378
  # => including modules and classes get nothing
344
379
  module SubmoduleIncluding
345
380
  include CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
346
381
  instance_methods.include?( :configuration_setting ).should == false
347
382
  respond_to?( :configuration_setting ).should == false
383
+ instance_variables.empty?.should == true
348
384
  end
349
385
  # => extending modules and classes get nothing
350
386
  module SubmoduleExtending
351
387
  extend CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
352
388
  instance_methods.include?( :configuration_setting ).should == false
353
389
  respond_to?( :configuration_setting ).should == false
390
+ instance_variables.empty?.should == true
354
391
  end
355
392
  # => instances of including and extending classes get nothing
356
393
  class ClassIncluding
357
394
  include CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
358
395
  instance_methods.include?( :configuration_setting ).should == false
359
396
  respond_to?( :configuration_setting ).should == false
397
+ instance_variables.empty?.should == true
360
398
  end
361
399
  class ClassExtending
362
400
  extend CascadingConfiguration::Array::LocalConfigurationMockModuleExtended
363
401
  instance_methods.include?( :configuration_setting ).should == false
364
402
  respond_to?( :configuration_setting ).should == false
403
+ instance_variables.empty?.should == true
365
404
  end
366
405
  end
367
406
 
@@ -376,12 +415,14 @@ describe CascadingConfiguration::Array do
376
415
  configuration_setting.push( :a_configuration )
377
416
  configuration_setting.should == [ :a_configuration ]
378
417
  instance_methods.include?( :configuration_setting ).should == false
418
+ instance_variables.empty?.should == true
379
419
  # => including modules and classes get attr_configuration and configurations
380
420
  module SubmoduleIncluding
381
421
  include CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded
382
422
  instance_methods.include?( :configuration_setting ).should == false
383
423
  respond_to?( :configuration_setting ).should == false
384
424
  instance_methods.include?( :configuration_setting ).should == false
425
+ instance_variables.empty?.should == true
385
426
  end
386
427
  # => extending modules and classes get attr_configuration and configurations
387
428
  module SubmoduleExtending
@@ -391,41 +432,51 @@ describe CascadingConfiguration::Array do
391
432
  # - the rest of the ancestors will be the extending module's include chain
392
433
  respond_to?( :configuration_setting ).should == false
393
434
  instance_methods.include?( :configuration_setting ).should == false
435
+ instance_variables.empty?.should == true
394
436
  end
395
437
  # => instances of including classes get configurations
396
438
  class ClassIncluding
397
439
  include CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded
398
440
  instance_methods.include?( :configuration_setting ).should == false
399
441
  respond_to?( :configuration_setting ).should == false
442
+ instance_variables.empty?.should == true
400
443
  end
401
444
  setting_class_including_instance = ClassIncluding.new
402
445
  setting_class_including_instance.respond_to?( :configuration_setting ).should == false
446
+ setting_class_including_instance.instance_variables.empty?.should == true
403
447
  # => instances of extending classes get nothing
404
448
  class ClassExtending
405
449
  extend CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded
406
450
  instance_methods.include?( :configuration_setting ).should == false
407
451
  respond_to?( :configuration_setting ).should == false
452
+ instance_variables.empty?.should == true
408
453
  end
409
454
  setting_class_including_instance = ClassExtending.new
410
455
  setting_class_including_instance.respond_to?( :configuration_setting ).should == false
456
+ setting_class_including_instance.instance_variables.empty?.should == true
411
457
  end
412
458
 
413
459
  class CascadingConfiguration::Array::LocalConfigurationMockClass
414
460
  include CascadingConfiguration::Array::LocalConfigurationMockModuleIncluded::SubmoduleIncluding
415
461
  instance_methods.include?( :configuration_setting ).should == false
416
462
  respond_to?( :configuration_setting ).should == false
463
+ instance_variables.empty?.should == true
417
464
  end
418
465
  object_instance_one = CascadingConfiguration::Array::LocalConfigurationMockClass.new
419
466
  object_instance_one.respond_to?( :configuration_setting ).should == false
467
+ object_instance_one.instance_variables.empty?.should == true
420
468
  class CascadingConfiguration::Array::LocalConfigurationMockClassSub1 < CascadingConfiguration::Array::LocalConfigurationMockClass
421
469
  instance_methods.include?( :configuration_setting ).should == false
422
470
  respond_to?( :configuration_setting ).should == false
471
+ instance_variables.empty?.should == true
423
472
  end
424
473
  object_instance_two = CascadingConfiguration::Array::LocalConfigurationMockClassSub1.new
425
474
  object_instance_two.respond_to?( :configuration_setting ).should == false
475
+ object_instance_two.instance_variables.empty?.should == true
426
476
  class CascadingConfiguration::Array::LocalConfigurationMockClassSub2 < CascadingConfiguration::Array::LocalConfigurationMockClassSub1
427
477
  instance_methods.include?( :configuration_setting ).should == false
428
478
  respond_to?( :configuration_setting ).should == false
479
+ instance_variables.empty?.should == true
429
480
  end
430
481
 
431
482
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 1
9
- version: 1.2.1
8
+ - 2
9
+ version: 1.2.2
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-19 00:00:00 -04:00
17
+ date: 2011-07-20 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency