fig_newton 0.12 → 0.13

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: 88d726ff2918b2540e7a764e0948b8c4d1adfe7d
4
- data.tar.gz: f0db4d054ff0416c03d56eeb6edefb10e3ded2f9
3
+ metadata.gz: 7a8b1e7cc715e2ae76c118fef69f9c56cbd678a1
4
+ data.tar.gz: 750aa63c2524d3f4b31c8ea0728ea9834e5ae999
5
5
  SHA512:
6
- metadata.gz: 377ee257931cf04e49bc5113a37e4e58c8a043a0298899d6fbefcfc1f8eea5b18b3eff7eb6c6b6a2a62b903eadc2f1a455641cd48e1c4fb764dbfa27b41805c8
7
- data.tar.gz: 0046d651e27a9f03c995bbacfbc4466ed48c50d4aaf6ce9871a77ad9c3e679d79e7c31c18251340c78870340d35a51e1dc861cb99b4abdd214659250205c9207
6
+ metadata.gz: 72cc2ae1b655ee9d92fa63f8daf9f8566ee2a4dfef3fa67207d9ebfe072ee237f129c997f2c8fb143a3d0ec78c0e07332698f4df3e6bc638aceac5a3f9a03ce5
7
+ data.tar.gz: 00937296edc63f6886acc8e807b5bde12dad22744d5b5e44a56b459ff27dda0ea85fd687e16747ee95f5c3fdf0ad08c1d4538fcdbcf279d66d58a3c84d641b2d
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .idea
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.13 / 2016-10-19
2
+ * Enhancements
3
+ * Added support for Symbols as values (Thanks Justin Watts)
4
+
1
5
  === Version 0.12 / 2015-02-24
2
6
  * Enhancements
3
7
  * Added ability to receive boolean values from the yml (Thanks Steve Jackson)
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
@@ -12,3 +12,4 @@ first:
12
12
  port: 1234
13
13
  set_flag: true
14
14
  cleared_flag: false
15
+ my_symbol: :hello_world
@@ -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"
@@ -19,6 +19,10 @@ 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 :([^\"]*)$/) do |value|
23
+ expect(@value).to eql value.to_sym
24
+ end
25
+
22
26
  Then (/^I should see true$/) do
23
27
  expect(@value).to be true
24
28
  end
@@ -28,7 +28,7 @@ module FigNewton
28
28
  private
29
29
 
30
30
  def type_known?(value)
31
- known_types = [String, Integer, TrueClass, FalseClass]
31
+ known_types = [String, Integer, TrueClass, FalseClass, Symbol]
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.12"
2
+ VERSION = "0.13"
3
3
  end
@@ -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 = double('yaml')
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.12'
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: 2015-02-24 00:00:00.000000000 Z
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.0.14
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