fig_newton 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -3,6 +3,5 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - rbx-19mode
7
6
  - ree
8
- - ruby-head
7
+
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.6 / 2012-11-14
2
+ * Fixes
3
+ * Fixed a problem where it would not return an integer (Thanks Steve Jackson)
4
+
1
5
  === Version 0.5 / 2012-7-29
2
6
  * Fixes
3
7
  * Fixed problem when using FIG_NEWTON_FILE without first calling load
@@ -8,3 +8,5 @@ first:
8
8
  second:
9
9
  third: foo
10
10
  fourth: bar
11
+
12
+ port: 1234
@@ -34,3 +34,7 @@ Feature: Functionality of the fig_newton gem
34
34
  When I ask for the value for "base_url"
35
35
  Then I should see "http://cheezyworld.com"
36
36
 
37
+ Scenario: Requesting a numerical value
38
+ Given I have read the configuration file
39
+ When I ask for the value for "port"
40
+ Then I should see 1234
@@ -15,6 +15,10 @@ Then /^I should see "([^\"]*)"$/ do |value|
15
15
  @value.should == value
16
16
  end
17
17
 
18
+ Then /^I should see (\d+)$/ do |value|
19
+ @value.should == value.to_i
20
+ end
21
+
18
22
  When /^I ask for a value that does not exist named "([^\"]*)"$/ do |non_existing|
19
23
  @does_not_exist = non_existing
20
24
  end
@@ -5,7 +5,7 @@ module FigNewton
5
5
  m = args.first
6
6
  value = @yml[m.to_s]
7
7
  super unless value
8
- value = FigNewton::Node.new(value) unless value.kind_of? String
8
+ value = FigNewton::Node.new(value) unless type_known? value
9
9
  value
10
10
  end
11
11
 
@@ -13,5 +13,10 @@ module FigNewton
13
13
  @yml = YAML.load_file "#{yml_directory}/#{ENV['FIG_NEWTON_FILE']}" if ENV['FIG_NEWTON_FILE']
14
14
  FigNewton.load('default.yml') unless ENV['FIG_NEWTON_FILE']
15
15
  end
16
+
17
+ private
18
+ def type_known?(value)
19
+ value.kind_of? String or value.kind_of? Integer
20
+ end
16
21
  end
17
22
  end
@@ -1,3 +1,3 @@
1
1
  module FigNewton
2
- VERSION = "0.5"
2
+ VERSION = "0.6"
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.5'
4
+ version: '0.6'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-29 00:00:00.000000000 Z
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yml_reader
@@ -105,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: 1560042281970778938
108
+ hash: 2254345954836371452
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  none: false
111
111
  requirements:
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  segments:
116
116
  - 0
117
- hash: 1560042281970778938
117
+ hash: 2254345954836371452
118
118
  requirements: []
119
119
  rubyforge_project:
120
120
  rubygems_version: 1.8.24