flexconf 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ # FlexConf History #
2
+
3
+ ## v0.2 - 2011-11-04 ##
4
+
5
+ * Now responds to `#keys`, `#values` and `#to_hash` methods for better Hash duck-typing
6
+
7
+ ## v0.1 - 2011-10-28 ##
8
+
9
+ * Initial release, huzzah
@@ -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.1.0"
6
+ s.version = "0.2.0"
7
7
  s.authors = ["Stephen Eley"]
8
8
  s.email = ["sfeley@gmail.com"]
9
9
  s.homepage = ""
@@ -82,7 +82,7 @@ class FlexConf
82
82
  end
83
83
 
84
84
  # Calls Hash#each on the underlying data structure.
85
- def_delegator(:@data, :each)
85
+ def_delegators(:@data, :each, :keys, :values, :to_hash)
86
86
 
87
87
  protected
88
88
  def_delegator(:@data, :[]=) # Needed to merge override data
@@ -63,6 +63,18 @@ describe FlexConf do
63
63
  it "is enumerable" do
64
64
  @this.count.should > 0
65
65
  end
66
+
67
+ it "can return its keys" do
68
+ @this.keys.should include(:zoo, :this_file, :nest)
69
+ end
70
+
71
+ it "can return its values" do
72
+ @this.values.should include("far", 0.5, 'seven')
73
+ end
74
+
75
+ it "can return itself as a hash" do
76
+ @this.to_hash.keys.should == @this.keys
77
+ end
66
78
  end
67
79
 
68
80
  describe "nesting" do
@@ -77,6 +89,12 @@ describe FlexConf do
77
89
  it "can use arbitrary call styles" do
78
90
  @this.nest[:renest].bar.should == 'foofoo'
79
91
  end
92
+
93
+ it "can return nested hashes" do
94
+ @this.development.to_hash.should == {:foo => 'dev-fu',
95
+ :boo => 'Chicken Boo',
96
+ :yoo => 'yuh?'}
97
+ end
80
98
  end
81
99
 
82
100
  describe "initialization" do
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.1.0
4
+ version: 0.2.0
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-10-28 00:00:00.000000000Z
12
+ date: 2011-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70311136259080 !ruby/object:Gem::Requirement
16
+ requirement: &70126519419820 !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: *70311136259080
24
+ version_requirements: *70126519419820
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
@@ -37,6 +37,7 @@ files:
37
37
  - .gitignore
38
38
  - .rspec
39
39
  - Gemfile
40
+ - HISTORY.md
40
41
  - LICENSE.md
41
42
  - README.md
42
43
  - Rakefile