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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 143bc6f339f1330854b00bec96a64fee9be7841ac8014f492980eb0e3c48acf7
4
- data.tar.gz: e4c14464e5fa2de0ed9916265a0e4b4ecfca29b3730ac8bc761e12a3d1999987
3
+ metadata.gz: f84f422d37b4e038f7248a97895c4aefb05dd99310f8c670b0387dea13f37aff
4
+ data.tar.gz: 556f70662b2497b3c05ccddccde6bbb5a5b7674d87c9d84fbcee9638202f5b61
5
5
  SHA512:
6
- metadata.gz: '0108a1fb35fcd2474dbd39435389e3cca4d8ef91121c83f105807d8d27369a885b86f34cdd4f1495b3445a9812f760b5e59f3dba858d5dd6eadec7b4c6dc7936'
7
- data.tar.gz: 47947e3af61890ae90d91db956f5c18fd7e0390c4196ea2ace8d12cc4be4abb8ccc3d08dc85f3e3e33a357819df95f41f182997b5f11ee77e53890acd4d9021f
6
+ metadata.gz: 1468b213e31f19f27ec6645535fcc82891173b9580544230bbe9e3c1e573c515c6aa4a54d45cc3ced1b86cd9aa8823143ab619a7e7d6d981ae0a3fab98b9aafd
7
+ data.tar.gz: 708aa920d74f29726325e26f12e770cf6427e3c33c95eaefe8519eab9e793eb98c3ae32f87d843bd8cd2553354f63fa68998620aae68d5cafb3b5a3ba2bb5354
@@ -3,7 +3,6 @@ require_relative 'ol_dump_parser/parser'
3
3
  # Serves as the namespace for the whole gem
4
4
  module OlDumpParser
5
5
  class << self
6
-
7
6
  # Creates a new parser
8
7
  # @param params [Hash{Symbol => String}] Input parameters to parser
9
8
  def new(params)
@@ -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
- p json_output[:details]['name']
33
+ puts json_output[:details]['name'] if verbose
30
34
  output.puts json_output
31
35
  end
32
36
  output.close
@@ -1,3 +1,3 @@
1
1
  module OlDumpParser
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
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.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-03 00:00:00.000000000 Z
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: []