excel_utils 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/excel_utils/version.rb +1 -1
- data/lib/excel_utils/workbook.rb +2 -2
- data/spec/read_spec.rb +6 -0
- data/spec/sample.tmp +0 -0
- data/spec/write_spec.rb +4 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6493c2a06cb2a07929144889ea06b679e97c68b740ef5b18714d702c0f83bc01
|
4
|
+
data.tar.gz: ff567b623fd4e93095288d9d8d74fc23bd0275944628a861837daca10fb06391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b37f20e6f1addcc3ca8f7bacd02d2a64309b9f8399a36a6b6096d73acd111e9de8c601bec278a27bd24541aa899ebbd56d437b47ed88735aec51fd0fa808bfc5
|
7
|
+
data.tar.gz: cd7ea90eb909e3119d59eae7a1a6e4d9c32435906a40df39e8bff946b7f5835af19e51b45ae13efdf02ce8b9fe8072fe4fdd28245a9c671255eed717ae3cf59f
|
data/lib/excel_utils/version.rb
CHANGED
data/lib/excel_utils/workbook.rb
CHANGED
@@ -3,10 +3,10 @@ module ExcelUtils
|
|
3
3
|
|
4
4
|
attr_reader :filename, :normalize_column_names
|
5
5
|
|
6
|
-
def initialize(filename, normalize_column_names: false)
|
6
|
+
def initialize(filename, normalize_column_names: false, extension: nil)
|
7
7
|
@filename = filename
|
8
8
|
@normalize_column_names = normalize_column_names
|
9
|
-
@spreadsheet = Roo::Spreadsheet.open filename
|
9
|
+
@spreadsheet = Roo::Spreadsheet.open filename, extension: extension
|
10
10
|
end
|
11
11
|
|
12
12
|
def sheets
|
data/spec/read_spec.rb
CHANGED
data/spec/sample.tmp
ADDED
Binary file
|
data/spec/write_spec.rb
CHANGED
@@ -12,13 +12,16 @@ describe ExcelUtils do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'Write' do
|
15
|
+
long_url = 'https://external.xx.fbcdn.net/safe_image.php?d=AQCY1f77h1RtuFfa&w=720&h=720&url=https%3A%2F%2Fwww.mercadolibre.com%2Fjms%2Fmla%2Flgz%2Fbackground%2Fsession%2Farmor.c27f26204365785956aaf9b30c289d0d4b0a201b4b01dfc3d83162b82608973be9a82ac85c2097c3f23b522681adca38b143f5e1a10fda251b430051a1592bf19caba204c07179120c48d47a1ceb5a45.774f4b8036d4b909101bab92870d262a%3Fbackground%3Darmor.c27f26204365785956aaf9b30c289d0d4b0a201b4b01dfc3d83162b82608973be9a82ac85c2097c3f23b522681adca38b143f5e1a10fda251b430051a1592bf19caba204c07179120c48d47a1ceb5a45.774f4b8036d4b909101bab92870d262a%26message%3DeyJqc190eXBlIjoianNfY29va2llIiwidmFsdWUiOiJ4In0&cfs=1&_nc_hash=AQB9Sf1HyWCwCVhF'
|
16
|
+
long_text = 'AQCY1f77h1RtuFfa&w=720&h=720&url=https%3A%2F%2Fwww.mercadolibre.com%2Fjms%2Fmla%2Flgz%2Fbackground%2Fsession%2Farmor.c27f26204365785956aaf9b30c289d0d4b0a201b4b01dfc3d83162b82608973be9a82ac85c2097c3f23b522681adca38b143f5e1a10fda251b430051a1592bf19caba204c07179120c48d47a1ceb5a45.774f4b8036d4b909101bab92870d262a%3Fbackground%3Darmor.c27f26204365785956aaf9b30c289d0d4b0a201b4b01dfc3d83162b82608973be9a82ac85c2097c3f23b522681adca38b143f5e1a10fda251b430051a1592bf19caba204c07179120c48d47a1ceb5a45.774f4b8036d4b909101bab92870d262a%26message%3DeyJqc190eXBlIjoianNfY29va2llIiwidmFsdWUiOiJ4In0&cfs=1&_nc_hash=AQB9Sf1HyWCwCVhF'
|
17
|
+
|
15
18
|
data = {
|
16
19
|
'Sheet 1' => [
|
17
20
|
{'column_a' => 1.5, 'column_b' => 'text 1', 'column_c' => DateTime.parse('2019-05-25T16:30:00')},
|
18
21
|
{'column_b' => 'text 2', 'column_c' => Date.parse('2019-07-09'), 'column_a' => 2},
|
19
22
|
],
|
20
23
|
'Sheet 2' => [
|
21
|
-
{'Column A' =>
|
24
|
+
{'Column A' => long_url, 'Column B' => long_text}
|
22
25
|
],
|
23
26
|
'Sheet 3' => []
|
24
27
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excel_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|
@@ -195,6 +195,7 @@ files:
|
|
195
195
|
- spec/coverage_helper.rb
|
196
196
|
- spec/minitest_helper.rb
|
197
197
|
- spec/read_spec.rb
|
198
|
+
- spec/sample.tmp
|
198
199
|
- spec/sample.xls
|
199
200
|
- spec/sample.xlsx
|
200
201
|
- spec/write_spec.rb
|
@@ -225,6 +226,7 @@ test_files:
|
|
225
226
|
- spec/coverage_helper.rb
|
226
227
|
- spec/minitest_helper.rb
|
227
228
|
- spec/read_spec.rb
|
229
|
+
- spec/sample.tmp
|
228
230
|
- spec/sample.xls
|
229
231
|
- spec/sample.xlsx
|
230
232
|
- spec/write_spec.rb
|