simple-spreadsheet-extractor 0.18.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 928ed7d7088b8fe16a877bb1bed779ffa02503a48a009bcf2ec084c350443629
4
- data.tar.gz: e0f345a7ef579ad5b9068096792127501aced335fe16b73c7e9a169e80b03982
3
+ metadata.gz: c1f09b5a39ba002c7a3c35d18c830ac88d7453a962e615e5a776e5c091edfc50
4
+ data.tar.gz: 8253440c0c1b754d7d9d65d3114c8fc5c11ce543fac6785ba0e06f645b729b36
5
5
  SHA512:
6
- metadata.gz: 3b4d85813f7aa92d0c77b8897ea007de6346d32a5b11629e1d2e123b4758db266ac27279677fdf7fa9acc978a42e0c306b8ea9c121ba60cb093f54cdd3a0bafd
7
- data.tar.gz: c7f88fe40795bb9a91b13cef3eceffe35f20601dc9d1d2a3ab88468468e53c12fe3b5d259cc01e3676d3c01912f2116ad6ce685dd829764cc93e0e99f8c031fe
6
+ metadata.gz: 7fcf27eb87ca55de77bc17062b078411168c0c388360b429ef537bf2fcaa6fc25e01c3d013252d2fa9276794aaa8f634a55903b6b45270dab1a27ccf65f8c8e8
7
+ data.tar.gz: 7a59b952710bc5d6f7846fe76a40cf856fcfacdee07bd1e5006f7ad2465fc637639292227d106cf7f4569aef42408c35d7740f6c57d55a833e7994caf1ba2d9f
@@ -6,7 +6,7 @@ module SysMODB
6
6
 
7
7
  # handles the delegation to java
8
8
  class Extractor
9
- JAR_VERSION = '0.18.0'.freeze
9
+ JAR_VERSION = '0.18.1'.freeze
10
10
  DEFAULT_PATH = File.dirname(__FILE__) + "/../../jars/simple-spreadsheet-extractor-#{JAR_VERSION}.jar"
11
11
 
12
12
  def initialize(memory_allocation)
@@ -38,13 +38,15 @@ module SysMODB
38
38
  end
39
39
  end
40
40
 
41
- def spreadsheet_extractor_command(filepath, format = 'xml', sheet = nil, trim = false)
42
- command = "java -Xmx#{@memory_allocation} -jar #{(defined? SPREADSHEET_EXTRACTOR_JAR_PATH) ? SPREADSHEET_EXTRACTOR_JAR_PATH : DEFAULT_PATH}"
43
- command += " -o #{format}"
44
- command += " -s #{sheet}" if sheet
45
- command += ' -t' if trim
46
- command += " < #{filepath}"
47
- command
41
+ def spreadsheet_extractor_command_line(filepath, format = 'xml', sheet = false, trim = false)
42
+
43
+ args = "-Xmx#{@memory_allocation} -jar #{(defined? SPREADSHEET_EXTRACTOR_JAR_PATH) ? SPREADSHEET_EXTRACTOR_JAR_PATH : DEFAULT_PATH}"
44
+ args += " -o :format"
45
+ args += " -s :sheet" if sheet
46
+ args += ' -t' if trim
47
+ args += " < :filepath"
48
+ args += " 2>:error_log_path"
49
+ Terrapin::CommandLine.new("java", args)
48
50
  end
49
51
 
50
52
  def is_windows?
@@ -52,11 +54,13 @@ module SysMODB
52
54
  end
53
55
 
54
56
  def execute_command_line(filepath, format = 'xml', sheet = nil, trim = false)
55
- command = spreadsheet_extractor_command filepath, format, sheet, trim
56
- begin
57
- Terrapin::CommandLine.new(command).run.strip
58
- rescue Terrapin::ExitStatusError, Terrapin::CommandNotFoundError => e
59
- raise SpreadsheetExtractionException, e.message
57
+ command_line = spreadsheet_extractor_command_line filepath, format, !!sheet, trim
58
+ Tempfile.create('spreadsheet-extraction-error-log') do |f|
59
+ begin
60
+ command_line.run(format: format, sheet: sheet, filepath: filepath, error_log_path: f.path).strip
61
+ rescue Terrapin::ExitStatusError, Terrapin::CommandNotFoundError
62
+ raise SpreadsheetExtractionException, f.read
63
+ end
60
64
  end
61
65
  end
62
66
 
@@ -1,3 +1,3 @@
1
1
  module SysMODB
2
- VERSION = '0.18.0'.freeze
2
+ VERSION = '0.18.1'.freeze
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_dependency('libxml-ruby', '~> 2.9')
23
- spec.add_dependency('terrapin','~>0.6')
23
+ spec.add_dependency('terrapin','~>1.0')
24
24
 
25
25
  spec.add_development_dependency('rubocop','~>1.25')
26
26
  spec.add_development_dependency('rubycritic')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-spreadsheet-extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Owen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-05-22 00:00:00.000000000 Z
13
+ date: 2024-02-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: libxml-ruby
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.6'
35
+ version: '1.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.6'
42
+ version: '1.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rubocop
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ files:
144
144
  - jars/lib/xercesImpl-2.12.2.jar
145
145
  - jars/lib/xml-apis-1.4.01.jar
146
146
  - jars/lib/xmlbeans-5.1.1.jar
147
- - jars/simple-spreadsheet-extractor-0.18.0.jar
147
+ - jars/simple-spreadsheet-extractor-0.18.1.jar
148
148
  - lib/simple-spreadsheet-extractor.rb
149
149
  - lib/sysmodb/extractor.rb
150
150
  - lib/sysmodb/simple-spreadsheet-extractor.rb