fig_newton 0.13 → 0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a8b1e7cc715e2ae76c118fef69f9c56cbd678a1
4
- data.tar.gz: 750aa63c2524d3f4b31c8ea0728ea9834e5ae999
3
+ metadata.gz: 0bac2bd527eac62e22336c27ec27d0ae9cfd0ed0
4
+ data.tar.gz: 1de1a313343e4abd87de938c8960685204a210bf
5
5
  SHA512:
6
- metadata.gz: 72cc2ae1b655ee9d92fa63f8daf9f8566ee2a4dfef3fa67207d9ebfe072ee237f129c997f2c8fb143a3d0ec78c0e07332698f4df3e6bc638aceac5a3f9a03ce5
7
- data.tar.gz: 00937296edc63f6886acc8e807b5bde12dad22744d5b5e44a56b459ff27dda0ea85fd687e16747ee95f5c3fdf0ad08c1d4538fcdbcf279d66d58a3c84d641b2d
6
+ metadata.gz: cdc5ffbb811571a31ad94562555cad6c55dd7a0bca7647f0f2f24a237ea029d2e59f090e07f1febfd41f773017de078cfeee5fedbc26d9890c8136091376f122
7
+ data.tar.gz: 9b92b8ccb40a7be31359f7e03d5bc8ed905027eaa8c6ef529707a32c5bb93d74fe4a355ae040403b45b708f0e2a23f81a2a0837dc4e2ebac95c65db330204738
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.14 / 2017-3-4
2
+ * Enhancements
3
+ * Added support for Float as value (Thanks Carlos Gutierrez)
4
+
1
5
  === Version 0.13 / 2016-10-19
2
6
  * Enhancements
3
7
  * Added support for Symbols as values (Thanks Justin Watts)
@@ -13,3 +13,4 @@ port: 1234
13
13
  set_flag: true
14
14
  cleared_flag: false
15
15
  my_symbol: :hello_world
16
+ my_float: 0.25
@@ -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
@@ -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.5'
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'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module FigNewton
2
- VERSION = "0.13"
2
+ VERSION = "0.14"
3
3
  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.13'
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: 2016-10-20 00:00:00.000000000 Z
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.5'
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.5'
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.1
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