configus 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,11 @@ module Configus
26
26
  end
27
27
 
28
28
  def to_hash
29
- @config
29
+ hash = {}
30
+ @config.each_pair do |key, value|
31
+ hash[key] = value.respond_to?(:to_hash) ? value.to_hash : value
32
+ end
33
+ hash
30
34
  end
31
35
 
32
36
  def each_pair(&block)
@@ -1,3 +1,3 @@
1
1
  module Configus
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -6,7 +6,10 @@ describe Configus::Config do
6
6
  :foo => 'bar',
7
7
  :sections => {
8
8
  :first => 'first_value',
9
- :second => 'second_value'
9
+ :second => 'second_value',
10
+ :another_key => {
11
+ :key => :value
12
+ }
10
13
  },
11
14
  :pairs => { :pkay => "vkay" }
12
15
  }
@@ -27,6 +30,10 @@ describe Configus::Config do
27
30
  @config[:sections].second == @options[:sections][:second]
28
31
  end
29
32
 
33
+ it 'should be transform to hash' do
34
+ @config.to_hash.should == @options
35
+ end
36
+
30
37
  it 'should passing each key-value pair' do
31
38
  @config.pairs.each_pair { |key, value| } == @options[:pairs].each_pair { |key, value| }
32
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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: 2012-02-07 00:00:00.000000000 Z
12
+ date: 2012-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &15082200 !ruby/object:Gem::Requirement
16
+ requirement: &75431570 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *15082200
24
+ version_requirements: *75431570
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &15081680 !ruby/object:Gem::Requirement
27
+ requirement: &75431290 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15081680
35
+ version_requirements: *75431290
36
36
  description: Configus helps you easily manage environment specific settings
37
37
  email:
38
38
  - mokevnin@gmail.com
@@ -80,3 +80,4 @@ signing_key:
80
80
  specification_version: 3
81
81
  summary: Configus helps you easily manage environment specific settings
82
82
  test_files: []
83
+ has_rdoc: