spreadsheet 1.2.3 → 1.2.4

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
  SHA1:
3
- metadata.gz: c435d58771950e840768f7ba80cb02acdf98c9e2
4
- data.tar.gz: d994cab59c7ee93edff3e69b40aaf2f7d3a14f68
3
+ metadata.gz: 6e24a126670c29d4c9f3b8bcf8adb5d8d84a2acf
4
+ data.tar.gz: 21a56ac71b43a87259aee264c047b298814bd8d2
5
5
  SHA512:
6
- metadata.gz: 273c89fd7f4eb201c915072ace62ac7a32db7173c708f8f43d09506aa43d3391501c17c716741778e30857e97cfb1ab387f2cd9780ddb38cf7a13df395e99da3
7
- data.tar.gz: b09e354712317e7a17d800ab992c3385e0c466cac0c0eeb3f8ed564966ce684530feca24597f63081be0ac25e13fb5307ffdfc6ba23a30639e06f5f63fa4869b
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] (https://github.com/zdavatz/spreadsheet/blob/master/LICENSE.txt) file.
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 io.respond_to?(:string) && (str = io.string) \
1279
- && str.respond_to?(:force_encoding)
1280
- str.force_encoding 'ASCII-8BIT'
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, {}
@@ -3,5 +3,5 @@
3
3
  module Spreadsheet
4
4
  ##
5
5
  # The version of Spreadsheet you are using.
6
- VERSION = '1.2.3'
6
+ VERSION = '1.2.4'
7
7
  end
@@ -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.3
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-03-12 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-ole