spreadsheet 1.2.1 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d4a92af840a7af1a6640edef4e4e2a290bf8632
4
- data.tar.gz: ea4959a7697ef5b0d8be64d2767ea5bd612b3a48
3
+ metadata.gz: 791f3a7c891c29fee7506b00457311bc4fcc1fe6
4
+ data.tar.gz: bbf63401258ae34e9bcc81fc9bfe479d89d48356
5
5
  SHA512:
6
- metadata.gz: 9ccf4a07cc9c9a246b87558112c76fc6164b63ed19ea2f56b91fad362eaca4cc8364f69379044e599320520953ac423ebb42afcd707489061834d9f0e756b1bb
7
- data.tar.gz: 7515a6058723bf813700c5ec22dc71adba0fb3d3bfcd9e1d0ee7d52d0acb704e7f500276ceb07510d07ff6e39cb5023ad346ea9159e1c2a96879786054beef49
6
+ metadata.gz: bc5be7f5f24bc8f63388765f5eba89166db17406cad72c72c095537e1f7de9e32c8d22c365017eaba1725661c583eb4369bb2500f77046b35996fdfe372e296e
7
+ data.tar.gz: 9d254c82d041143d28f5e2447d230439d040836a7bc6e1014934290c93cfda6921de11b030d5e695784c48b1ef4e6c506737214639695962a6bff98d7ce0c0a2
@@ -2,12 +2,17 @@ language: ruby
2
2
  sudo: false
3
3
  cache: bundler
4
4
  before_install:
5
- - gem install bundler -v 1.17.3 --no-document
5
+ - "if $(ruby -e 'exit(RUBY_VERSION >= \"2.3.0\")'); then env -u RUBYOPT gem update --system; fi"
6
+ - "if $(ruby -e 'exit(RUBY_VERSION >= \"2.3.0\")'); then env -u RUBYOPT gem install bundler --no-document; fi"
7
+ - "if $(ruby -e 'exit(RUBY_VERSION < \"2.3.0\")'); then gem install bundler -v 1.17.3 --no-document; fi"
6
8
  bundler_args: --binstubs
7
9
  script: "bundle exec ruby test/suite.rb"
8
10
  rvm:
9
11
  - ruby-head
10
- - 2.3.3
12
+ - 2.6.1
13
+ - 2.5.3
14
+ - 2.4.5
15
+ - 2.3.8
11
16
  - 2.2.6
12
17
  - 2.1.10
13
18
  - 2.0.0
@@ -21,6 +26,13 @@ rvm:
21
26
  - jruby-18mode
22
27
  - ree
23
28
  matrix:
29
+ include:
30
+ - rvm: 2.4.5
31
+ env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
32
+ - rvm: 2.5.3
33
+ env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
34
+ - rvm: 2.6.1
35
+ env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
24
36
  allow_failures:
25
37
  - rvm: ruby-head
26
38
  - rvm: rbx-19mode
@@ -29,8 +41,11 @@ matrix:
29
41
  - rvm: jruby-19mode
30
42
  - rvm: jruby-18mode
31
43
  - rvm: ree
32
- notifications:
33
- email:
34
- recipients:
35
- - yasaka@ywesee.com
36
- - zdavatz@ywesee.com
44
+ #notifications:
45
+ # email:
46
+ # recipients:
47
+ # - yasaka@ywesee.com
48
+ # - zdavatz@ywesee.com
49
+
50
+ email:
51
+ false # temp
data/Gemfile CHANGED
@@ -1,5 +1,16 @@
1
1
  source "https://rubygems.org"
2
- gem 'ruby-ole'
2
+
3
+ if ENV['USE_LATEST_RUBY_OLE']
4
+ if Dir.exist?('../ruby-ole')
5
+ gem 'ruby-ole', :path => '../ruby-ole'
6
+ else
7
+ gem 'ruby-ole',
8
+ :git => 'https://github.com/taichi-ishitani/ruby-ole.git',
9
+ :branch => 'support_frozen_string_literal'
10
+ end
11
+ else
12
+ gem 'ruby-ole'
13
+ end
3
14
 
4
15
  if RUBY_VERSION.to_f > 2.0
5
16
  gem 'test-unit'
@@ -3,11 +3,11 @@ GEM
3
3
  specs:
4
4
  hoe (3.17.1)
5
5
  rake (>= 0.8, < 13.0)
6
- minitest (5.8.2)
7
- power_assert (0.2.4)
8
- rake (10.5.0)
6
+ minitest (5.10.1)
7
+ power_assert (1.0.1)
8
+ rake (12.3.0)
9
9
  ruby-ole (1.2.12.1)
10
- test-unit (3.1.5)
10
+ test-unit (3.2.3)
11
11
  power_assert
12
12
 
13
13
  PLATFORMS
@@ -20,4 +20,4 @@ DEPENDENCIES
20
20
  test-unit
21
21
 
22
22
  BUNDLED WITH
23
- 1.17.2
23
+ 1.14.6
data/History.md CHANGED
@@ -1,4 +1,14 @@
1
- ### 1.2.1 28.2.2019
1
+ ### 1.2.2 01.03.2019
2
+ Author: taichi <taichi730@gmail.com>
3
+ Date: Fri Mar 1 13:00:28 2019 +0900
4
+
5
+ * fixed unit test errors caused by frozen-string-literal
6
+ * removed ruby 2.3.8 with frozen-string-literal from CI regression
7
+ (It seems that standard libraries for this version does not support the
8
+ feature enough.)
9
+ * enable '--enable-frozen-string-literal' option on CI test
10
+
11
+ ### 1.2.1 28.02.2019
2
12
  Author: taichi <taichi730@gmail.com>
3
13
  Date: Thu Feb 28 10:30:46 2019 +0900
4
14
 
@@ -56,7 +56,7 @@ class Reader
56
56
  ## remove two bits
57
57
  integer, = work.unpack 'V'
58
58
  integer &= 0xfffffffc
59
- value, = ("\0\0\0\0" << [integer].pack('V')).unpack EIGHT_BYTE_DOUBLE
59
+ value, = ("\0\0\0\0" + [integer].pack('V')).unpack EIGHT_BYTE_DOUBLE
60
60
  else
61
61
  ## I can't find a format for unpacking a little endian signed integer.
62
62
  # 'V' works for packing, but not for unpacking. But the following works
@@ -209,7 +209,7 @@ class Workbook < Spreadsheet::Writer
209
209
  oldoffset = positions.min - len
210
210
  lastpos = pos + len
211
211
  bytechange = 0
212
- buffer = StringIO.new ''
212
+ buffer = StringIO.new ''.dup
213
213
  if tuple = workbook.offsets[:sst]
214
214
  write_sst_changes workbook, buffer, writer.pos,
215
215
  sst_total, sst_strings
@@ -396,7 +396,7 @@ class Workbook < Spreadsheet::Writer
396
396
  sanitize_worksheets workbook.worksheets
397
397
  collect_formats workbook
398
398
  sheets = worksheets workbook
399
- buffer1 = StringIO.new ''
399
+ buffer1 = StringIO.new ''.dup
400
400
  # ● BOF Type = workbook globals (➜ 6.8)
401
401
  write_bof workbook, buffer1, :globals
402
402
  # ○ File Protection Block ➜ 4.19
@@ -441,7 +441,7 @@ class Workbook < Spreadsheet::Writer
441
441
  # ○ USESELFS ➜ 5.106
442
442
  buffer1.rewind
443
443
  # ●● BOUNDSHEET ➜ 5.95
444
- buffer2 = StringIO.new ''
444
+ buffer2 = StringIO.new ''.dup
445
445
  # ○ COUNTRY ➜ 5.22
446
446
  # ○ Link Table ➜ 4.10.3
447
447
  # ○○ NAME ➜ 6.66
@@ -20,7 +20,7 @@ class Worksheet
20
20
  def initialize workbook, worksheet
21
21
  @workbook = workbook
22
22
  @worksheet = worksheet
23
- @io = StringIO.new ''
23
+ @io = StringIO.new ''.dup
24
24
  @biff_version = 0x0600
25
25
  @bof = 0x0809
26
26
  @build_id = 3515
@@ -642,7 +642,7 @@ and minimal code that generates this warning. Thanks!
642
642
  ##
643
643
  # Write multiple consecutive cells with RK values (see #write_rk)
644
644
  def write_mulrk row, idx, multiples
645
- fmt = 'v2'
645
+ fmt = ['v2']
646
646
  data = [
647
647
  row.idx, # Index to row
648
648
  idx, # Index to first column (fc)
@@ -655,7 +655,7 @@ and minimal code that generates this warning. Thanks!
655
655
  end
656
656
  # Index to last column (lc)
657
657
  data.push idx + multiples.size - 1
658
- write_op opcode(:mulrk), data.pack(fmt << 'v')
658
+ write_op opcode(:mulrk), data.pack((fmt << 'v').join)
659
659
  end
660
660
  def write_multiples row, idx, multiples
661
661
  case multiples.last
@@ -3,5 +3,5 @@
3
3
  module Spreadsheet
4
4
  ##
5
5
  # The version of Spreadsheet you are using.
6
- VERSION = '1.2.1'
6
+ VERSION = '1.2.2'
7
7
  end
@@ -506,7 +506,7 @@ module Spreadsheet
506
506
  assert_equal 3, sheets.size
507
507
  sheet = book.worksheet 0
508
508
  assert_instance_of Excel::Worksheet, sheet
509
- str = "S\000h\000e\000e\000t\0001\000"
509
+ str = "S\000h\000e\000e\000t\0001\000".dup
510
510
  if RUBY_VERSION >= '1.9'
511
511
  str.force_encoding 'UTF-16LE' if str.respond_to?(:force_encoding)
512
512
  end
@@ -730,7 +730,7 @@ module Spreadsheet
730
730
  book = Spreadsheet::Excel::Workbook.new
731
731
  sheet = book.create_worksheet :name => 'My Worksheet'
732
732
  sheet[0,0] = 'my cell'
733
- data = StringIO.new ''
733
+ data = StringIO.new ''.dup
734
734
  assert_nothing_raised do
735
735
  book.write data
736
736
  end
@@ -829,7 +829,7 @@ module Spreadsheet
829
829
  assert_equal 2, book.worksheets.size
830
830
  sheet = book.worksheets.first
831
831
  assert_instance_of Spreadsheet::Excel::Worksheet, sheet
832
- name = "W\000o\000r\000k\000s\000h\000e\000e\000t\0001\000"
832
+ name = "W\000o\000r\000k\000s\000h\000e\000e\000t\0001\000".dup
833
833
  name.force_encoding 'UTF-16LE' if name.respond_to?(:force_encoding)
834
834
  assert_equal name, sheet.name
835
835
  assert_not_nil sheet.offset
@@ -926,7 +926,7 @@ module Spreadsheet
926
926
  assert_equal 40, sheet1.row(11).height
927
927
  assert_instance_of Spreadsheet::Excel::Worksheet, sheet
928
928
  sheet = book.worksheets.last
929
- name = "m\000y\000 \000n\000a\000m\000e\000"
929
+ name = "m\000y\000 \000n\000a\000m\000e\000".dup
930
930
  name.force_encoding 'UTF-16LE' if name.respond_to?(:force_encoding)
931
931
  assert_equal name, sheet.name
932
932
  assert_not_nil sheet.offset
@@ -1212,7 +1212,7 @@ module Spreadsheet
1212
1212
  sheet = book.create_worksheet
1213
1213
  (0..200).each { |i| sheet.row(i).push "ëçáéíóú" }
1214
1214
  assert_nothing_raised do
1215
- book.write StringIO.new("", "w+")
1215
+ book.write StringIO.new("".dup, "w+")
1216
1216
  end
1217
1217
  end
1218
1218
 
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.1
4
+ version: 1.2.2
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-02-28 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-ole