writeexcel 1.0.6 → 1.0.7

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
  SHA256:
3
- metadata.gz: aef741d4929e644f22197dc922a779d1049e686bcda4458f8fdd07a1dc6d45a0
4
- data.tar.gz: 7431195b6609b5220f0a72cab8df664594c2ad1a1f2124187fe13515c2dd9d16
3
+ metadata.gz: 210718d145e6c74ec1b4ff8242a80937d3fe3de27815decd8a79856fa2f6ae73
4
+ data.tar.gz: 3ba1e17f91c2093e715cdb14964814cf67adad44890dd8286aac3e1568a09a6b
5
5
  SHA512:
6
- metadata.gz: ced7ba9cea632a819acd69fd242a03939abd331eca99f3ff2604ea8429998fd467ee795bbbbef5a6ce1b3f66ed970b57583f6d0c85f9aefc311247aaba39c5ae
7
- data.tar.gz: 38955288d47faa5dc1ec3b8aad5960b0bcac352b61c8503b975eb1c0446ae41785a306b84952797883621cc38f241a9e3343b364f5b8060abee869221fbff1aa
6
+ metadata.gz: 28357fc96e5c28bf45924743c758111deb2e8ca5386dcd8efcbd1fdabcae277a8d3756c21d2e9b6b454f10558f9615d28c1b77ef25c8cda3d9335bd24d027c9a
7
+ data.tar.gz: 36c16f58a152fbfd64d1cd4af38bbdf5a9bccf77962da6cc5436fb70a080bc164e1178ebf0a70296c96232c3143ce775cb74ed31698e4ca2f49d8fc4e884335d
@@ -0,0 +1,26 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: test-suite
9
+
10
+ on: [push, pull_request]
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-20.04
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [3.3, 3.2, 3.1, '3.0', 2.7, 2.6, 2.5, 2.4]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+ - uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby }}
25
+ bundler-cache: true
26
+ - run: bundle exec rake
data/README.rdoc CHANGED
@@ -85,6 +85,10 @@ Example Code:
85
85
  * and ......
86
86
 
87
87
  == Recent Change
88
+ v1.0.7
89
+ * support Ruby 3.3
90
+ * support Ruby 2.4 or later
91
+
88
92
  v1.0.6
89
93
  * support Ruby 3.2
90
94
  * use minitest gem instead of test-unit.
@@ -112,8 +116,8 @@ v1.0.0
112
116
 
113
117
  Original was written in Perl by John McNamara (jmcnamara@cpan.org).
114
118
 
115
- Convert to ruby by Hideo Nakamura (cxn03651@msj.biglobe.ne.jp)
116
- Copyright (c) 2009-2014 Hideo NAKAMURA. See LICENSE.txt for details.
119
+ Convert to ruby by Hideo Nakamura (nakamura.hideo@gmail.com)
120
+ Copyright (c) 2009-2024 Hideo NAKAMURA. See LICENSE.txt for details.
117
121
 
118
122
  == License
119
123
 
@@ -6,6 +6,7 @@ class Worksheet < BIFFWriter
6
6
 
7
7
  def initialize(worksheet)
8
8
  @worksheet = worksheet
9
+ @row_min = @row_max = @col_min = @col_max = nil
9
10
  end
10
11
 
11
12
  def increment_row_max
@@ -6,6 +6,7 @@ class Worksheet < BIFFWriter
6
6
  class Collection
7
7
  def initialize
8
8
  @items = {}
9
+ @array = nil
9
10
  end
10
11
 
11
12
  def <<(item)
@@ -6,7 +6,7 @@
6
6
  # from Racc grammer file "".
7
7
  #
8
8
 
9
- require 'racc/parser.rb'
9
+ require 'racc/parser'
10
10
  class ExcelFormulaParser < Racc::Parser # :nodoc:
11
11
  ##### State transition tables begin ###
12
12
 
@@ -1,5 +1,3 @@
1
- require 'writeexcel'
2
-
3
- class WriteExcel < Workbook
4
- VERSION = "1.0.6"
1
+ module Writeexcel
2
+ VERSION = "1.0.7"
5
3
  end
@@ -14,20 +14,9 @@
14
14
  #
15
15
  require 'nkf'
16
16
  require 'forwardable'
17
- require 'writeexcel/biffwriter'
18
- require 'writeexcel/worksheet'
19
- require 'writeexcel/chart'
20
- require 'writeexcel/format'
21
- require 'writeexcel/formula'
22
- require 'writeexcel/olewriter'
23
- require 'writeexcel/storage_lite'
24
- require 'writeexcel/compatibility'
25
17
  require 'writeexcel/shared_string_table'
26
- require 'writeexcel/worksheets'
27
18
 
28
19
  class Workbook < BIFFWriter
29
- require 'writeexcel/properties'
30
- require 'writeexcel/helper'
31
20
 
32
21
  extend Forwardable
33
22
 
@@ -116,6 +105,7 @@ class Workbook < BIFFWriter
116
105
  @localtime = Time.now
117
106
 
118
107
  @defined_names = []
108
+ @fileclosed = nil
119
109
 
120
110
  setup_built_in_formats(default_formats)
121
111
 
@@ -103,6 +103,7 @@ class Worksheet < BIFFWriter
103
103
  @title_range = TitleRange.new(self)
104
104
  @print_range = PrintRange.new(self)
105
105
 
106
+ @print_headers = 0
106
107
  @print_gridlines = 1
107
108
  @screen_gridlines = 1
108
109
 
@@ -155,6 +156,18 @@ class Worksheet < BIFFWriter
155
156
 
156
157
  @table = []
157
158
  @row_data = {}
159
+ @header = ''
160
+ @header_encoding = nil
161
+ @footer = ''
162
+ @footer_encoding = nil
163
+ @hidden = nil
164
+ @selected = nil
165
+ @protect = nil
166
+ @hcenter = nil
167
+ @vcenter = nil
168
+ @display_arabic = nil
169
+ @frozen = nil
170
+ @hide_zeros = nil
158
171
  end
159
172
 
160
173
  #
@@ -353,8 +366,8 @@ class Worksheet < BIFFWriter
353
366
  # worksheet2.activate
354
367
  # worksheet1.hide
355
368
  #
356
- def hide
357
- @hidden = true
369
+ def hide(hidden = :hidden)
370
+ @hidden = hidden
358
371
 
359
372
  # A hidden worksheet shouldn't be active or selected.
360
373
  @selected = false
@@ -673,7 +686,7 @@ class Worksheet < BIFFWriter
673
686
  #
674
687
  def set_column(*args)
675
688
  # Check for a cell reference in A1 notation and substitute row and column
676
- if args[0].respond_to?(:=~) && args[0] =~ /^\D/
689
+ if args[0].respond_to?(:match) && args[0] =~ /^\D/
677
690
  array = substitute_cellref(*args)
678
691
  firstcol = array[1]
679
692
  lastcol = array[3]
@@ -963,11 +976,11 @@ class Worksheet < BIFFWriter
963
976
  format = args[5]
964
977
  encoding = args[6] ? 1 : 0
965
978
 
966
- merge_range_core(rwFirst, colFirst, rwLast, colLast, string, format, encoding) do |rwFirst, colFirst, string, format, encoding|
967
- if encoding != 0
968
- write_utf16be_string(rwFirst, colFirst, string, format)
979
+ merge_range_core(rwFirst, colFirst, rwLast, colLast, string, format, encoding) do |_rwFirst, _colFirst, _string, _format, _encoding|
980
+ if _encoding != 0
981
+ write_utf16be_string(_rwFirst, _colFirst, _string, _format)
969
982
  else
970
- write(rwFirst, colFirst, string, format)
983
+ write(_rwFirst, _colFirst, _string, _format)
971
984
  end
972
985
  end
973
986
  end
@@ -994,8 +1007,8 @@ class Worksheet < BIFFWriter
994
1007
  format = args[5]
995
1008
  encoding = nil
996
1009
 
997
- merge_range_core(rwFirst, colFirst, rwLast, colLast, string, format, encoding) do |rwFirst, colFirst, string, format, encoding|
998
- write_date_time(rwFirst, colFirst, string, format)
1010
+ merge_range_core(rwFirst, colFirst, rwLast, colLast, string, format, encoding) do |_rwFirst, _colFirst, _string, _format, _encoding|
1011
+ write_date_time(_rwFirst, _colFirst, _string, _format)
999
1012
  end
1000
1013
  end
1001
1014
 
@@ -2227,7 +2240,7 @@ class Worksheet < BIFFWriter
2227
2240
  match = eval("#{sub} self, args")
2228
2241
  return match if match
2229
2242
  end
2230
- end if token.respond_to?(:=~)
2243
+ end if token.respond_to?(:match)
2231
2244
 
2232
2245
  # Match an array ref.
2233
2246
  if token.respond_to?(:to_ary)
@@ -2235,16 +2248,16 @@ class Worksheet < BIFFWriter
2235
2248
  elsif token.respond_to?(:coerce) # Numeric
2236
2249
  write_number(*args)
2237
2250
  # Match http, https or ftp URL
2238
- elsif token.respond_to?(:=~) && token =~ %r|^[fh]tt?ps?://|
2251
+ elsif token.respond_to?(:match) && token =~ %r|^[fh]tt?ps?://|
2239
2252
  write_url(*args)
2240
2253
  # Match mailto:
2241
- elsif token.respond_to?(:=~) && token =~ %r|^mailto:|
2254
+ elsif token.respond_to?(:match) && token =~ %r|^mailto:|
2242
2255
  write_url(*args)
2243
2256
  # Match internal or external sheet link
2244
- elsif token.respond_to?(:=~) && token =~ %r!^(?:in|ex)ternal:!
2257
+ elsif token.respond_to?(:match) && token =~ %r!^(?:in|ex)ternal:!
2245
2258
  write_url(*args)
2246
2259
  # Match formula
2247
- elsif token.respond_to?(:=~) && token =~ /^=/
2260
+ elsif token.respond_to?(:match) && token =~ /^=/
2248
2261
  write_formula(*args)
2249
2262
  # Match blank
2250
2263
  elsif token == ''
@@ -4313,7 +4326,7 @@ class Worksheet < BIFFWriter
4313
4326
  end
4314
4327
 
4315
4328
  def hidden? # :nodoc:
4316
- @hidden
4329
+ @hidden == :hidden
4317
4330
  end
4318
4331
 
4319
4332
  def hidden=(val) # :nodoc:
@@ -4941,31 +4954,27 @@ class Worksheet < BIFFWriter
4941
4954
  def substitute_cellref(cell, *args) #:nodoc:
4942
4955
  return [cell, *args] if cell.respond_to?(:coerce) # Numeric
4943
4956
 
4944
- cell.upcase!
4957
+ normalized_cell = cell.upcase
4945
4958
 
4959
+ case normalized_cell
4946
4960
  # Convert a column range: 'A:A' or 'B:G'.
4947
4961
  # A range such as A:A is equivalent to A1:65536, so add rows as required
4948
- if cell =~ /\$?([A-I]?[A-Z]):\$?([A-I]?[A-Z])/
4962
+ when /\$?([A-I]?[A-Z]):\$?([A-I]?[A-Z])/
4949
4963
  row1, col1 = cell_to_rowcol($1 + '1')
4950
4964
  row2, col2 = cell_to_rowcol($2 + '65536')
4951
4965
  return [row1, col1, row2, col2, *args]
4952
- end
4953
-
4954
4966
  # Convert a cell range: 'A1:B7'
4955
- if cell =~ /\$?([A-I]?[A-Z]\$?\d+):\$?([A-I]?[A-Z]\$?\d+)/
4967
+ when /\$?([A-I]?[A-Z]\$?\d+):\$?([A-I]?[A-Z]\$?\d+)/
4956
4968
  row1, col1 = cell_to_rowcol($1)
4957
4969
  row2, col2 = cell_to_rowcol($2)
4958
4970
  return [row1, col1, row2, col2, *args]
4959
- end
4960
-
4961
4971
  # Convert a cell reference: 'A1' or 'AD2000'
4962
- if (cell =~ /\$?([A-I]?[A-Z]\$?\d+)/)
4972
+ when /\$?([A-I]?[A-Z]\$?\d+)/
4963
4973
  row1, col1 = cell_to_rowcol($1)
4964
4974
  return [row1, col1, *args]
4965
-
4975
+ else
4976
+ raise("Unknown cell reference #{normalized_cell}")
4966
4977
  end
4967
-
4968
- raise("Unknown cell reference #{cell}")
4969
4978
  end
4970
4979
 
4971
4980
  #
@@ -6958,7 +6967,7 @@ class Worksheet < BIFFWriter
6958
6967
  # ruby 3.2 no longer handles =~ for various types
6959
6968
  return args unless args[0].respond_to?(:=~)
6960
6969
 
6961
- if args[0] =~ /^\D/
6970
+ if args[0].respond_to?(:match) && args[0] =~ /^\D/
6962
6971
  substitute_cellref(*args)
6963
6972
  else
6964
6973
  args
@@ -1,6 +1,4 @@
1
1
  class Workbook < BIFFWriter
2
- require 'writeexcel/properties'
3
- require 'writeexcel/helper'
4
2
 
5
3
  class Worksheets < Array
6
4
  attr_accessor :activesheet
@@ -8,6 +6,7 @@ class Workbook < BIFFWriter
8
6
 
9
7
  def initialize
10
8
  @activesheet = nil
9
+ @firstsheet = nil
11
10
  end
12
11
 
13
12
  def activesheet_index
data/lib/writeexcel.rb CHANGED
@@ -10,12 +10,13 @@
10
10
  # original written in Perl by John McNamara
11
11
  # converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
12
12
  #
13
+ require 'writeexcel/version'
13
14
  require 'writeexcel/biffwriter'
14
15
  require 'writeexcel/olewriter'
15
16
  require 'writeexcel/formula'
16
17
  require 'writeexcel/format'
17
- require 'writeexcel/worksheet'
18
- require "writeexcel/workbook"
18
+ require 'writeexcel/worksheets'
19
+ require 'writeexcel/workbook'
19
20
  require 'writeexcel/chart'
20
21
  require 'writeexcel/charts/area'
21
22
  require 'writeexcel/charts/bar'
@@ -1153,7 +1154,4 @@ require 'writeexcel/debug_info'
1153
1154
  # 12 until another chart with the title set is viewed.
1154
1155
  #
1155
1156
  class WriteExcel < Workbook
1156
- if RUBY_VERSION < '1.9'
1157
- $KCODE = 'u'
1158
- end
1159
1157
  end
@@ -25,11 +25,11 @@ class TC_dimensions < Minitest::Test
25
25
  end
26
26
 
27
27
  def teardown
28
- if @workbook.instance_variable_get(:@filehandle)
29
- @workbook.instance_variable_get(:@filehandle).close(true)
28
+ if @workbook.instance_variable_get("@filehandle")
29
+ @workbook.instance_variable_get("@filehandle").close(true)
30
30
  end
31
- if @worksheet.instance_variable_get(:@filehandle)
32
- @worksheet.instance_variable_get(:@filehandle).close(true)
31
+ if @worksheet.instance_variable_get("@filehandle")
32
+ @worksheet.instance_variable_get("@filehandle").close(true)
33
33
  end
34
34
  end
35
35
 
data/test/test_05_rows.rb CHANGED
@@ -20,25 +20,22 @@ class TC_rows < Minitest::Test
20
20
  end
21
21
 
22
22
  def teardown
23
- if @workbook.instance_variable_get(:@filehandle)
24
- @workbook.instance_variable_get(:@filehandle).close(true)
25
- end
26
- if @worksheet.instance_variable_get(:@filehandle)
27
- @worksheet.instance_variable_get(:@filehandle).close(true)
23
+ if @workbook.instance_variable_get("@filehandle")
24
+ @workbook.instance_variable_get("@filehandle").close(true)
28
25
  end
29
26
  end
30
27
 
31
28
  def test_1
32
29
  file = StringIO.new
33
- workbook = WriteExcel.new(file)
34
- workbook.compatibility_mode(1)
30
+ @workbook = WriteExcel.new(file)
31
+ @workbook.compatibility_mode(1)
35
32
  @tests = []
36
33
 
37
34
  # for test case 1
38
35
  row = 1
39
36
  col1 = 0
40
37
  col2 = 0
41
- worksheet = workbook.add_worksheet
38
+ worksheet = @workbook.add_worksheet
42
39
  worksheet.set_row(row, 15)
43
40
  @tests.push(
44
41
  [
@@ -54,7 +51,7 @@ class TC_rows < Minitest::Test
54
51
  row = 2
55
52
  col1 = 0
56
53
  col2 = 0
57
- worksheet = workbook.add_worksheet
54
+ worksheet = @workbook.add_worksheet
58
55
  worksheet.write(row, col1, 'Test')
59
56
  worksheet.write(row, col2, 'Test')
60
57
  @tests.push(
@@ -72,7 +69,7 @@ class TC_rows < Minitest::Test
72
69
  row = 3
73
70
  col1 = 0
74
71
  col2 = 1
75
- worksheet = workbook.add_worksheet
72
+ worksheet = @workbook.add_worksheet
76
73
  worksheet.write(row, col1, 'Test')
77
74
  worksheet.write(row, col2, 'Test')
78
75
  @tests.push(
@@ -89,7 +86,7 @@ class TC_rows < Minitest::Test
89
86
  row = 4
90
87
  col1 = 1
91
88
  col2 = 1
92
- worksheet = workbook.add_worksheet
89
+ worksheet = @workbook.add_worksheet
93
90
  worksheet.write(row, col1, 'Test')
94
91
  worksheet.write(row, col2, 'Test')
95
92
  @tests.push(
@@ -106,7 +103,7 @@ class TC_rows < Minitest::Test
106
103
  row = 5
107
104
  col1 = 1
108
105
  col2 = 255
109
- worksheet = workbook.add_worksheet
106
+ worksheet = @workbook.add_worksheet
110
107
  worksheet.write(row, col1, 'Test')
111
108
  worksheet.write(row, col2, 'Test')
112
109
  @tests.push(
@@ -123,7 +120,7 @@ class TC_rows < Minitest::Test
123
120
  row = 6
124
121
  col1 = 255
125
122
  col2 = 255
126
- worksheet = workbook.add_worksheet
123
+ worksheet = @workbook.add_worksheet
127
124
  worksheet.write(row, col1, 'Test')
128
125
  worksheet.write(row, col2, 'Test')
129
126
  @tests.push(
@@ -140,7 +137,7 @@ class TC_rows < Minitest::Test
140
137
  row = 7
141
138
  col1 = 2
142
139
  col2 = 9
143
- worksheet = workbook.add_worksheet
140
+ worksheet = @workbook.add_worksheet
144
141
  worksheet.set_row(row, 15)
145
142
  worksheet.write(row, col1, 'Test')
146
143
  worksheet.write(row, col2, 'Test')
@@ -154,8 +151,8 @@ class TC_rows < Minitest::Test
154
151
  ]
155
152
  )
156
153
 
157
- workbook.biff_only = 1
158
- workbook.close
154
+ @workbook.biff_only = 1
155
+ @workbook.close
159
156
  # Read in the row records
160
157
  rows = []
161
158
 
@@ -56,27 +56,24 @@ class TC_extsst < Minitest::Test
56
56
  end
57
57
 
58
58
  def teardown
59
- if @workbook.instance_variable_get(:@filehandle)
60
- @workbook.instance_variable_get(:@filehandle).close(true)
61
- end
62
- if @worksheet.instance_variable_get(:@filehandle)
63
- @worksheet.instance_variable_get(:@filehandle).close(true)
59
+ if @workbook.instance_variable_get("@filehandle")
60
+ @workbook.instance_variable_get("@filehandle").close(true)
64
61
  end
65
62
  end
66
63
 
67
64
  def test_to_tests
68
65
  @tests.each do |test|
69
66
  io = StringIO.new
70
- workbook = WriteExcel.new(io)
71
- workbook.not_using_tmpfile
67
+ @workbook = WriteExcel.new(io)
68
+ @workbook.not_using_tmpfile
72
69
 
73
70
  str_unique = test[0]
74
71
 
75
- workbook.__send__("calculate_extsst_size", str_unique)
72
+ @workbook.__send__("calculate_extsst_size", str_unique)
76
73
 
77
- assert_equal(test[1], workbook.extsst_buckets,
74
+ assert_equal(test[1], @workbook.extsst_buckets,
78
75
  " \tBucket number for #{str_unique} strings")
79
- assert_equal(test[2], workbook.extsst_bucket_size,
76
+ assert_equal(test[2], @workbook.extsst_bucket_size,
80
77
  " \tBucket size for #{str_unique} strings")
81
78
  end
82
79
  end
@@ -30,11 +30,11 @@ class TC_escher < Minitest::Test
30
30
  end
31
31
 
32
32
  def teardown
33
- if @workbook.instance_variable_get(:@filehandle)
34
- @workbook.instance_variable_get(:@filehandle).close(true)
33
+ if @workbook.instance_variable_get("@filehandle")
34
+ @workbook.instance_variable_get("@filehandle").close(true)
35
35
  end
36
- if @worksheet.instance_variable_get(:@filehandle)
37
- @worksheet.instance_variable_get(:@filehandle).close(true)
36
+ if @worksheet.instance_variable_get("@filehandle")
37
+ @worksheet.instance_variable_get("@filehandle").close(true)
38
38
  end
39
39
  end
40
40
 
@@ -33,11 +33,8 @@ class TC_mso_drawing_group < Minitest::Test
33
33
  end
34
34
 
35
35
  def teardown
36
- if @workbook.instance_variable_get(:@filehandle)
37
- @workbook.instance_variable_get(:@filehandle).close(true)
38
- end
39
- if @worksheet.instance_variable_get(:@filehandle)
40
- @worksheet.instance_variable_get(:@filehandle).close(true)
36
+ if @workbook.instance_variable_get("@filehandle")
37
+ @workbook.instance_variable_get("@filehandle").close(true)
41
38
  end
42
39
  end
43
40
 
@@ -49,7 +46,7 @@ class TC_mso_drawing_group < Minitest::Test
49
46
  end
50
47
  @workbook.calc_mso_sizes
51
48
 
52
- caption = sprintf(" \tSheet1: %4d comments.", count)
49
+ #caption = sprintf(" \tSheet1: %4d comments.", count)
53
50
  target = %w(
54
51
  EB 00 5A 00 0F 00 00 F0 52 00 00 00 00 00 06 F0
55
52
  18 00 00 00 02 04 00 00 02 00 00 00 02 00 00 00
@@ -63,7 +60,7 @@ class TC_mso_drawing_group < Minitest::Test
63
60
 
64
61
 
65
62
  # Test the parameters pass to the worksheets
66
- caption += ' (params)'
63
+ #caption += ' (params)'
67
64
  result_ids = []
68
65
  target_ids = [
69
66
  1024, 1, 2, 1025,
@@ -92,13 +89,13 @@ class TC_mso_drawing_group < Minitest::Test
92
89
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
93
90
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
94
91
  ).join(' ')
95
- caption = sprintf( " \tSheet1: %4d comments.", count)
92
+ #caption = sprintf( " \tSheet1: %4d comments.", count)
96
93
  result = unpack_record(@workbook.add_mso_drawing_group)
97
94
  assert_equal(target, result, caption)
98
95
 
99
96
 
100
97
  # Test the parameters pass to the worksheets
101
- caption += ' (params)'
98
+ #caption += ' (params)'
102
99
  result_ids = []
103
100
  target_ids = [
104
101
  1024, 1, 3, 1026,
@@ -126,13 +123,13 @@ class TC_mso_drawing_group < Minitest::Test
126
123
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
127
124
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
128
125
  ).join(' ')
129
- caption = sprintf( " \tSheet1: %4d comments.", count)
126
+ #caption = sprintf( " \tSheet1: %4d comments.", count)
130
127
  result = unpack_record(@workbook.add_mso_drawing_group)
131
128
  assert_equal(target, result, caption)
132
129
 
133
130
 
134
131
  # Test the parameters pass to the worksheets
135
- caption += ' (params)'
132
+ #caption += ' (params)'
136
133
  result_ids = []
137
134
  target_ids = [
138
135
  1024, 1, 4, 1027
@@ -160,13 +157,13 @@ class TC_mso_drawing_group < Minitest::Test
160
157
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
161
158
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
162
159
  ).join(' ')
163
- caption = sprintf( " \tSheet1: %4d comments.", count)
160
+ #caption = sprintf( " \tSheet1: %4d comments.", count)
164
161
  result = unpack_record(@workbook.add_mso_drawing_group)
165
162
  assert_equal(target, result, caption)
166
163
 
167
164
 
168
165
  # Test the parameters pass to the worksheets
169
- caption += ' (params)'
166
+ #caption += ' (params)'
170
167
  result_ids = []
171
168
  target_ids = [
172
169
  1024, 1, 1024, 2047
@@ -195,13 +192,13 @@ class TC_mso_drawing_group < Minitest::Test
195
192
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
196
193
  00 08 F7 00 00 10
197
194
  ).join(' ')
198
- caption = sprintf( " \tSheet1: %4d comments.", count)
195
+ #caption = sprintf( " \tSheet1: %4d comments.", count)
199
196
  result = unpack_record(@workbook.add_mso_drawing_group)
200
197
  assert_equal(target, result, caption)
201
198
 
202
199
 
203
200
  # Test the parameters pass to the worksheets
204
- caption += ' (params)'
201
+ #caption += ' (params)'
205
202
  result_ids = []
206
203
  target_ids = [
207
204
  1024, 1, 1025, 2048
@@ -230,13 +227,13 @@ class TC_mso_drawing_group < Minitest::Test
230
227
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
231
228
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
232
229
  ).join(' ')
233
- caption = sprintf( " \tSheet1: %4d comments.", count)
230
+ #caption = sprintf( " \tSheet1: %4d comments.", count)
234
231
  result = unpack_record(@workbook.add_mso_drawing_group)
235
232
  assert_equal(target, result, caption)
236
233
 
237
234
 
238
235
  # Test the parameters pass to the worksheets
239
- caption += ' (params)'
236
+ #caption += ' (params)'
240
237
  result_ids = []
241
238
  target_ids = [
242
239
  1024, 1, 2049, 3072
@@ -269,14 +266,14 @@ class TC_mso_drawing_group < Minitest::Test
269
266
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
270
267
  00 08 F7 00 00 10
271
268
  ).join(' ')
272
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
269
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
273
270
  count1, count2)
274
271
  result = unpack_record(@workbook.add_mso_drawing_group)
275
272
  assert_equal(target, result, caption)
276
273
 
277
274
 
278
275
  # Test the parameters pass to the worksheets
279
- caption += ' (params)'
276
+ #caption += ' (params)'
280
277
  result_ids = []
281
278
  target_ids = [
282
279
  1024, 1, 2, 1025,
@@ -310,14 +307,14 @@ class TC_mso_drawing_group < Minitest::Test
310
307
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
311
308
  00 08 F7 00 00 10
312
309
  ).join(' ')
313
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
310
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
314
311
  count1, count2)
315
312
  result = unpack_record(@workbook.add_mso_drawing_group)
316
313
  assert_equal(target, result, caption)
317
314
 
318
315
 
319
316
  # Test the parameters pass to the worksheets
320
- caption += ' (params)'
317
+ #caption += ' (params)'
321
318
  result_ids = []
322
319
  target_ids = [
323
320
  1024, 1, 3, 1026,
@@ -351,14 +348,14 @@ class TC_mso_drawing_group < Minitest::Test
351
348
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
352
349
  00 08 F7 00 00 10
353
350
  ).join(' ')
354
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
351
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
355
352
  count1, count2)
356
353
  result = unpack_record(@workbook.add_mso_drawing_group)
357
354
  assert_equal(target, result, caption)
358
355
 
359
356
 
360
357
  # Test the parameters pass to the worksheets
361
- caption += ' (params)'
358
+ #caption += ' (params)'
362
359
  result_ids = []
363
360
  target_ids = [
364
361
  1024, 1, 1024, 2047,
@@ -392,14 +389,14 @@ class TC_mso_drawing_group < Minitest::Test
392
389
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
393
390
  00 08 F7 00 00 10
394
391
  ).join(' ')
395
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
392
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
396
393
  count1, count2)
397
394
  result = unpack_record(@workbook.add_mso_drawing_group)
398
395
  assert_equal(target, result, caption)
399
396
 
400
397
 
401
398
  # Test the parameters pass to the worksheets
402
- caption += ' (params)'
399
+ #caption += ' (params)'
403
400
  result_ids = []
404
401
  target_ids = [
405
402
  1024, 1, 1024, 2047,
@@ -434,14 +431,14 @@ class TC_mso_drawing_group < Minitest::Test
434
431
  1E F1 10 00 00 00 0D 00 00 08 0C 00 00 08 17 00
435
432
  00 08 F7 00 00 10
436
433
  ).join(' ')
437
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
434
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
438
435
  count1, count2)
439
436
  result = unpack_record(@workbook.add_mso_drawing_group)
440
437
  assert_equal(target, result, caption)
441
438
 
442
439
 
443
440
  # Test the parameters pass to the worksheets
444
- caption += ' (params)'
441
+ #caption += ' (params)'
445
442
  result_ids = []
446
443
  target_ids = [
447
444
  1024, 1, 1025, 2048,
@@ -475,14 +472,14 @@ class TC_mso_drawing_group < Minitest::Test
475
472
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
476
473
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
477
474
  ).join(' ')
478
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
475
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments..",
479
476
  count1, count2)
480
477
  result = unpack_record(@workbook.add_mso_drawing_group)
481
478
  assert_equal(target, result, caption)
482
479
 
483
480
 
484
481
  # Test the parameters pass to the worksheets
485
- caption += ' (params)'
482
+ #caption += ' (params)'
486
483
  result_ids = []
487
484
  target_ids = [
488
485
  1024, 1, 1025, 2048,
@@ -520,14 +517,14 @@ class TC_mso_drawing_group < Minitest::Test
520
517
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
521
518
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
522
519
  ).join(' ')
523
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
520
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
524
521
  "Sheet3: %4d comments.", count1, count2, count3)
525
522
  result = unpack_record(@workbook.add_mso_drawing_group)
526
523
  assert_equal(target, result, caption)
527
524
 
528
525
 
529
526
  # Test the parameters pass to the worksheets
530
- caption += ' (params)'
527
+ #caption += ' (params)'
531
528
  result_ids = []
532
529
  target_ids = [
533
530
  1024, 1, 1024, 2047,
@@ -566,14 +563,14 @@ class TC_mso_drawing_group < Minitest::Test
566
563
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
567
564
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
568
565
  ).join(' ')
569
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
566
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
570
567
  "Sheet3: %4d comments.", count1, count2, count3)
571
568
  result = unpack_record(@workbook.add_mso_drawing_group)
572
569
  assert_equal(target, result, caption)
573
570
 
574
571
 
575
572
  # Test the parameters pass to the worksheets
576
- caption += ' (params)'
573
+ #caption += ' (params)'
577
574
  result_ids = []
578
575
  target_ids = [
579
576
  1024, 1, 1024, 2047,
@@ -613,14 +610,14 @@ class TC_mso_drawing_group < Minitest::Test
613
610
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
614
611
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
615
612
  ).join(' ')
616
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
613
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
617
614
  "Sheet3: %4d comments.", count1, count2, count3)
618
615
  result = unpack_record(@workbook.add_mso_drawing_group)
619
616
  assert_equal(target, result, caption)
620
617
 
621
618
 
622
619
  # Test the parameters pass to the worksheets
623
- caption += ' (params)'
620
+ #caption += ' (params)'
624
621
  result_ids = []
625
622
  target_ids = [
626
623
  1024, 1, 1025, 2048,
@@ -660,14 +657,14 @@ class TC_mso_drawing_group < Minitest::Test
660
657
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
661
658
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
662
659
  ).join(' ')
663
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
660
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
664
661
  "Sheet3: %4d comments.", count1, count2, count3)
665
662
  result = unpack_record(@workbook.add_mso_drawing_group)
666
663
  assert_equal(target, result, caption)
667
664
 
668
665
 
669
666
  # Test the parameters pass to the worksheets
670
- caption += ' (params)'
667
+ #caption += ' (params)'
671
668
  result_ids = []
672
669
  target_ids = [
673
670
  1024, 1, 1025, 2048,
@@ -717,14 +714,14 @@ class TC_mso_drawing_group < Minitest::Test
717
714
  C0 01 40 00 00 08 40 00 1E F1 10 00 00 00 0D 00
718
715
  00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
719
716
  ).join(' ')
720
- caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
717
+ #caption = sprintf( " \tSheet1: %4d comments, Sheet2: %4d comments,"+
721
718
  "Sheet3: %4d comments.", count1, count2, count3)
722
719
  result = unpack_record(@workbook.add_mso_drawing_group)
723
720
  assert_equal(target, result, caption)
724
721
 
725
722
 
726
723
  # Test the parameters pass to the worksheets
727
- caption += ' (params)'
724
+ #caption += ' (params)'
728
725
  result_ids = []
729
726
  target_ids = [
730
727
  1024, 1, 1025, 2048,
data/test/test_23_note.rb CHANGED
@@ -22,11 +22,11 @@ class TC_note < Minitest::Test
22
22
  end
23
23
 
24
24
  def teardown
25
- if @workbook.instance_variable_get(:@filehandle)
26
- @workbook.instance_variable_get(:@filehandle).close(true)
25
+ if @workbook.instance_variable_get("@filehandle")
26
+ @workbook.instance_variable_get("@filehandle").close(true)
27
27
  end
28
- if @worksheet.instance_variable_get(:@filehandle)
29
- @worksheet.instance_variable_get(:@filehandle).close(true)
28
+ if @worksheet.instance_variable_get("@filehandle")
29
+ @worksheet.instance_variable_get("@filehandle").close(true)
30
30
  end
31
31
  end
32
32
 
data/test/test_24_txo.rb CHANGED
@@ -22,11 +22,11 @@ class TC_txo < Minitest::Test
22
22
  end
23
23
 
24
24
  def teardown
25
- if @workbook.instance_variable_get(:@filehandle)
26
- @workbook.instance_variable_get(:@filehandle).close(true)
25
+ if @workbook.instance_variable_get("@filehandle")
26
+ @workbook.instance_variable_get("@filehandle").close(true)
27
27
  end
28
- if @worksheet.instance_variable_get(:@filehandle)
29
- @worksheet.instance_variable_get(:@filehandle).close(true)
28
+ if @worksheet.instance_variable_get("@filehandle")
29
+ @worksheet.instance_variable_get("@filehandle").close(true)
30
30
  end
31
31
  end
32
32
 
@@ -26,11 +26,11 @@ class TC_position_object < Minitest::Test
26
26
  end
27
27
 
28
28
  def teardown
29
- if @workbook.instance_variable_get(:@filehandle)
30
- @workbook.instance_variable_get(:@filehandle).close(true)
29
+ if @workbook.instance_variable_get("@filehandle")
30
+ @workbook.instance_variable_get("@filehandle").close(true)
31
31
  end
32
- if @worksheet.instance_variable_get(:@filehandle)
33
- @worksheet.instance_variable_get(:@filehandle).close(true)
32
+ if @worksheet.instance_variable_get("@filehandle")
33
+ @worksheet.instance_variable_get("@filehandle").close(true)
34
34
  end
35
35
  end
36
36
 
@@ -22,11 +22,11 @@ class TC_validation_dval < Minitest::Test
22
22
  end
23
23
 
24
24
  def teardown
25
- if @workbook.instance_variable_get(:@filehandle)
26
- @workbook.instance_variable_get(:@filehandle).close(true)
25
+ if @workbook.instance_variable_get("@filehandle")
26
+ @workbook.instance_variable_get("@filehandle").close(true)
27
27
  end
28
- if @worksheet.instance_variable_get(:@filehandle)
29
- @worksheet.instance_variable_get(:@filehandle).close(true)
28
+ if @worksheet.instance_variable_get("@filehandle")
29
+ @worksheet.instance_variable_get("@filehandle").close(true)
30
30
  end
31
31
  end
32
32
 
@@ -17,17 +17,17 @@ require 'stringio'
17
17
  class TC_validation_dv_strings < Minitest::Test
18
18
 
19
19
  def setup
20
- workbook = WriteExcel.new(StringIO.new)
21
- worksheet = workbook.add_worksheet
22
- @data_validation = Writeexcel::Worksheet::DataValidation.new(worksheet.__send__("parser"), {})
20
+ @workbook = WriteExcel.new(StringIO.new)
21
+ @worksheet = @workbook.add_worksheet
22
+ @data_validation = Writeexcel::Worksheet::DataValidation.new(@worksheet.__send__("parser"), {})
23
23
  end
24
24
 
25
25
  def teardown
26
- if @workbook.instance_variable_get(:@filehandle)
27
- @workbook.instance_variable_get(:@filehandle).close(true)
26
+ if @workbook.instance_variable_get("@filehandle")
27
+ @workbook.instance_variable_get("@filehandle").close(true)
28
28
  end
29
- if @worksheet.instance_variable_get(:@filehandle)
30
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @worksheet.instance_variable_get("@filehandle")
30
+ @worksheet.instance_variable_get("@filehandle").close(true)
31
31
  end
32
32
  end
33
33
 
@@ -23,11 +23,11 @@ class TC_validation_dv_formula < Minitest::Test
23
23
  end
24
24
 
25
25
  def teardown
26
- if @workbook.instance_variable_get(:@filehandle)
27
- @workbook.instance_variable_get(:@filehandle).close(true)
26
+ if @workbook.instance_variable_get("@filehandle")
27
+ @workbook.instance_variable_get("@filehandle").close(true)
28
28
  end
29
- if @worksheet.instance_variable_get(:@filehandle)
30
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @worksheet.instance_variable_get("@filehandle")
30
+ @worksheet.instance_variable_get("@filehandle").close(true)
31
31
  end
32
32
  end
33
33
 
@@ -21,28 +21,21 @@ require 'stringio'
21
21
 
22
22
  class TC_set_properties < Minitest::Test
23
23
 
24
- def test_dummy
25
- assert(true)
26
- end
27
-
28
24
  def setup
29
25
  @test_file = StringIO.new
30
26
  end
31
27
 
32
28
  def teardown
33
- if @workbook.instance_variable_get(:@filehandle)
34
- @workbook.instance_variable_get(:@filehandle).close(true)
35
- end
36
- if @worksheet.instance_variable_get(:@filehandle)
37
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @workbook.instance_variable_get("@filehandle")
30
+ @workbook.instance_variable_get("@filehandle").close(true)
38
31
  end
39
32
  end
40
33
 
41
34
  def test_same_as_previous_plus_creation_date
42
35
  smiley = '☺' # chr 0x263A; in perl
43
36
 
44
- workbook = WriteExcel.new(@test_file)
45
- workbook.add_worksheet
37
+ @workbook = WriteExcel.new(@test_file)
38
+ @workbook.add_worksheet
46
39
 
47
40
  =begin
48
41
  ###############################################################################
@@ -122,7 +115,7 @@ class TC_set_properties < Minitest::Test
122
115
  # Test 4. Codepage only.
123
116
  #
124
117
 
125
- workbook.set_properties(
118
+ @workbook.set_properties(
126
119
  :created => nil
127
120
  )
128
121
 
@@ -135,7 +128,7 @@ class TC_set_properties < Minitest::Test
135
128
  02 00 00 00 E4 04 00 00
136
129
  ).join(' ')
137
130
 
138
- result = unpack_record(workbook.summary)
131
+ result = unpack_record(@workbook.summary)
139
132
  assert_equal(target, result, caption)
140
133
 
141
134
  ###############################################################################
@@ -143,7 +136,7 @@ class TC_set_properties < Minitest::Test
143
136
  # Test 5. Same as previous + Title.
144
137
  #
145
138
 
146
- workbook.set_properties(
139
+ @workbook.set_properties(
147
140
  :title => 'Title',
148
141
  :created => nil
149
142
  )
@@ -158,7 +151,7 @@ class TC_set_properties < Minitest::Test
158
151
  1E 00 00 00 06 00 00 00 54 69 74 6C 65 00 00 00
159
152
  ).join(' ')
160
153
 
161
- result = unpack_record(workbook.summary)
154
+ result = unpack_record(@workbook.summary)
162
155
  assert_equal(target, result, caption)
163
156
 
164
157
  ###############################################################################
@@ -166,7 +159,7 @@ class TC_set_properties < Minitest::Test
166
159
  # Test 6. Same as previous + Subject.
167
160
  #
168
161
 
169
- workbook.set_properties(
162
+ @workbook.set_properties(
170
163
  :title => 'Title',
171
164
  :subject => 'Subject',
172
165
  :created => nil
@@ -184,7 +177,7 @@ class TC_set_properties < Minitest::Test
184
177
  53 75 62 6A 65 63 74 00
185
178
  ).join(' ')
186
179
 
187
- result = unpack_record(workbook.summary)
180
+ result = unpack_record(@workbook.summary)
188
181
  assert_equal(target, result, caption)
189
182
 
190
183
  ###############################################################################
@@ -192,7 +185,7 @@ class TC_set_properties < Minitest::Test
192
185
  # Test 7. Same as previous + Author.
193
186
  #
194
187
 
195
- workbook.set_properties(
188
+ @workbook.set_properties(
196
189
  :title => 'Title',
197
190
  :subject => 'Subject',
198
191
  :author => 'Author',
@@ -212,7 +205,7 @@ class TC_set_properties < Minitest::Test
212
205
  1E 00 00 00 07 00 00 00 41 75 74 68 6F 72 00 00
213
206
  ).join(' ')
214
207
 
215
- result = unpack_record(workbook.summary)
208
+ result = unpack_record(@workbook.summary)
216
209
  assert_equal(target, result, caption)
217
210
 
218
211
  ###############################################################################
@@ -220,7 +213,7 @@ class TC_set_properties < Minitest::Test
220
213
  # Test 8. Same as previous + Keywords.
221
214
  #
222
215
 
223
- workbook.set_properties(
216
+ @workbook.set_properties(
224
217
  :title => 'Title',
225
218
  :subject => 'Subject',
226
219
  :author => 'Author',
@@ -243,7 +236,7 @@ class TC_set_properties < Minitest::Test
243
236
  4B 65 79 77 6F 72 64 73 00 00 00 00
244
237
  ).join(' ')
245
238
 
246
- result = unpack_record(workbook.summary)
239
+ result = unpack_record(@workbook.summary)
247
240
  assert_equal(target, result, caption)
248
241
 
249
242
  ###############################################################################
@@ -251,7 +244,7 @@ class TC_set_properties < Minitest::Test
251
244
  # Test 9. Same as previous + Comments.
252
245
  #
253
246
 
254
- workbook.set_properties(
247
+ @workbook.set_properties(
255
248
  :title => 'Title',
256
249
  :subject => 'Subject',
257
250
  :author => 'Author',
@@ -277,7 +270,7 @@ class TC_set_properties < Minitest::Test
277
270
  65 6E 74 73 00 00 00 00
278
271
  ).join(' ')
279
272
 
280
- result = unpack_record(workbook.summary)
273
+ result = unpack_record(@workbook.summary)
281
274
  assert_equal(target, result, caption)
282
275
 
283
276
  ###############################################################################
@@ -285,7 +278,7 @@ class TC_set_properties < Minitest::Test
285
278
  # Test 10. Same as previous + Last author.
286
279
  #
287
280
 
288
- workbook.set_properties(
281
+ @workbook.set_properties(
289
282
  :title => 'Title',
290
283
  :subject => 'Subject',
291
284
  :author => 'Author',
@@ -314,7 +307,7 @@ class TC_set_properties < Minitest::Test
314
307
  00 00 00 00
315
308
  ).join(' ')
316
309
 
317
- result = unpack_record(workbook.summary)
310
+ result = unpack_record(@workbook.summary)
318
311
  assert_equal(target, result, caption)
319
312
 
320
313
  ###############################################################################
@@ -328,7 +321,7 @@ class TC_set_properties < Minitest::Test
328
321
  # different timezones.
329
322
 
330
323
  filetime = Time.gm(2008,8,19,23,20,13)
331
- workbook.set_properties(
324
+ @workbook.set_properties(
332
325
  :title => 'Title',
333
326
  :subject => 'Subject',
334
327
  :author => 'Author',
@@ -358,7 +351,7 @@ class TC_set_properties < Minitest::Test
358
351
  80 74 89 21 52 02 C9 01
359
352
  ).join(' ')
360
353
 
361
- result = unpack_record(workbook.summary)
354
+ result = unpack_record(@workbook.summary)
362
355
  assert_equal(target, result, caption)
363
356
 
364
357
  ###############################################################################
@@ -370,9 +363,9 @@ class TC_set_properties < Minitest::Test
370
363
  # $sec,$min,$hour,$mday,$mon,$year
371
364
  # We normalise the time using timegm() so that the tests don't fail due to
372
365
  # different timezones.
373
- workbook.localtime = Time.gm(2008,8,19,23,20,13)
366
+ @workbook.localtime = Time.gm(2008,8,19,23,20,13)
374
367
 
375
- workbook.set_properties(
368
+ @workbook.set_properties(
376
369
  :title => 'Title',
377
370
  :subject => 'Subject',
378
371
  :author => 'Author',
@@ -401,7 +394,7 @@ class TC_set_properties < Minitest::Test
401
394
  80 74 89 21 52 02 C9 01
402
395
  ).join(' ')
403
396
 
404
- result = unpack_record(workbook.summary)
397
+ result = unpack_record(@workbook.summary)
405
398
  assert_equal(target, result, caption)
406
399
 
407
400
  ###############################################################################
@@ -409,10 +402,10 @@ class TC_set_properties < Minitest::Test
409
402
  # Test 14. UTF-8 string used.
410
403
  #
411
404
 
412
- workbook.set_properties(
413
- :title => 'Title' + smiley,
414
- :created => nil
415
- )
405
+ @workbook.set_properties(
406
+ :title => 'Title' + smiley,
407
+ :created => nil
408
+ )
416
409
 
417
410
  caption = " \tset_properties(utf8)"
418
411
  target = %w(
@@ -425,10 +418,10 @@ class TC_set_properties < Minitest::Test
425
418
  00 00 00 00
426
419
  ).join(' ')
427
420
 
428
- result = unpack_record(workbook.summary)
421
+ result = unpack_record(@workbook.summary)
429
422
  assert_equal(target, result, caption)
430
423
 
431
- workbook.close
424
+ @workbook.close
432
425
 
433
426
  end
434
427
  end
@@ -37,8 +37,6 @@ class TC_Name_Stored < Minitest::Test
37
37
  00 00 00 06 3B 00 00 00 00 0B 00 00 00 01 00
38
38
  ).join('')].pack('H*')
39
39
 
40
- # result = _unpack_name(result)
41
- # target = _unpack_name(target)
42
40
  assert_equal(unpack_record(target), unpack_record(result))
43
41
  end
44
42
 
@@ -60,8 +58,6 @@ class TC_Name_Stored < Minitest::Test
60
58
  00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
61
59
  ).join('')].pack('H*')
62
60
 
63
- # result = _unpack_name(result)
64
- # target = _unpack_name(target)
65
61
  assert_equal(unpack_record(target), unpack_record(result))
66
62
  end
67
63
 
@@ -83,8 +79,6 @@ class TC_Name_Stored < Minitest::Test
83
79
  00 00 00 07 3B 00 00 00 00 09 00 00 00 FF 00
84
80
  ).join('')].pack('H*')
85
81
 
86
- # result = _unpack_name(result)
87
- # target = _unpack_name(target)
88
82
  assert_equal(unpack_record(target), unpack_record(result))
89
83
  end
90
84
 
@@ -129,8 +123,6 @@ class TC_Name_Stored < Minitest::Test
129
123
  00 00 00 07 3B 00 00 00 00 FF FF 00 00 09 00
130
124
  ).join('')].pack('H*')
131
125
 
132
- # result = _unpack_name(result)
133
- # target = _unpack_name(target)
134
126
  assert_equal(unpack_record(target), unpack_record(result))
135
127
  end
136
128
 
@@ -176,8 +168,6 @@ class TC_Name_Stored < Minitest::Test
176
168
  00 00 00 0D 3B 00 00 00 00 04 00 00 00 02 00
177
169
  ).join('')].pack('H*')
178
170
 
179
- # result = _unpack_name(result)
180
- # target = _unpack_name(target)
181
171
  assert_equal(unpack_record(target), unpack_record(result))
182
172
  end
183
173
 
data/writeexcel.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'writeexcel/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "writeexcel"
8
- gem.version = WriteExcel::VERSION
8
+ gem.version = Writeexcel::VERSION
9
9
  gem.authors = ["Hideo NAKAMURA"]
10
10
  gem.email = ["nakamura.hideo@gmail.com"]
11
11
  gem.description = "Multiple worksheets can be added to a workbook and formatting can be applied to cells. Text, numbers, formulas, hyperlinks and images can be written to the cells."
@@ -17,7 +17,9 @@ Gem::Specification.new do |gem|
17
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
+ gem.required_ruby_version = '>= 2.4.0'
20
21
  gem.add_development_dependency 'minitest'
22
+ gem.add_runtime_dependency 'racc' if RUBY_VERSION >= '3.3'
21
23
  gem.add_development_dependency 'rake'
22
24
  gem.extra_rdoc_files = [
23
25
  "LICENSE.txt",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: writeexcel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hideo NAKAMURA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-03 00:00:00.000000000 Z
11
+ date: 2024-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -65,8 +65,8 @@ extra_rdoc_files:
65
65
  files:
66
66
  - ".document"
67
67
  - ".gitattributes"
68
+ - ".github/workflows/test-suite.yml"
68
69
  - ".gitignore"
69
- - ".travis.yml"
70
70
  - Gemfile
71
71
  - LICENSE.txt
72
72
  - README.rdoc
@@ -331,14 +331,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
- version: '0'
334
+ version: 2.4.0
335
335
  required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  requirements:
337
337
  - - ">="
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.4.19
341
+ rubygems_version: 3.4.21
342
342
  signing_key:
343
343
  specification_version: 4
344
344
  summary: Write to a cross-platform Excel binary file.
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.0
4
- - 2.1.5
5
- - 2.1.2
6
- - 2.1.1
7
- - 2.0.0
8
- - 1.9.3