cascading-configuration-array 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +369 -0
- data/README.rdoc +29 -113
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/Accessors.rb +54 -0
- data/lib/cascading-configuration-array/CascadingConfiguration/{ConfigurationSettingsArray → Array}/ClassInstance.rb +5 -3
- data/lib/cascading-configuration-array/CascadingConfiguration/{ConfigurationSettingsArray → Array}/ModuleInstance.rb +7 -4
- data/lib/cascading-configuration-array/CascadingConfiguration/Array.rb +33 -0
- data/lib/cascading-configuration-array/CascadingConfiguration/{CascadingCompositeArray → CompositingArray}/Instance.rb +4 -2
- data/lib/cascading-configuration-array/CascadingConfiguration/{CascadingCompositeArray → CompositingArray}/_private_/Instance.rb +1 -1
- data/lib/cascading-configuration-array/CascadingConfiguration/{CascadingCompositeArray.rb → CompositingArray.rb} +3 -3
- data/lib/cascading-configuration-array/CascadingConfiguration/{ConfigurationArray.rb → LocalConfigurationArray.rb} +2 -2
- data/lib/cascading-configuration-array/CascadingConfiguration/_private_/{CascadingCompositeArray.rb → CompositingArray.rb} +1 -1
- data/lib/cascading-configuration-array/CascadingConfiguration/_private_/{ConfigurationArray.rb → LocalConfigurationArray.rb} +1 -1
- data/lib/cascading-configuration-array.rb +18 -15
- data/spec/CascadingConfiguration/Array/Accessors_spec.rb +28 -0
- data/spec/CascadingConfiguration/{ConfigurationSettingsArray_spec.rb → Array_spec.rb} +20 -20
- data/spec/CascadingConfiguration/{CascadingCompositeArray_spec.rb → CompositingArray_spec.rb} +89 -89
- data/spec/CascadingConfiguration/{ConfigurationArray_spec.rb → LocalConfigurationArray_spec.rb} +12 -12
- metadata +18 -17
- data/lib/cascading-configuration-array/CascadingConfiguration/ConfigurationSettingsArray/Accessors.rb +0 -41
- data/lib/cascading-configuration-array/CascadingConfiguration/ConfigurationSettingsArray.rb +0 -21
- data/spec/CascadingConfiguration/ConfigurationSettingsArray/Accessors_spec.rb +0 -28
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 1.0.0
|
9
|
+
version: 1.1.0
|
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-
|
17
|
+
date: 2011-07-14 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -39,21 +39,22 @@ extensions: []
|
|
39
39
|
extra_rdoc_files: []
|
40
40
|
|
41
41
|
files:
|
42
|
-
- lib/cascading-configuration-array/CascadingConfiguration/_private_/
|
43
|
-
- lib/cascading-configuration-array/CascadingConfiguration/_private_/
|
44
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
45
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
46
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
47
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
48
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
49
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
50
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
51
|
-
- lib/cascading-configuration-array/CascadingConfiguration/
|
42
|
+
- lib/cascading-configuration-array/CascadingConfiguration/_private_/CompositingArray.rb
|
43
|
+
- lib/cascading-configuration-array/CascadingConfiguration/_private_/LocalConfigurationArray.rb
|
44
|
+
- lib/cascading-configuration-array/CascadingConfiguration/Array/Accessors.rb
|
45
|
+
- lib/cascading-configuration-array/CascadingConfiguration/Array/ClassInstance.rb
|
46
|
+
- lib/cascading-configuration-array/CascadingConfiguration/Array/ModuleInstance.rb
|
47
|
+
- lib/cascading-configuration-array/CascadingConfiguration/Array.rb
|
48
|
+
- lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/_private_/Instance.rb
|
49
|
+
- lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/Instance.rb
|
50
|
+
- lib/cascading-configuration-array/CascadingConfiguration/CompositingArray.rb
|
51
|
+
- lib/cascading-configuration-array/CascadingConfiguration/LocalConfigurationArray.rb
|
52
52
|
- lib/cascading-configuration-array.rb
|
53
|
-
- spec/CascadingConfiguration/
|
54
|
-
- spec/CascadingConfiguration/
|
55
|
-
- spec/CascadingConfiguration/
|
56
|
-
- spec/CascadingConfiguration/
|
53
|
+
- spec/CascadingConfiguration/Array/Accessors_spec.rb
|
54
|
+
- spec/CascadingConfiguration/Array_spec.rb
|
55
|
+
- spec/CascadingConfiguration/CompositingArray_spec.rb
|
56
|
+
- spec/CascadingConfiguration/LocalConfigurationArray_spec.rb
|
57
|
+
- README.md
|
57
58
|
- README.rdoc
|
58
59
|
has_rdoc: true
|
59
60
|
homepage: http://rubygems.org/gems/cascading-configuration-array
|
@@ -1,41 +0,0 @@
|
|
1
|
-
|
2
|
-
module CascadingConfiguration::ConfigurationSettingsArray::Accessors
|
3
|
-
|
4
|
-
#######################################
|
5
|
-
# define_configuration_array_setter #
|
6
|
-
#######################################
|
7
|
-
|
8
|
-
def define_configuration_array_setter( configuration_name )
|
9
|
-
[ self, eigenclass ].each do |klass_or_eigenclass|
|
10
|
-
klass_or_eigenclass.class_eval do
|
11
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
12
|
-
define_method( configuration_setter_name ) do |array|
|
13
|
-
composite_array = composite_array_for_cascading_configuration( configuration_name )
|
14
|
-
# we want the array to supplant existing config
|
15
|
-
# clear the array (excludes everything explicitly)
|
16
|
-
composite_array.clear
|
17
|
-
# push array elements (removes anything excluded from exclude)
|
18
|
-
composite_array.push( *array )
|
19
|
-
return composite_array
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
#######################################
|
26
|
-
# define_configuration_array_getter #
|
27
|
-
#######################################
|
28
|
-
|
29
|
-
def define_configuration_array_getter( configuration_name )
|
30
|
-
configuration_getter_name = configuration_name
|
31
|
-
[ self, eigenclass ].each do |klass_or_eigenclass|
|
32
|
-
klass_or_eigenclass.class_eval do
|
33
|
-
define_method( configuration_getter_name ) do
|
34
|
-
composite_array = composite_array_for_cascading_configuration( configuration_name )
|
35
|
-
return composite_array
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
|
2
|
-
module CascadingConfiguration::ConfigurationSettingsArray
|
3
|
-
|
4
|
-
###################
|
5
|
-
# self.included #
|
6
|
-
###################
|
7
|
-
|
8
|
-
def self.included( class_or_module )
|
9
|
-
class_or_module.instance_eval do
|
10
|
-
include CascadingConfiguration::ConfigurationVariable
|
11
|
-
extend CascadingConfiguration::ConfigurationSettingsArray
|
12
|
-
extend CascadingConfiguration::ConfigurationSettingsArray::Accessors
|
13
|
-
extend CascadingConfiguration::ConfigurationSettingsArray::ClassInstance
|
14
|
-
include CascadingConfiguration::CascadingCompositeArray::Instance
|
15
|
-
unless is_a?( Class )
|
16
|
-
extend CascadingConfiguration::ConfigurationSettingsArray::ModuleInstance
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative '../../../lib/cascading-configuration-array.rb'
|
3
|
-
|
4
|
-
describe CascadingConfiguration::ConfigurationSettingsArray::Accessors do
|
5
|
-
|
6
|
-
#######################################
|
7
|
-
# define_configuration_array_setter #
|
8
|
-
# define_configuration_array_getter #
|
9
|
-
#######################################
|
10
|
-
|
11
|
-
it 'can define a method to get and modify the configuration array' do
|
12
|
-
class CascadingConfiguration::ConfigurationSettingsArray::Mock
|
13
|
-
include CascadingConfiguration::ConfigurationVariable
|
14
|
-
extend CascadingConfiguration::ConfigurationSettingsArray::Accessors
|
15
|
-
include CascadingConfiguration::ConfigurationSettingsArray::ObjectInstance
|
16
|
-
extend CascadingConfiguration::ConfigurationSettingsArray::ClassInstance
|
17
|
-
end
|
18
|
-
# setter
|
19
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.define_configuration_array_setter( :some_configuration )
|
20
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.methods.include?( :some_configuration= ).should == true
|
21
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.instance_methods.include?( :some_configuration= ).should == true
|
22
|
-
# getter
|
23
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.define_configuration_array_getter( :some_configuration )
|
24
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.methods.include?( :some_configuration ).should == true
|
25
|
-
CascadingConfiguration::ConfigurationSettingsArray::Mock.instance_methods.include?( :some_configuration ).should == true
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|