stacked_config 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/stacked_config/orchestrator.rb +4 -4
- data/lib/stacked_config/version.rb +1 -1
- data/lib/stacked_config.rb +1 -1
- data/spec/orchestrator_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e02ee146b2273b5918c9d33767b310694cebfed8
|
4
|
+
data.tar.gz: e4276b0fcbe9f34bd216b0a05afda2f6ad628d2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22af861beccd0d705a80e6c14642a0ed27f060dc3455fabe9249c0558052525ca6382e85b0338e6d4cb47af1d9698a48f96826c0a8e4f678c32db622499b7e2b
|
7
|
+
data.tar.gz: e6b35a76082840de8bb137a81ed4bbad1f45c37018b2d676e2d022c5cebabac823613434780e2410a501007e5c891f7400be1856f98e623027646115e20bca31
|
data/README.md
CHANGED
@@ -10,8 +10,8 @@ The purpose of this gem is to provide a __simple__ way to handle the __inheritan
|
|
10
10
|
script. By default, it will handle already few config layers:
|
11
11
|
|
12
12
|
* The __system layer__, which is a level common to all applications using this gem.
|
13
|
-
* The __global layer__, which is the level to declare options for all users that use the ruby script using this gem.
|
14
13
|
* The __gem layer__, which is the layer that will enable a gem to embed its own config.
|
14
|
+
* The __global layer__, which is the level to declare options for all users that use the ruby script using this gem.
|
15
15
|
* The __user layer__, which is the level, where a user can set options for the ruby script using this gem.
|
16
16
|
* The __extra layer__, which provides the possibility to specify another config file from the command line.
|
17
17
|
* The __command-line layer__, which provides the ability to specify options from the command line.
|
@@ -76,6 +76,7 @@ clears the override layer.
|
|
76
76
|
Every layer is accessible through the following orchestrator properties:
|
77
77
|
|
78
78
|
* `system_layer`
|
79
|
+
* `gem_layer`
|
79
80
|
* `global_layer`
|
80
81
|
* `user_layer`
|
81
82
|
* `provided_config_file_layer`
|
@@ -89,8 +90,8 @@ at the source to understand where exactly your config files can be, but basicall
|
|
89
90
|
doing things...
|
90
91
|
|
91
92
|
* Sources for the [system layer][SystemLayer]
|
92
|
-
* Sources for the [global layer][GlobalLayer]
|
93
93
|
* Sources for the [gem layer][GemLayer]
|
94
|
+
* Sources for the [global layer][GlobalLayer]
|
94
95
|
* Sources for the [user layer][UserLayer]
|
95
96
|
|
96
97
|
As you can see in the sources, paths are expressed using kind of 'templates', which meaning should be obvious
|
@@ -238,7 +239,7 @@ The way layers are processed is done according to their priority. By default the
|
|
238
239
|
priorities:
|
239
240
|
|
240
241
|
* The system layer has a priority of __10__
|
241
|
-
* The
|
242
|
+
* The gem layer has a priority of __20__
|
242
243
|
* The global layer has a priority of __30__
|
243
244
|
* The user layer has a priority of __40__
|
244
245
|
* The extra layer has a priority of __50__
|
@@ -388,11 +389,11 @@ System-wide configuration level
|
|
388
389
|
There is no file attached to this level.
|
389
390
|
There is no data in this layer
|
390
391
|
--------------------------------------------------------------------------------
|
391
|
-
|
392
|
+
Gem configuration level
|
392
393
|
There is no file attached to this level.
|
393
394
|
There is no data in this layer
|
394
395
|
--------------------------------------------------------------------------------
|
395
|
-
|
396
|
+
Global configuration level
|
396
397
|
There is no file attached to this level.
|
397
398
|
There is no data in this layer
|
398
399
|
--------------------------------------------------------------------------------
|
@@ -436,8 +437,8 @@ This layer contains the following data:
|
|
436
437
|
[SS]: https://github.com/lbriais/super_stack "Super Stack gem"
|
437
438
|
[SC]: https://github.com/lbriais/stacked_config "The stacked_config Gem"
|
438
439
|
[SystemLayer]: https://github.com/lbriais/stacked_config/blob/master/lib/stacked_config/layers/system_layer.rb "the system layer places where config files are searched"
|
439
|
-
[GlobalLayer]: https://github.com/lbriais/stacked_config/blob/master/lib/stacked_config/layers/global_layer.rb "the global layer places where config files are searched"
|
440
440
|
[GemLayer]: https://github.com/lbriais/stacked_config/blob/master/lib/stacked_config/layers/gem_layer.rb "the gem layer places where config files are searched"
|
441
|
+
[GlobalLayer]: https://github.com/lbriais/stacked_config/blob/master/lib/stacked_config/layers/global_layer.rb "the global layer places where config files are searched"
|
441
442
|
[UserLayer]: https://github.com/lbriais/stacked_config/blob/master/lib/stacked_config/layers/user_layer.rb "the user layer places where config files are searched"
|
442
443
|
[YAML]: http://www.yaml.org/ "The Yaml official site"
|
443
444
|
[Slop]: https://rubygems.org/gems/slop "The Slop gem"
|
@@ -28,11 +28,11 @@ module StackedConfig
|
|
28
28
|
# The system level
|
29
29
|
@system_layer = setup_layer StackedConfig::Layers::SystemLayer, 'System-wide configuration level', 10
|
30
30
|
|
31
|
-
# The global level
|
32
|
-
@global_layer = setup_layer StackedConfig::Layers::GlobalLayer, 'Global configuration level', 20
|
33
|
-
|
34
31
|
# The gem level
|
35
|
-
@gem_layer = setup_layer StackedConfig::Layers::GemLayer, 'Gem configuration level',
|
32
|
+
@gem_layer = setup_layer StackedConfig::Layers::GemLayer, 'Gem configuration level', 20
|
33
|
+
|
34
|
+
# The global level
|
35
|
+
@global_layer = setup_layer StackedConfig::Layers::GlobalLayer, 'Global configuration level', 30
|
36
36
|
|
37
37
|
# The user level
|
38
38
|
@user_layer = setup_layer StackedConfig::Layers::UserLayer, 'User configuration level', 40
|
data/lib/stacked_config.rb
CHANGED
@@ -6,8 +6,8 @@ require 'stacked_config/source_helper'
|
|
6
6
|
require 'stacked_config/program_description_helper'
|
7
7
|
require 'stacked_config/layers/generic_layer'
|
8
8
|
require 'stacked_config/layers/system_layer'
|
9
|
-
require 'stacked_config/layers/global_layer'
|
10
9
|
require 'stacked_config/layers/gem_layer'
|
10
|
+
require 'stacked_config/layers/global_layer'
|
11
11
|
require 'stacked_config/layers/user_layer'
|
12
12
|
require 'stacked_config/layers/command_line_layer'
|
13
13
|
require 'stacked_config/layers/provided_config_file_layer'
|
data/spec/orchestrator_spec.rb
CHANGED
@@ -53,12 +53,12 @@ describe StackedConfig::Orchestrator do
|
|
53
53
|
expect(subject.system_layer).to be subject.to_a.first
|
54
54
|
end
|
55
55
|
|
56
|
-
it 'should have the
|
57
|
-
expect(subject.
|
56
|
+
it 'should have the gem layer evaluated in second' do
|
57
|
+
expect(subject.gem_layer).to be subject.to_a[1]
|
58
58
|
end
|
59
59
|
|
60
|
-
it 'should have the
|
61
|
-
expect(subject.
|
60
|
+
it 'should have the global layer evaluated in third' do
|
61
|
+
expect(subject.global_layer).to be subject.to_a[2]
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'should have the user layer evaluated in fourth' do
|