flexconf 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # FlexConf History #
2
2
 
3
+ ## v0.3 - 2011-11-06 ##
4
+
5
+ * Fixed bug with method-style access on values of `false`
6
+
3
7
  ## v0.2 - 2011-11-04 ##
4
8
 
5
9
  * Now responds to `#keys`, `#values` and `#to_hash` methods for better Hash duck-typing
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "flexconf"
6
- s.version = "0.2.0"
6
+ s.version = "0.2.1"
7
7
  s.authors = ["Stephen Eley"]
8
8
  s.email = ["sfeley@gmail.com"]
9
9
  s.homepage = ""
@@ -182,6 +182,6 @@ class FlexConf
182
182
  end
183
183
 
184
184
  def method_missing(name, *args, &block)
185
- self[name] or super
185
+ self.has_key?(name) ? self[name] : super
186
186
  end
187
187
  end
@@ -6,6 +6,7 @@ local_file: 'none'
6
6
  foo: :bar # Ordinary string key
7
7
  7: 'seven' # Non-string key
8
8
  :boo: 'far' # Symbol key
9
+ sky_is_purple: false # Test method calls on false values
9
10
 
10
11
  # Name collisions
11
12
  'zoo': 'ostrich'
@@ -21,6 +21,10 @@ describe FlexConf do
21
21
  @this.foo.should == :bar
22
22
  end
23
23
 
24
+ it "can read 'false' values as method calls" do
25
+ @this.sky_is_purple.should == false
26
+ end
27
+
24
28
  it "can read non-string keys" do
25
29
  @this[7].should == 'seven'
26
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexconf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-04 00:00:00.000000000 Z
12
+ date: 2011-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70126519419820 !ruby/object:Gem::Requirement
16
+ requirement: &70227438707960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70126519419820
24
+ version_requirements: *70227438707960
25
25
  description: ! "FlexConf is a simple configuration utility that does its job and gets\nout
26
26
  of your way. It reads settings from a hash or YAML file ('config.yml' by default)\nbut
27
27
  allows overrides from a '*_local.yml' file and from environment variables. \nSettings