confuse 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,8 +14,11 @@ module Confuse
14
14
 
15
15
  def initialize(*paths)
16
16
  load_namespaces(self.class.namespaces)
17
- read_files(self.class.config_path.flatten)
18
- read_files(paths.flatten)
17
+ if paths.flatten.empty?
18
+ read_files(self.class.config_path.flatten)
19
+ else
20
+ read_files(paths.flatten)
21
+ end
19
22
  end
20
23
 
21
24
  def config
@@ -34,10 +34,14 @@ module Confuse
34
34
  ns[rest_of_key, self]
35
35
  end
36
36
 
37
+ def []=(key, value)
38
+ mixin_config!({key => value})
39
+ end
40
+
37
41
  def to_hash
38
42
  namespaces.reduce({}) do |memo, (name, namespace)|
39
43
  namespace.keys.each do |key|
40
- memo["#{name}_#{key}"] = namespace[key, self]
44
+ memo[:"#{name}_#{key}"] = namespace[key, self]
41
45
  end
42
46
  memo
43
47
  end
@@ -1,3 +1,3 @@
1
1
  module Confuse
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Chipchase
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-10-04 00:00:00 Z
18
+ date: 2013-10-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: inifile