ol_dump_parser 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ol_dump_parser/parser.rb +6 -6
- data/lib/ol_dump_parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c17a4b08c430a964231f9a2b86df762523c8f971b9ad110564b7fba139508e0c
|
4
|
+
data.tar.gz: db592a483161931b55aaaded5dffca5873ea5ed86bd2a9b3823547db98e04947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7699d775b23712bd18910ff82a589099376fc136f266eac96c6a048a5021c73a27fa7c959d6b516f8fca656fb1f0d4a4e8d0a1b69850e9d576b5ad30c048748
|
7
|
+
data.tar.gz: 92c0628f0d6770e2821ebdbea52b7acfcb0718aad9b3b150c5e39319a84c3dc73d24d020af2e6c851c567bc3286b4f33af6491a48dd19632ceaf6b34b80d5b6e
|
@@ -29,19 +29,19 @@ module OlDumpParser
|
|
29
29
|
File.open(inp_file).each do |line|
|
30
30
|
# CSV parse returns an array of rows - we need only the first
|
31
31
|
parsed_line = CSV.parse(line.chomp, col_sep: "\t", liberal_parsing: true).first
|
32
|
-
|
33
|
-
puts
|
34
|
-
output.puts
|
32
|
+
value_map = csv_row_to_map(parsed_line)
|
33
|
+
puts value_map[:details]['name'] if verbose
|
34
|
+
output.puts value_map.to_json
|
35
35
|
end
|
36
36
|
output.close
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
|
-
# Convert the given row values to a
|
41
|
+
# Convert the given row values to a hashmap
|
42
42
|
# @param row_values [Array] Csv row values
|
43
|
-
# @return [Hash]
|
44
|
-
def
|
43
|
+
# @return [Hash] hash map
|
44
|
+
def csv_row_to_map(row_values)
|
45
45
|
{
|
46
46
|
type: row_values[0],
|
47
47
|
key: row_values[1],
|