sheetsy 1.3.0 → 1.3.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: e90c7665d0f2aed22d9e22fe98598c4e93a086cd4062594bc0ae7e2ca159cfbb
4
- data.tar.gz: f9aaf7ffc9bac9bb91415a07c24144e56e841aa3d51d0562ae4b9b229f465ce0
3
+ metadata.gz: 961ad80de96cffaf49ca35df5f2d041c28304f7ada1ca1c8ea615d7165358d33
4
+ data.tar.gz: 31e77af45fafb194cd03d397360f0cb822778fe42dc1a8cdef60fda9f3bf5ae3
5
5
  SHA512:
6
- metadata.gz: 8ae08fab3b426ee42757dcfb87df09cda5d6e5b5eb2ffa4abbba341b4feb1cf9669e967bea5cd4bb10c7e2b815c5949173959a34524a1df57f52f0cad67f45e4
7
- data.tar.gz: 8d00f374dd99771a76091332ea2770cdda613729916ad8c55dc384879aef4d74f9e3961dc59a8db6616e0093e98b63e476931eed2c90b23e133d4de682f70ee8
6
+ metadata.gz: 632ecfa2ce5b8acd1a279f31087ec037a2d0db2d62c1cc07c9f89e39cc1bd36df75c3f1050b8e3c75edd84ed39a923a5ca464bc077bf3451ec2793b46caabe52
7
+ data.tar.gz: ed6813861f014ca1c00c7a5ef04d89c6ccb60f818990fe0a3a75ee60d99493841ad95993adc864945aacb8f55fccb4f5a2fede47431c4d7846e2b89a1b9f50bf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sheetsy (1.3.0)
4
+ sheetsy (1.3.1)
5
5
  rake (~> 13.0)
6
6
  roo
7
7
  rspec (~> 3.0)
@@ -50,8 +50,8 @@ GEM
50
50
  rspec-mocks (3.13.0)
51
51
  diff-lcs (>= 1.2.0, < 2.0)
52
52
  rspec-support (~> 3.13.0)
53
- rspec-support (3.13.0)
54
- rubocop (1.60.2)
53
+ rspec-support (3.13.1)
54
+ rubocop (1.61.0)
55
55
  json (~> 2.3)
56
56
  language_server-protocol (>= 3.17.0)
57
57
  parallel (~> 1.10)
@@ -62,11 +62,11 @@ GEM
62
62
  rubocop-ast (>= 1.30.0, < 2.0)
63
63
  ruby-progressbar (~> 1.7)
64
64
  unicode-display_width (>= 2.4.0, < 3.0)
65
- rubocop-ast (1.30.0)
66
- parser (>= 3.2.1.0)
65
+ rubocop-ast (1.31.1)
66
+ parser (>= 3.3.0.4)
67
67
  ruby-progressbar (1.13.0)
68
68
  rubyzip (2.3.2)
69
- thor (1.3.0)
69
+ thor (1.3.1)
70
70
  unicode-display_width (2.5.0)
71
71
 
72
72
  PLATFORMS
@@ -49,7 +49,7 @@ module Sheetsy
49
49
  progress_bar.log str
50
50
  end
51
51
 
52
- def process_csv(file)
52
+ def process_csv(file) # rubocop:disable Metrics/MethodLength
53
53
  debug "Processing as CSV"
54
54
 
55
55
  output_file_path = File.join(destination, "#{nameify(file)}.json")
@@ -57,12 +57,16 @@ module Sheetsy
57
57
 
58
58
  debug "File #{output_file_path}"
59
59
 
60
- data = CSV.read(file, headers: true).map(&:to_h)
60
+ data = begin
61
+ CSV.read(file, headers: true).map(&:to_h)
62
+ rescue CSV::MalformedCSVError
63
+ CSV.read(file, headers: true, encoding: "iso-8859-1:utf-8").map(&:to_h)
64
+ end
61
65
  write_json(output_file_path, data)
62
66
  debug "Converted #{file} to #{output_file_path}\n\n"
63
67
  end
64
68
 
65
- def process_excel(file)
69
+ def process_excel(file) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
66
70
  debug "Processing as Excel"
67
71
  excel = Roo::Spreadsheet.open(file)
68
72
 
@@ -99,7 +103,7 @@ module Sheetsy
99
103
  process_excel(file)
100
104
  else
101
105
  debug "Unsupported file format: #{file}"
102
- return
106
+ nil
103
107
  end
104
108
  end
105
109
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sheetsy
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheetsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake