stacked_config 0.1.3 → 0.2.0
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 +15 -5
- data/lib/stacked_config/layers/gem_layer.rb +19 -0
- data/lib/stacked_config/orchestrator.rb +7 -4
- data/lib/stacked_config/source_helper.rb +20 -3
- data/lib/stacked_config/version.rb +1 -1
- data/lib/stacked_config.rb +1 -0
- data/spec/gem_layer_spec.rb +19 -0
- data/spec/orchestrator_spec.rb +13 -7
- data/test/tstgem/.rspec +2 -0
- data/test/tstgem/Gemfile +6 -0
- data/test/tstgem/LICENSE.txt +22 -0
- data/test/tstgem/README.md +29 -0
- data/test/tstgem/Rakefile +2 -0
- data/test/tstgem/config/rspec.yml +7 -0
- data/test/tstgem/lib/tstgem/version.rb +3 -0
- data/test/tstgem/lib/tstgem.rb +7 -0
- data/test/tstgem/spec/global_spec.rb +11 -0
- data/test/tstgem/spec/spec_helper.rb +92 -0
- data/test/tstgem/tstgem.gemspec +27 -0
- metadata +28 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeab7d7be7098478801c82a9e3933a4ea32b4bb1
|
4
|
+
data.tar.gz: 3b6fd650c1bff5883658a3d4ba6266764825169f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d59f9aa0d47cf09f239259d333a88a514af31453fe6e4ffbe6766f00af5e279eee786ccab9ba5dbdd53ef25e61f9a678a70a95af45edc9dea9799c8c8565009
|
7
|
+
data.tar.gz: 6406927a47816cdac1afc9f32771c2a198c63bfc6111028aaade833504b846de75671ebdfd8efe9666d66391d24cf7aeaf60c03f61f408b446d107fb0257458c
|
data/README.md
CHANGED
@@ -11,6 +11,7 @@ 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
13
|
* The __global layer__, which is the level to declare options for all users that use the ruby script using this gem.
|
14
|
+
* The __gem layer__, which is the layer that will enable a gem to embed its own config.
|
14
15
|
* The __user layer__, which is the level, where a user can set options for the ruby script using this gem.
|
15
16
|
* The __extra layer__, which provides the possibility to specify another config file from the command line.
|
16
17
|
* The __command-line layer__, which provides the ability to specify options from the command line.
|
@@ -89,19 +90,22 @@ doing things...
|
|
89
90
|
|
90
91
|
* Sources for the [system layer][SystemLayer]
|
91
92
|
* Sources for the [global layer][GlobalLayer]
|
93
|
+
* Sources for the [gem layer][GemLayer]
|
92
94
|
* Sources for the [user layer][UserLayer]
|
93
95
|
|
94
96
|
As you can see in the sources, paths are expressed using kind of 'templates', which meaning should be obvious
|
95
97
|
|
96
98
|
* `##SYSTEM_CONFIG_ROOT##` is where the system config is stored. On Unix systems, it should be `/etc`.
|
99
|
+
* `##USER_CONFIG_ROOT##` is where the user config is stored. On Unix systems, it should be your `$HOME` directory.
|
100
|
+
* `##GEM_CONFIG_ROOT##` is the path to the "current" Gem root. The current gem being the one containing the
|
101
|
+
currently executing script.
|
97
102
|
* `##PROGRAM_NAME##` is by default the name of the script you are running (with no extension). You can if you want
|
98
103
|
change this name at runtime. __Changing it (using the `executable_name` orchestrator property ) will trigger a
|
99
104
|
re-search and reload of all the config files__.
|
100
|
-
* `##USER_CONFIG_ROOT##` is where the user config is stored. On Unix systems, it should be your `$HOME` directory.
|
101
105
|
* `##EXTENSION##` is one of the following extensions : `conf CONF cfg CFG yml YML yaml YAML`.
|
102
106
|
|
103
|
-
The search of the config files is done according to the order defined in sources just above and then
|
104
|
-
are tried according to the extensions just above in that exact order.
|
107
|
+
The search of the config files for a layer is done according to the order defined in sources just above and then
|
108
|
+
extensions are tried according to the extensions just above in that exact order.
|
105
109
|
|
106
110
|
__The first file matching for a particular level is used ! And there can be only one per level.__
|
107
111
|
|
@@ -235,8 +239,9 @@ priorities:
|
|
235
239
|
|
236
240
|
* The system layer has a priority of __10__
|
237
241
|
* The global layer has a priority of __20__
|
238
|
-
* The
|
239
|
-
* The
|
242
|
+
* The global layer has a priority of __30__
|
243
|
+
* The user layer has a priority of __40__
|
244
|
+
* The extra layer has a priority of __50__
|
240
245
|
* The command-line layer has a priority of __100__
|
241
246
|
* The override layer has a priority of __1000__
|
242
247
|
|
@@ -387,6 +392,10 @@ Global configuration level
|
|
387
392
|
There is no file attached to this level.
|
388
393
|
There is no data in this layer
|
389
394
|
--------------------------------------------------------------------------------
|
395
|
+
Gem configuration level
|
396
|
+
There is no file attached to this level.
|
397
|
+
There is no data in this layer
|
398
|
+
--------------------------------------------------------------------------------
|
390
399
|
User configuration level
|
391
400
|
There is no file attached to this level.
|
392
401
|
There is no data in this layer
|
@@ -428,6 +437,7 @@ This layer contains the following data:
|
|
428
437
|
[SC]: https://github.com/lbriais/stacked_config "The stacked_config Gem"
|
429
438
|
[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"
|
430
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
|
+
[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"
|
431
441
|
[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"
|
432
442
|
[YAML]: http://www.yaml.org/ "The Yaml official site"
|
433
443
|
[Slop]: https://rubygems.org/gems/slop "The Slop gem"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module StackedConfig
|
2
|
+
module Layers
|
3
|
+
|
4
|
+
class GemLayer < StackedConfig::Layers::GenericLayer
|
5
|
+
def possible_sources
|
6
|
+
[
|
7
|
+
['##GEM_CONFIG_ROOT##', 'etc', '##PROGRAM_NAME##.##EXTENSION##' ],
|
8
|
+
['##GEM_CONFIG_ROOT##', 'etc', '##PROGRAM_NAME##', 'config.##EXTENSION##' ],
|
9
|
+
['##GEM_CONFIG_ROOT##', 'etc', '##PROGRAM_NAME##', '##PROGRAM_NAME##.##EXTENSION##' ],
|
10
|
+
['##GEM_CONFIG_ROOT##', 'config', '##PROGRAM_NAME##.##EXTENSION##' ],
|
11
|
+
['##GEM_CONFIG_ROOT##', 'config', '##PROGRAM_NAME##', 'config.##EXTENSION##' ],
|
12
|
+
['##GEM_CONFIG_ROOT##', 'config', '##PROGRAM_NAME##', '##PROGRAM_NAME##.##EXTENSION##' ]
|
13
|
+
]
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -3,8 +3,8 @@ module StackedConfig
|
|
3
3
|
|
4
4
|
include StackedConfig::ProgramDescriptionHelper
|
5
5
|
|
6
|
-
attr_reader :system_layer, :global_layer, :
|
7
|
-
:provided_config_file_layer
|
6
|
+
attr_reader :system_layer, :global_layer, :gem_layer, :user_layer,
|
7
|
+
:command_line_layer, :provided_config_file_layer
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
super
|
@@ -31,11 +31,14 @@ module StackedConfig
|
|
31
31
|
# The global level
|
32
32
|
@global_layer = setup_layer StackedConfig::Layers::GlobalLayer, 'Global configuration level', 20
|
33
33
|
|
34
|
+
# The gem level
|
35
|
+
@gem_layer = setup_layer StackedConfig::Layers::GemLayer, 'Gem configuration level', 30
|
36
|
+
|
34
37
|
# The user level
|
35
|
-
@user_layer = setup_layer StackedConfig::Layers::UserLayer, 'User configuration level',
|
38
|
+
@user_layer = setup_layer StackedConfig::Layers::UserLayer, 'User configuration level', 40
|
36
39
|
|
37
40
|
# The specifically provided config file level
|
38
|
-
@provided_config_file_layer = setup_layer StackedConfig::Layers::ProvidedConfigFileLayer, 'Specific config file configuration level',
|
41
|
+
@provided_config_file_layer = setup_layer StackedConfig::Layers::ProvidedConfigFileLayer, 'Specific config file configuration level', 50
|
39
42
|
|
40
43
|
# The layer to write something
|
41
44
|
override_layer = setup_layer SuperStack::Layer, 'Overridden configuration level', 1000
|
@@ -35,6 +35,19 @@ module StackedConfig
|
|
35
35
|
USER_CONFIG_ROOT[os_flavour]
|
36
36
|
end
|
37
37
|
|
38
|
+
def self.gem_config_root
|
39
|
+
return nil unless $PROGRAM_NAME
|
40
|
+
|
41
|
+
Gem.loaded_specs.each_pair do |name, spec|
|
42
|
+
executable_basename = File.basename($PROGRAM_NAME)
|
43
|
+
return spec.full_gem_path if spec.executables.include? executable_basename
|
44
|
+
end
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def gem_config_root
|
49
|
+
StackedConfig::SourceHelper.gem_config_root
|
50
|
+
end
|
38
51
|
|
39
52
|
def supported_oses
|
40
53
|
StackedConfig::SourceHelper.supported_oses
|
@@ -56,9 +69,8 @@ module StackedConfig
|
|
56
69
|
@file_name = nil
|
57
70
|
places.each do |path_array|
|
58
71
|
# Perform path substitutions
|
59
|
-
potential_config_file = File.join(path_array.map
|
60
|
-
|
61
|
-
end)
|
72
|
+
potential_config_file = File.join(path_array.map { |path_part| perform_substitutions path_part })
|
73
|
+
return unless potential_config_file
|
62
74
|
# Try to find config file with extension
|
63
75
|
EXTENSIONS.each do |extension|
|
64
76
|
file = potential_config_file.gsub '##EXTENSION##', extension
|
@@ -79,6 +91,11 @@ module StackedConfig
|
|
79
91
|
|
80
92
|
exec_name = manager.nil? ? StackedConfig::Orchestrator.default_executable_name : manager.executable_name
|
81
93
|
res.gsub! '##PROGRAM_NAME##', exec_name
|
94
|
+
if res =~ /##GEM_CONFIG_ROOT##/
|
95
|
+
return nil unless gem_config_root
|
96
|
+
res.gsub! '##GEM_CONFIG_ROOT##', gem_config_root
|
97
|
+
end
|
98
|
+
|
82
99
|
res
|
83
100
|
end
|
84
101
|
|
data/lib/stacked_config.rb
CHANGED
@@ -7,6 +7,7 @@ require 'stacked_config/program_description_helper'
|
|
7
7
|
require 'stacked_config/layers/generic_layer'
|
8
8
|
require 'stacked_config/layers/system_layer'
|
9
9
|
require 'stacked_config/layers/global_layer'
|
10
|
+
require 'stacked_config/layers/gem_layer'
|
10
11
|
require 'stacked_config/layers/user_layer'
|
11
12
|
require 'stacked_config/layers/command_line_layer'
|
12
13
|
require 'stacked_config/layers/provided_config_file_layer'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe StackedConfig::Layers::GemLayer do
|
5
|
+
# subject is a modified SystemLayer to redirect system_config_root to the test directory
|
6
|
+
subject {
|
7
|
+
s = StackedConfig::Layers::GemLayer.new
|
8
|
+
gem_path = File.expand_path '../..', __FILE__
|
9
|
+
allow(s).to receive(:gem_config_root) {File.join(gem_path, 'test', 'tstgem') }
|
10
|
+
s.rescan
|
11
|
+
s
|
12
|
+
}
|
13
|
+
|
14
|
+
it 'should return the path of the first matching config file it found' do
|
15
|
+
expect(subject.file_name).not_to be_nil
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
data/spec/orchestrator_spec.rb
CHANGED
@@ -9,9 +9,11 @@ describe StackedConfig::Orchestrator do
|
|
9
9
|
gem_path = File.expand_path '../..', __FILE__
|
10
10
|
altered_sys_conf_root = File.join gem_path, 'test', os.to_s, StackedConfig::SourceHelper::SYSTEM_CONFIG_ROOT[os]
|
11
11
|
altered_user_conf_root = File.join gem_path, 'test', 'user'
|
12
|
+
altered_gem_conf_root = File.join(gem_path, 'test', 'tstgem')
|
12
13
|
|
13
14
|
allow(StackedConfig::SourceHelper).to receive(:system_config_root) { altered_sys_conf_root }
|
14
15
|
allow(StackedConfig::SourceHelper).to receive(:user_config_root) { altered_user_conf_root }
|
16
|
+
allow(StackedConfig::SourceHelper).to receive(:gem_config_root) { altered_gem_conf_root }
|
15
17
|
|
16
18
|
StackedConfig::Orchestrator.new
|
17
19
|
}
|
@@ -19,7 +21,7 @@ describe StackedConfig::Orchestrator do
|
|
19
21
|
it 'should have multiple layers' do
|
20
22
|
expect(subject.layers.length > 0).to be_truthy
|
21
23
|
# puts '#' * 80
|
22
|
-
# puts subject.
|
24
|
+
# puts subject.detailed_layers_info
|
23
25
|
# puts '#' * 80
|
24
26
|
# puts subject[].to_yaml
|
25
27
|
# puts '#' * 80
|
@@ -55,16 +57,20 @@ describe StackedConfig::Orchestrator do
|
|
55
57
|
expect(subject.global_layer).to be subject.to_a[1]
|
56
58
|
end
|
57
59
|
|
58
|
-
it 'should have the
|
59
|
-
expect(subject.
|
60
|
+
it 'should have the gem layer evaluated in third' do
|
61
|
+
expect(subject.gem_layer).to be subject.to_a[2]
|
60
62
|
end
|
61
63
|
|
62
|
-
it 'should have the
|
63
|
-
expect(subject.
|
64
|
+
it 'should have the user layer evaluated in fourth' do
|
65
|
+
expect(subject.user_layer).to be subject.to_a[3]
|
64
66
|
end
|
65
67
|
|
66
|
-
it 'should have the
|
67
|
-
expect(subject.
|
68
|
+
it 'should have the specific-file layer evaluated in fifth' do
|
69
|
+
expect(subject.provided_config_file_layer).to be subject.to_a[4]
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should have the command-line layer evaluated in sixth' do
|
73
|
+
expect(subject.command_line_layer).to be subject.to_a[5]
|
68
74
|
end
|
69
75
|
|
70
76
|
it 'should have the writable layer evaluated last' do
|
data/test/tstgem/.rspec
ADDED
data/test/tstgem/Gemfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Laurent B
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Tstgem
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'tstgem'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install tstgem
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/tstgem/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'Using stacked_config within a gem' do
|
5
|
+
|
6
|
+
it 'should detect we are in a gem' do
|
7
|
+
expect(StackedConfig::SourceHelper.gem_config_root).to_not be_nil
|
8
|
+
expect(StackedConfig::SourceHelper.gem_config_root =~ /rspec-core/).to be_truthy
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
|
18
|
+
require 'tstgem'
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# rspec-expectations config goes here. You can use an alternate
|
22
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
23
|
+
# assertions if you prefer.
|
24
|
+
config.expect_with :rspec do |expectations|
|
25
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
26
|
+
# and `failure_message` of custom matchers include text for helper methods
|
27
|
+
# defined using `chain`, e.g.:
|
28
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
29
|
+
# # => "be bigger than 2 and smaller than 4"
|
30
|
+
# ...rather than:
|
31
|
+
# # => "be bigger than 2"
|
32
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
33
|
+
end
|
34
|
+
|
35
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
36
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
39
|
+
# a real object. This is generally recommended, and will default to
|
40
|
+
# `true` in RSpec 4.
|
41
|
+
mocks.verify_partial_doubles = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# The settings below are suggested to provide a good initial experience
|
45
|
+
# with RSpec, but feel free to customize to your heart's content.
|
46
|
+
=begin
|
47
|
+
# These two settings work together to allow you to limit a spec run
|
48
|
+
# to individual examples or groups you care about by tagging them with
|
49
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
50
|
+
# get run.
|
51
|
+
config.filter_run :focus
|
52
|
+
config.run_all_when_everything_filtered = true
|
53
|
+
|
54
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
55
|
+
# For more details, see:
|
56
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
57
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
58
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
59
|
+
config.disable_monkey_patching!
|
60
|
+
|
61
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
62
|
+
# be too noisy due to issues in dependencies.
|
63
|
+
config.warnings = true
|
64
|
+
|
65
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
66
|
+
# file, and it's useful to allow more verbose output when running an
|
67
|
+
# individual spec file.
|
68
|
+
if config.files_to_run.one?
|
69
|
+
# Use the documentation formatter for detailed output,
|
70
|
+
# unless a formatter has already been configured
|
71
|
+
# (e.g. via a command-line flag).
|
72
|
+
config.default_formatter = 'doc'
|
73
|
+
end
|
74
|
+
|
75
|
+
# Print the 10 slowest examples and example groups at the
|
76
|
+
# end of the spec run, to help surface which specs are running
|
77
|
+
# particularly slow.
|
78
|
+
config.profile_examples = 10
|
79
|
+
|
80
|
+
# Run specs in random order to surface order dependencies. If you find an
|
81
|
+
# order dependency and want to debug it, you can fix the order by providing
|
82
|
+
# the seed, which is printed after each run.
|
83
|
+
# --seed 1234
|
84
|
+
config.order = :random
|
85
|
+
|
86
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
87
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
88
|
+
# test failures related to randomization by passing the same `--seed` value
|
89
|
+
# as the one that triggered the failure.
|
90
|
+
Kernel.srand config.seed
|
91
|
+
=end
|
92
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tstgem/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tstgem"
|
8
|
+
spec.version = Tstgem::VERSION
|
9
|
+
spec.authors = ["Laurent B"]
|
10
|
+
spec.email = ["lbnetid+gh@gmail.com"]
|
11
|
+
spec.summary = %q{Fake gem.}
|
12
|
+
spec.description = %q{Fake Gem, not to be deployed.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'pry'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
25
|
+
|
26
|
+
|
27
|
+
end
|
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.
|
4
|
+
version: 0.2.0
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- Rakefile
|
117
117
|
- lib/stacked_config.rb
|
118
118
|
- lib/stacked_config/layers/command_line_layer.rb
|
119
|
+
- lib/stacked_config/layers/gem_layer.rb
|
119
120
|
- lib/stacked_config/layers/generic_layer.rb
|
120
121
|
- lib/stacked_config/layers/global_layer.rb
|
121
122
|
- lib/stacked_config/layers/provided_config_file_layer.rb
|
@@ -126,6 +127,7 @@ files:
|
|
126
127
|
- lib/stacked_config/source_helper.rb
|
127
128
|
- lib/stacked_config/version.rb
|
128
129
|
- spec/command_line_layer_spec.rb
|
130
|
+
- spec/gem_layer_spec.rb
|
129
131
|
- spec/global_layer_spec.rb
|
130
132
|
- spec/orchestrator_spec.rb
|
131
133
|
- spec/provided_config_file_layer_spec.rb
|
@@ -135,6 +137,17 @@ files:
|
|
135
137
|
- spec/user_layer_spec.rb
|
136
138
|
- stacked_config.gemspec
|
137
139
|
- test/specific.yml
|
140
|
+
- test/tstgem/.rspec
|
141
|
+
- test/tstgem/Gemfile
|
142
|
+
- test/tstgem/LICENSE.txt
|
143
|
+
- test/tstgem/README.md
|
144
|
+
- test/tstgem/Rakefile
|
145
|
+
- test/tstgem/config/rspec.yml
|
146
|
+
- test/tstgem/lib/tstgem.rb
|
147
|
+
- test/tstgem/lib/tstgem/version.rb
|
148
|
+
- test/tstgem/spec/global_spec.rb
|
149
|
+
- test/tstgem/spec/spec_helper.rb
|
150
|
+
- test/tstgem/tstgem.gemspec
|
138
151
|
- test/unix/etc/rspec/rspec.yml
|
139
152
|
- test/unix/etc/stacked_config.yml
|
140
153
|
- test/user/.config/rspec.yml
|
@@ -159,12 +172,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
172
|
version: '0'
|
160
173
|
requirements: []
|
161
174
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.0.
|
175
|
+
rubygems_version: 2.0.0
|
163
176
|
signing_key:
|
164
177
|
specification_version: 4
|
165
178
|
summary: Manages config files according to standard policy.
|
166
179
|
test_files:
|
167
180
|
- spec/command_line_layer_spec.rb
|
181
|
+
- spec/gem_layer_spec.rb
|
168
182
|
- spec/global_layer_spec.rb
|
169
183
|
- spec/orchestrator_spec.rb
|
170
184
|
- spec/provided_config_file_layer_spec.rb
|
@@ -173,6 +187,17 @@ test_files:
|
|
173
187
|
- spec/system_layer_spec.rb
|
174
188
|
- spec/user_layer_spec.rb
|
175
189
|
- test/specific.yml
|
190
|
+
- test/tstgem/.rspec
|
191
|
+
- test/tstgem/Gemfile
|
192
|
+
- test/tstgem/LICENSE.txt
|
193
|
+
- test/tstgem/README.md
|
194
|
+
- test/tstgem/Rakefile
|
195
|
+
- test/tstgem/config/rspec.yml
|
196
|
+
- test/tstgem/lib/tstgem.rb
|
197
|
+
- test/tstgem/lib/tstgem/version.rb
|
198
|
+
- test/tstgem/spec/global_spec.rb
|
199
|
+
- test/tstgem/spec/spec_helper.rb
|
200
|
+
- test/tstgem/tstgem.gemspec
|
176
201
|
- test/unix/etc/rspec/rspec.yml
|
177
202
|
- test/unix/etc/stacked_config.yml
|
178
203
|
- test/user/.config/rspec.yml
|