fig_newton 0.12 → 0.13
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/.gitignore +1 -0
- data/ChangeLog +4 -0
- data/README.md +6 -0
- data/config/yaml/test_config.yml +1 -0
- data/features/fig_newton.feature +5 -0
- data/features/step_definitions/fig_newton_steps.rb +4 -0
- data/lib/fig_newton/missing.rb +1 -1
- data/lib/fig_newton/version.rb +1 -1
- data/spec/fig_newton/fig_newton_spec.rb +1 -2
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8b1e7cc715e2ae76c118fef69f9c56cbd678a1
|
4
|
+
data.tar.gz: 750aa63c2524d3f4b31c8ea0728ea9834e5ae999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72cc2ae1b655ee9d92fa63f8daf9f8566ee2a4dfef3fa67207d9ebfe072ee237f129c997f2c8fb143a3d0ec78c0e07332698f4df3e6bc638aceac5a3f9a03ce5
|
7
|
+
data.tar.gz: 00937296edc63f6886acc8e807b5bde12dad22744d5b5e44a56b459ff27dda0ea85fd687e16747ee95f5c3fdf0ad08c1d4538fcdbcf279d66d58a3c84d641b2d
|
data/.gitignore
CHANGED
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,12 @@ By default, FigNewton will read a file named `default.yml` but you can name your
|
|
16
16
|
FigNewton.load('system_test.yml')
|
17
17
|
````
|
18
18
|
|
19
|
+
You can also specify a comma separated list of file names:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
FigNewton.load('english_messages.yml,spanish_messages.yml,french_messages.yml')
|
23
|
+
```
|
24
|
+
|
19
25
|
Next we simply begin calling methods on the FigNewton module that match our keys. Let's assume the system_test.yml file contains the following entries:
|
20
26
|
|
21
27
|
base_url: http://system_test.mycompany.com
|
data/config/yaml/test_config.yml
CHANGED
data/features/fig_newton.feature
CHANGED
@@ -55,6 +55,11 @@ Feature: Functionality of the fig_newton gem
|
|
55
55
|
When I ask for the value for "cleared_flag"
|
56
56
|
Then I should see false
|
57
57
|
|
58
|
+
Scenario: Requesting a symbol value
|
59
|
+
Given I have read the configuration file
|
60
|
+
When I ask for the value for "my_symbol"
|
61
|
+
Then I should see :hello_world
|
62
|
+
|
58
63
|
Scenario: Requesting data from a node can be converted to a hash
|
59
64
|
Given I have read the configuration file
|
60
65
|
When I ask for the value for "database"
|
data/lib/fig_newton/missing.rb
CHANGED
data/lib/fig_newton/version.rb
CHANGED
@@ -4,10 +4,9 @@ describe FigNewton do
|
|
4
4
|
context "when asking for data" do
|
5
5
|
it "should retrieve the data by a key named after the method called" do
|
6
6
|
FigNewton.yml_directory = 'conf'
|
7
|
-
yml_mock =
|
7
|
+
yml_mock = {'desired_data' => 'information'}
|
8
8
|
expect(File).to receive(:read).with('conf/test').and_return('test')
|
9
9
|
expect(YAML).to receive(:load).and_return(yml_mock)
|
10
|
-
expect(yml_mock).to receive(:[]).with('desired_data').and_return('information')
|
11
10
|
FigNewton.load('test')
|
12
11
|
expect(FigNewton.desired_data).to eql 'information'
|
13
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fig_newton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Morgan
|
@@ -9,48 +9,48 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yml_reader
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0.5'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0.5'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 3.2.0
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 3.2.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: cucumber
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 1.3.19
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.3.19
|
56
56
|
description: Provides a simple mechanism to maintain and use different configurations
|
@@ -62,11 +62,11 @@ executables: []
|
|
62
62
|
extensions: []
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
|
-
- .gitignore
|
66
|
-
- .rspec
|
67
|
-
- .ruby-gemset
|
68
|
-
- .ruby-version
|
69
|
-
- .travis.yml
|
65
|
+
- ".gitignore"
|
66
|
+
- ".rspec"
|
67
|
+
- ".ruby-gemset"
|
68
|
+
- ".ruby-version"
|
69
|
+
- ".travis.yml"
|
70
70
|
- ChangeLog
|
71
71
|
- Gemfile
|
72
72
|
- Guardfile
|
@@ -97,17 +97,17 @@ require_paths:
|
|
97
97
|
- lib
|
98
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- -
|
105
|
+
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.5.1
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Provides a simple mechanism to maintain and use different configurations
|