fig_newton 0.13 → 0.14
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/ChangeLog +4 -0
- data/config/yaml/test_config.yml +1 -0
- data/features/fig_newton.feature +11 -6
- data/features/step_definitions/fig_newton_steps.rb +5 -0
- data/fig_newton.gemspec +1 -1
- data/lib/fig_newton/missing.rb +1 -1
- data/lib/fig_newton/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bac2bd527eac62e22336c27ec27d0ae9cfd0ed0
|
4
|
+
data.tar.gz: 1de1a313343e4abd87de938c8960685204a210bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc5ffbb811571a31ad94562555cad6c55dd7a0bca7647f0f2f24a237ea029d2e59f090e07f1febfd41f773017de078cfeee5fedbc26d9890c8136091376f122
|
7
|
+
data.tar.gz: 9b92b8ccb40a7be31359f7e03d5bc8ed905027eaa8c6ef529707a32c5bb93d74fe4a355ae040403b45b708f0e2a23f81a2a0837dc4e2ebac95c65db330204738
|
data/ChangeLog
CHANGED
data/config/yaml/test_config.yml
CHANGED
data/features/fig_newton.feature
CHANGED
@@ -9,12 +9,12 @@ Feature: Functionality of the fig_newton gem
|
|
9
9
|
Given I have read the configuration file
|
10
10
|
When I ask for a value that does not exist named "does_not_exist"
|
11
11
|
Then I should raise a NoMethodError exception
|
12
|
-
|
12
|
+
|
13
13
|
Scenario: Getting the default filename from an environment variable
|
14
14
|
Given I have an environment variable named "FIG_NEWTON_FILE" set to "sample.yml"
|
15
15
|
When I ask for the value for "from_the_env_file"
|
16
16
|
Then I should see "read from the env file"
|
17
|
-
|
17
|
+
|
18
18
|
Scenario: Using a file that has the same name as the hostname
|
19
19
|
Given I have a yml file that is named after the hostname
|
20
20
|
When I ask for the value for "from_the_hostname_file"
|
@@ -39,12 +39,17 @@ Feature: Functionality of the fig_newton gem
|
|
39
39
|
Given I have read the default file from the default directory
|
40
40
|
When I ask for the value for "base_url"
|
41
41
|
Then I should see "http://cheezyworld.com"
|
42
|
-
|
42
|
+
|
43
43
|
Scenario: Requesting a numerical value
|
44
44
|
Given I have read the configuration file
|
45
45
|
When I ask for the value for "port"
|
46
46
|
Then I should see 1234
|
47
47
|
|
48
|
+
Scenario: Requesting a decimal value
|
49
|
+
Given I have read the configuration file
|
50
|
+
When I ask for the value for "my_float"
|
51
|
+
Then I should see 0.25
|
52
|
+
|
48
53
|
Scenario: Requesting a true boolean value
|
49
54
|
Given I have read the configuration file
|
50
55
|
When I ask for the value for "set_flag"
|
@@ -72,18 +77,18 @@ Feature: Functionality of the fig_newton gem
|
|
72
77
|
Given I have read the configuration file
|
73
78
|
When I ask for a value that does not exist named "does_not_exist" that has a default value "the default value"
|
74
79
|
Then I should see "the default value"
|
75
|
-
|
80
|
+
|
76
81
|
Scenario: Requesting data that does not exist but has a default block should return the block result
|
77
82
|
Given I have read the configuration file
|
78
83
|
When I ask for a value that does not exist named "does_not_exist" that has a default block returning "the default value"
|
79
84
|
Then I should see "the default value"
|
80
|
-
|
85
|
+
|
81
86
|
Scenario: Requesting data that does not exist but has a default lambda should return the lambda result
|
82
87
|
Given I have read the configuration file
|
83
88
|
When I ask for a value that does not exist named "does_not_exist" that has a default lambda returning "the default value"
|
84
89
|
Then I should see "the default value"
|
85
90
|
And the lambda should be passed the property "does_not_exist"
|
86
|
-
|
91
|
+
|
87
92
|
Scenario: Requesting data that does not exist but has a default proc should return the proc result
|
88
93
|
Given I have read the configuration file
|
89
94
|
When I ask for a value that does not exist named "does_not_exist" that has a default proc returning "the default value"
|
@@ -19,6 +19,11 @@ Then (/^I should see (\d+)$/) do |value|
|
|
19
19
|
expect(@value).to eql value.to_i
|
20
20
|
end
|
21
21
|
|
22
|
+
Then(/^I should see (\d+)\.(\d+)$/) do |value1, value2|
|
23
|
+
decimal = value1 + '.' + value2
|
24
|
+
expect(@value).to eql decimal.to_f
|
25
|
+
end
|
26
|
+
|
22
27
|
Then (/^I should see :([^\"]*)$/) do |value|
|
23
28
|
expect(@value).to eql value.to_sym
|
24
29
|
end
|
data/fig_newton.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
gem.version = FigNewton::VERSION
|
18
18
|
|
19
|
-
gem.add_dependency 'yml_reader', '>= 0.
|
19
|
+
gem.add_dependency 'yml_reader', '>= 0.7'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'rspec', '>= 3.2.0'
|
22
22
|
gem.add_development_dependency 'cucumber', '>= 1.3.19'
|
data/lib/fig_newton/missing.rb
CHANGED
@@ -28,7 +28,7 @@ module FigNewton
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def type_known?(value)
|
31
|
-
known_types = [String, Integer, TrueClass, FalseClass, Symbol]
|
31
|
+
known_types = [String, Integer, TrueClass, FalseClass, Symbol, Float]
|
32
32
|
known_types.any? { |type| value.kind_of? type }
|
33
33
|
end
|
34
34
|
end
|
data/lib/fig_newton/version.rb
CHANGED
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.14'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Morgan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yml_reader
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0.
|
20
|
+
version: '0.7'
|
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
|
-
version: '0.
|
27
|
+
version: '0.7'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.5.
|
110
|
+
rubygems_version: 2.5.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Provides a simple mechanism to maintain and use different configurations
|