yaml_to_csv 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yaml_to_csv.rb +5 -4
- data/lib/yaml_to_csv/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba87113ac0fea5b7035cb7cce2089bd667d19c1a
|
4
|
+
data.tar.gz: 65018a508c727b51adf1b14cbb151faa75786e51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55f57b3c1737ef73dc36f38f3b20a9e4a2aff772070a7ea49b74af6ac84fc019f74683f66222bda9ef28aa029b2265219d1cd91c06f0447ab86e7470ae4ab0d1
|
7
|
+
data.tar.gz: e1d22cd25b7db9a58c7ec2da5390b069f64d8590e5bd329b2e1ee40284d1f880e57bd6e58e82df62c9bf4546badae7b225430b14731c863f3c8e007be0a1a42f
|
data/lib/yaml_to_csv.rb
CHANGED
@@ -28,12 +28,13 @@ class YamlToCsv
|
|
28
28
|
csv_arrs.reduce({}) do |hsh, (composite_key, value)|
|
29
29
|
keys = split_keys.call(composite_key)
|
30
30
|
nested = hsh
|
31
|
-
keys.
|
32
|
-
|
33
|
-
|
34
|
-
else
|
31
|
+
keys.each_with_index do |key, idx|
|
32
|
+
has_nested_keys = (idx + 1) != keys.length
|
33
|
+
if has_nested_keys
|
35
34
|
nested[key] ||= {}
|
36
35
|
nested = nested[key]
|
36
|
+
else
|
37
|
+
nested[key] = value
|
37
38
|
end
|
38
39
|
end
|
39
40
|
hsh
|
data/lib/yaml_to_csv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_to_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten Claes
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,4 +95,3 @@ signing_key:
|
|
95
95
|
specification_version: 4
|
96
96
|
summary: Convert YAML to CSV and vice versa
|
97
97
|
test_files: []
|
98
|
-
has_rdoc:
|