ol_dump_parser 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ol_dump_parser.rb +0 -1
- data/lib/ol_dump_parser/parser.rb +5 -1
- data/lib/ol_dump_parser/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f84f422d37b4e038f7248a97895c4aefb05dd99310f8c670b0387dea13f37aff
|
4
|
+
data.tar.gz: 556f70662b2497b3c05ccddccde6bbb5a5b7674d87c9d84fbcee9638202f5b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1468b213e31f19f27ec6645535fcc82891173b9580544230bbe9e3c1e573c515c6aa4a54d45cc3ced1b86cd9aa8823143ab619a7e7d6d981ae0a3fab98b9aafd
|
7
|
+
data.tar.gz: 708aa920d74f29726325e26f12e770cf6427e3c33c95eaefe8519eab9e793eb98c3ae32f87d843bd8cd2553354f63fa68998620aae68d5cafb3b5a3ba2bb5354
|
data/lib/ol_dump_parser.rb
CHANGED
@@ -10,6 +10,9 @@ module OlDumpParser
|
|
10
10
|
# @return [String] Path to the output file
|
11
11
|
attr_accessor :out_file
|
12
12
|
|
13
|
+
# @return [Boolean] Verbose mode
|
14
|
+
attr_accessor :verbose
|
15
|
+
|
13
16
|
# Constructor for Parser
|
14
17
|
# @param [Hash] params Inputs to parser
|
15
18
|
# @option params [String] :inp_file Path to the input file
|
@@ -17,6 +20,7 @@ module OlDumpParser
|
|
17
20
|
def initialize(params)
|
18
21
|
self.inp_file = params[:inp_file]
|
19
22
|
self.out_file = params[:out_file]
|
23
|
+
self.verbose = params[:verbose] || false
|
20
24
|
end
|
21
25
|
|
22
26
|
# Parses the input csv file and converts to a json file
|
@@ -26,7 +30,7 @@ module OlDumpParser
|
|
26
30
|
# CSV parse returns an array of rows - we need only the first
|
27
31
|
parsed_line = CSV.parse(line.chomp, col_sep: "\t", liberal_parsing: true).first
|
28
32
|
json_output = csv_row_to_json(parsed_line)
|
29
|
-
|
33
|
+
puts json_output[:details]['name'] if verbose
|
30
34
|
output.puts json_output
|
31
35
|
end
|
32
36
|
output.close
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ol_dump_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arjun M Das
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -54,7 +54,7 @@ homepage: https://github.com/thearjunmdas/openlibrary-dump-parser
|
|
54
54
|
licenses:
|
55
55
|
- MIT
|
56
56
|
metadata: {}
|
57
|
-
post_install_message:
|
57
|
+
post_install_message:
|
58
58
|
rdoc_options: []
|
59
59
|
require_paths:
|
60
60
|
- lib
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubygems_version: 3.2.3
|
73
|
-
signing_key:
|
73
|
+
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Open Library Dump Parser
|
76
76
|
test_files: []
|