config_plus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/config_plus/base.rb +3 -2
- data/lib/config_plus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 599e3bd010d176091ffe984b74c85369558386fe
|
4
|
+
data.tar.gz: b558ba580faf0701f777d0003c3757a113c84ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 121668b57e69c4119f6a3e267f88215f12c779983d7712b2980e11cfafc18bc32b2af02177a03f6e485b1aba8456f4b2263c1a66ac9f9f26772fffb9e8bb0177
|
7
|
+
data.tar.gz: 66ca9d59b7b6db91ba7c57f75904071af8fd584f20c80b8342fba905bbeb5febacf304f169122ef3aa49609ce7db4fd2574f8ea951ff74a2d9ff62dceef59fcb
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ when you specify a directory path at `ConfigPlus.generate from:`.
|
|
41
41
|
ConfigPlus.generate(from: '/path/to/configuration/directory')
|
42
42
|
```
|
43
43
|
|
44
|
-
And you can specify some
|
44
|
+
And you can specify some paths using an array.
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
ConfigPlus.generate(from: ['/path/to/directory1', '/path/to/file1.yml'])
|
@@ -82,7 +82,7 @@ buzz.config.spam
|
|
82
82
|
Overwrite Merge
|
83
83
|
------------------------------------------------------------
|
84
84
|
`ConfigPlus` loads the specified configuration files in file
|
85
|
-
name order and
|
85
|
+
name order and merges all of configuration into a single hash.
|
86
86
|
|
87
87
|
```yml
|
88
88
|
# sample-00.yml
|
data/lib/config_plus/base.rb
CHANGED
@@ -66,16 +66,17 @@ module ConfigPlus
|
|
66
66
|
klass != base and
|
67
67
|
klass != ConfigPlus and
|
68
68
|
klass.ancestors.include?(ConfigPlus)
|
69
|
-
}.reverse.
|
69
|
+
}.reverse.each.inject({}) {|hsh, klass|
|
70
70
|
h = klass.public_send(method_name)
|
71
71
|
h = helper.config_for(klass, ::ConfigPlus.root) unless
|
72
72
|
h or h.is_a?(Hash)
|
73
|
-
|
73
|
+
Merger.merge(hsh, h)
|
74
74
|
}
|
75
75
|
|
76
76
|
[base, base.singleton_class].each do |obj|
|
77
77
|
obj.instance_eval do
|
78
78
|
config = inheritance ? inheritance.merge(own || {}) : own
|
79
|
+
config = ::ConfigPlus::Node.new(config)
|
79
80
|
define_method method_name, -> { config }
|
80
81
|
end
|
81
82
|
end
|
data/lib/config_plus/version.rb
CHANGED