yamlcon 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yamlcon/version.rb +1 -1
- data/lib/yamlcon/yamlcon.rb +9 -2
- 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: bf073fafcfc37a848b85cda5d8edb43350da69cb
|
4
|
+
data.tar.gz: 26e7a381b68fbc33f8b99609805ef9633e67f8f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38f412b87a0beaa229648f84d703aba13dced5473774280a92ac7dc1e24340ad8b2e13d0ae3fc774ddd68c0e2a5957f32c6b59297e6d65d1c2326ded046c9a6f
|
7
|
+
data.tar.gz: 17340c5900fc5536c7d5b04ba6060069efbb0796e89a37cbce9dc77638a4fbc0960b5b6f94bb9d651b23577355a87e432ac8c14c7836490781c8bf6f771d3920
|
data/lib/yamlcon/version.rb
CHANGED
data/lib/yamlcon/yamlcon.rb
CHANGED
@@ -14,10 +14,17 @@ module YAMLCon
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.hash_to_struct(hash)
|
17
|
+
return hash unless hash.is_a? Hash
|
17
18
|
dotted = OpenStruct.new hash
|
18
|
-
|
19
|
-
|
19
|
+
|
20
|
+
hash.each do |key, value|
|
21
|
+
if value.is_a? Hash
|
22
|
+
dotted[key] = hash_to_struct(value)
|
23
|
+
elsif value.is_a? Array
|
24
|
+
dotted[key] = value.collect {|item| hash_to_struct item }
|
25
|
+
end
|
20
26
|
end
|
27
|
+
|
21
28
|
dotted
|
22
29
|
end
|
23
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yamlcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: runfile
|