confuse 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,5 +30,19 @@ module Confuse
30
30
  def config
31
31
  self
32
32
  end
33
+
34
+ def self.params_hash
35
+ namespaces.reduce({}) do |memo, (name, namespace)|
36
+ namespace.keys.each do |key|
37
+ item = namespace.get_item(key)
38
+ memo[:"#{name}_#{key}"] = {
39
+ :type => item.type,
40
+ :doc => item.description,
41
+ :default => item.default_value }
42
+ end
43
+ memo
44
+ end
45
+ end
46
+
33
47
  end
34
48
  end
@@ -49,7 +49,7 @@ module Confuse
49
49
  end
50
50
  end
51
51
 
52
- def params_hash
52
+ def self.params_hash
53
53
  namespaces.reduce({}) do |memo, (name, namespace)|
54
54
  namespace.keys.each do |key|
55
55
  item = namespace.get_item(key)
@@ -1,3 +1,3 @@
1
1
  module Confuse
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -15,7 +15,7 @@ class TestConfigBase < MiniTest::Unit::TestCase
15
15
  def test_params_hash
16
16
  assert_equal({ :default_foo => { :type => :string, :doc => 'foo',
17
17
  :default => 'foo' } },
18
- Foo.new.params_hash)
18
+ Foo.params_hash)
19
19
  end
20
20
 
21
21
  def test_can_specify_config_options_on_initialize
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confuse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Chipchase