spreadsheet 1.2.3 → 1.2.4
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 +4 -4
- data/History.md +7 -0
- data/README.md +1 -1
- data/lib/spreadsheet/excel/reader.rb +4 -4
- data/lib/spreadsheet/version.rb +1 -1
- data/test/excel/reader.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e24a126670c29d4c9f3b8bcf8adb5d8d84a2acf
|
4
|
+
data.tar.gz: 21a56ac71b43a87259aee264c047b298814bd8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83d667da3484477693bb3dc44ff85d8c7332142dc5413e0f5497bb825e690e04731751e86103cb9cb4e5cbb2b3d39a433a90448520fac72f498d405b744433d8
|
7
|
+
data.tar.gz: bc6d0f1778204ad90908e0b243449581482b67bfa446298e14e429fa7478dc5fafe3054656813e54a4c69231abc7f3bf11121f7f3c49bb330ce51bb9352aa1f3
|
data/History.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 1.2.4 24.05.2019
|
2
|
+
Author: Cyril Champier <cyril.champier@doctolib.com>
|
3
|
+
Date: Fri May 24 12:56:52 2019 +0200
|
4
|
+
|
5
|
+
* correct ruby version check
|
6
|
+
* can read frozen string io
|
7
|
+
|
1
8
|
### 1.2.3 12.03.2019
|
2
9
|
Author: taichi <taichi730@gmail.com>
|
3
10
|
Date: Tue Mar 12 22:29:12 2019 +0900
|
data/README.md
CHANGED
@@ -109,5 +109,5 @@ Copyright (c) 2010 ywesee GmbH (mhatakeyama@ywesee.com, zdavatz@ywesee.com)
|
|
109
109
|
## License
|
110
110
|
|
111
111
|
This library is distributed under the GPLv3.
|
112
|
-
Please see the [LICENSE]
|
112
|
+
Please see the [LICENSE](https://github.com/zdavatz/spreadsheet/blob/master/LICENSE.txt) file.
|
113
113
|
|
@@ -1275,11 +1275,11 @@ class Reader
|
|
1275
1275
|
end
|
1276
1276
|
def setup io
|
1277
1277
|
## Reading from StringIO fails without forced encoding
|
1278
|
-
if
|
1279
|
-
|
1280
|
-
|
1278
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.3.0')
|
1279
|
+
io.set_encoding('ASCII-8BIT')
|
1280
|
+
elsif io.respond_to?(:string) && (str = io.string) && str.respond_to?(:force_encoding)
|
1281
|
+
str.force_encoding('ASCII-8BIT')
|
1281
1282
|
end
|
1282
|
-
##
|
1283
1283
|
io.rewind
|
1284
1284
|
@ole = Ole::Storage.open io
|
1285
1285
|
@workbook = Workbook.new io, {}
|
data/lib/spreadsheet/version.rb
CHANGED
data/test/excel/reader.rb
CHANGED
@@ -25,6 +25,19 @@ module Spreadsheet
|
|
25
25
|
reader.setup not_empty_io
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
def test_not_frozen_stream_error_on_setup
|
30
|
+
return if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
|
31
|
+
|
32
|
+
reader = Spreadsheet::Excel::Reader.new
|
33
|
+
data = File.expand_path File.join('test', 'data')
|
34
|
+
path = File.join data, 'test_empty.xls'
|
35
|
+
content_string = File.read path
|
36
|
+
frozen_io = StringIO.new(content_string.freeze)
|
37
|
+
assert_nothing_thrown do
|
38
|
+
reader.setup(frozen_io)
|
39
|
+
end
|
40
|
+
end
|
28
41
|
end
|
29
42
|
end
|
30
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannes F. Wyss, Masaomi Hatakeyama, Zeno R.R. Davatz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-ole
|