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 +4 -4
- data/Gemfile.lock +6 -6
- data/lib/sheetsy/converter.rb +8 -4
- data/lib/sheetsy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 961ad80de96cffaf49ca35df5f2d041c28304f7ada1ca1c8ea615d7165358d33
|
4
|
+
data.tar.gz: 31e77af45fafb194cd03d397360f0cb822778fe42dc1a8cdef60fda9f3bf5ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
54
|
-
rubocop (1.
|
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.
|
66
|
-
parser (>= 3.
|
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.
|
69
|
+
thor (1.3.1)
|
70
70
|
unicode-display_width (2.5.0)
|
71
71
|
|
72
72
|
PLATFORMS
|
data/lib/sheetsy/converter.rb
CHANGED
@@ -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 =
|
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
|
-
|
106
|
+
nil
|
103
107
|
end
|
104
108
|
end
|
105
109
|
|
data/lib/sheetsy/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|