asetus 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/asetus.gemspec +1 -1
- data/lib/asetus/configstruct.rb +2 -1
- data/lib/asetus.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fabf93268fce1615b09c0169c1c7b7d580ba66f
|
4
|
+
data.tar.gz: c83d026f4830c955396495de0c5ff9bcb752a540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a345a668e8a0362fcb38d1257f4f49243253401d0b3d66c3959cbdfc0ce3e4d6a90b39436378f1b640904f89ecdccd8043e93f2cc48f47f20ee1738a68717382
|
7
|
+
data.tar.gz: 1856d311d47d76a8eb739601d1181bb95b89a1aa68480c7eb0e0987e6d3db6715d872722df78f92ccb1f2f49abafa4936a86e4ab3d30258caa4716828278bf34
|
data/asetus.gemspec
CHANGED
data/lib/asetus/configstruct.rb
CHANGED
data/lib/asetus.rb
CHANGED
@@ -73,7 +73,7 @@ class Asetus
|
|
73
73
|
def merge *configs
|
74
74
|
hash = {}
|
75
75
|
configs.each do |config|
|
76
|
-
hash = hash.
|
76
|
+
hash = hash._asetus_deep_merge config._asetus_to_hash
|
77
77
|
end
|
78
78
|
ConfigStruct.new hash
|
79
79
|
end
|
@@ -95,3 +95,12 @@ class Asetus
|
|
95
95
|
raise NoName, "can't figure out name, specify explicitly"
|
96
96
|
end
|
97
97
|
end
|
98
|
+
|
99
|
+
class Hash
|
100
|
+
def _asetus_deep_merge newhash
|
101
|
+
merger = proc do |key, oldval, newval|
|
102
|
+
Hash === oldval && Hash === newval ? oldval.merge(newval, &merger) : newval
|
103
|
+
end
|
104
|
+
merge newhash, &merger
|
105
|
+
end
|
106
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asetus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|