stacked_config 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -15
- data/lib/stacked_config/version.rb +1 -1
- data/stacked_config.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b66b827c3542faf858b9697ad3c35efe30980b63
|
4
|
+
data.tar.gz: 682e01cbc5c4532b368c906df4eff6ae9156656c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4dcfaa3b02d6ba6bb8d4aac0f5e88497b913608f69eccf45b94e6216458ed1a931d7509366150c182e78196b7d2e99ed4393cfa02652e66c9a77fc1f6a8abb
|
7
|
+
data.tar.gz: b44d56098749350e49483b7596d35e13eb35b1ed7b92d30f1f7785e72cecc861d4299eb96446a234ea56dce39897e34653158a3a9d584b22454dfe4e10692309
|
data/README.md
CHANGED
@@ -21,6 +21,9 @@ detail). The `StackedConfig::Orchestrator` will expose a merged view of all its
|
|
21
21
|
|
22
22
|
All the config files are following the [YAML] syntax.
|
23
23
|
|
24
|
+
__If you're looking for a complete solution for your scripts, including some logging features, then you are probably
|
25
|
+
looking for the [easy_app_helper Gem][EAH], which is internally using [this one][SC].__
|
26
|
+
|
24
27
|
## Installation
|
25
28
|
|
26
29
|
Add this line to your application's Gemfile:
|
@@ -124,7 +127,8 @@ To even have a better command line help displayed you can provide optional infor
|
|
124
127
|
* The __application version__ through the `app_version` orchestrator property.
|
125
128
|
* The __application description__ through the `app_description` orchestrator property.
|
126
129
|
|
127
|
-
You could as well do this with the `describes_application` method (see [complete example]
|
130
|
+
You could as well do this with the `describes_application` method (see [complete example]
|
131
|
+
(#a-complete-example-of-a-program-using-this-gem) at the end of this page).
|
128
132
|
|
129
133
|
```ruby
|
130
134
|
require 'stacked_config'
|
@@ -261,18 +265,19 @@ But basically just create your new layer, gives it a priority and add it to the
|
|
261
265
|
|
262
266
|
### Changing the way things are merged
|
263
267
|
|
264
|
-
The [super_stack gem][SS] defines
|
265
|
-
`SuperStack::MergePolicies::FullMergePolicy` that merges hashes and arrays at all levels. But you can choose to
|
266
|
-
change the merge behaviour by changing the merge policy. See [super_stack gem][SS] documentation for other
|
267
|
-
policies.
|
268
|
+
The [super_stack gem][SS] defines various merge policies. By default `stacked_config` will use the
|
269
|
+
`SuperStack::MergePolicies::FullMergePolicy` that merges hashes and arrays at all levels. But you can choose to
|
270
|
+
completely change the merge behaviour by changing the merge policy. See [super_stack gem][SS] documentation for other
|
271
|
+
available merge policies.
|
268
272
|
|
269
|
-
Merge policies can be changed either at orchestrator level or at layer level
|
273
|
+
Merge policies can be changed either at orchestrator level (globally) or at layer level (for the layer only) by setting
|
274
|
+
the `merge_policy` property.
|
270
275
|
|
271
276
|
This is actually exactly what happens when the `config-override` flag is passed on the command line. It triggers the
|
272
277
|
change of the merge policy of the extra layer from `SuperStack::MergePolicies::FullMergePolicy` to
|
273
278
|
`SuperStack::MergePolicies::OverridePolicy`.
|
274
279
|
|
275
|
-
## A complete example of a program using
|
280
|
+
## A complete example of a program using this Gem
|
276
281
|
|
277
282
|
Save the following file somewhere as `example.rb`.
|
278
283
|
|
@@ -332,21 +337,21 @@ end
|
|
332
337
|
MyApp.new.run
|
333
338
|
```
|
334
339
|
|
335
|
-
If you run
|
340
|
+
If you run:
|
336
341
|
|
337
342
|
$ ./example.rb
|
338
343
|
|
339
|
-
You would get
|
344
|
+
You would get:
|
340
345
|
|
341
346
|
```
|
342
347
|
## Bye...
|
343
348
|
```
|
344
349
|
|
345
|
-
If you run
|
350
|
+
If you run:
|
346
351
|
|
347
352
|
$ ./example.rb --help
|
348
353
|
|
349
|
-
You would get
|
354
|
+
You would get:
|
350
355
|
|
351
356
|
```
|
352
357
|
Usage: example [options]
|
@@ -366,11 +371,11 @@ Best app ever
|
|
366
371
|
--an_int Stupid option with integer argument
|
367
372
|
```
|
368
373
|
|
369
|
-
If you run
|
374
|
+
If you run:
|
370
375
|
|
371
376
|
$ ./example.rb --verbose
|
372
377
|
|
373
|
-
You would get
|
378
|
+
You would get:
|
374
379
|
```
|
375
380
|
## Here is a display of the config sources and contents
|
376
381
|
--------------------------------------------------------------------------------
|
@@ -420,8 +425,10 @@ This layer contains the following data:
|
|
420
425
|
5. Create a Pull Request.
|
421
426
|
|
422
427
|
[SS]: https://github.com/lbriais/super_stack "Super Stack gem"
|
428
|
+
[SC]: https://github.com/lbriais/stacked_config "The stacked_config Gem"
|
423
429
|
[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"
|
424
430
|
[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"
|
425
431
|
[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"
|
426
|
-
[YAML]: http://www.yaml.org/
|
427
|
-
[Slop]: https://rubygems.org/gems/slop
|
432
|
+
[YAML]: http://www.yaml.org/ "The Yaml official site"
|
433
|
+
[Slop]: https://rubygems.org/gems/slop "The Slop gem"
|
434
|
+
[EAH]: https://github.com/lbriais/easy_app_helper "The EasyAppHelper gem"
|
data/stacked_config.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stacked_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent B.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,16 +90,16 @@ dependencies:
|
|
90
90
|
name: slop
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0'
|
95
|
+
version: '3.0'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
102
|
+
version: '3.0'
|
103
103
|
description: A config file manager on steroids focusing on places.
|
104
104
|
email:
|
105
105
|
- lbnetid+gh@gmail.com
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.0.
|
162
|
+
rubygems_version: 2.0.14
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Manages config files according to standard policy.
|