writeexcel 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +8 -0
  3. data/README.rdoc +9 -1
  4. data/examples/a_simple.rb +0 -1
  5. data/examples/chart_area.rb +0 -1
  6. data/examples/chart_legend.rb +0 -1
  7. data/examples/copyformat.rb +0 -1
  8. data/examples/data_validate.rb +1 -2
  9. data/examples/date_time.rb +0 -1
  10. data/examples/demo.rb +0 -1
  11. data/examples/diag_border.rb +0 -1
  12. data/examples/formats.rb +0 -1
  13. data/examples/header.rb +0 -1
  14. data/examples/hide_sheet.rb +0 -1
  15. data/examples/hyperlink.rb +0 -1
  16. data/examples/hyperlink2.rb +0 -1
  17. data/examples/images.rb +0 -1
  18. data/examples/merge1.rb +0 -1
  19. data/examples/merge2.rb +0 -1
  20. data/examples/merge3.rb +0 -1
  21. data/examples/merge4.rb +0 -1
  22. data/examples/merge5.rb +0 -1
  23. data/examples/password_protection.rb +0 -1
  24. data/examples/properties.rb +0 -1
  25. data/examples/properties_jp.rb +0 -1
  26. data/examples/protection.rb +0 -1
  27. data/examples/regions.rb +0 -1
  28. data/examples/repeat.rb +0 -1
  29. data/examples/set_first_sheet.rb +0 -1
  30. data/examples/stocks.rb +0 -1
  31. data/examples/store_formula.rb +0 -1
  32. data/examples/tab_colors.rb +0 -1
  33. data/examples/write_arrays.rb +0 -1
  34. data/lib/writeexcel/biffwriter.rb +2 -1
  35. data/lib/writeexcel/chart.rb +2 -3
  36. data/lib/writeexcel/charts/area.rb +1 -1
  37. data/lib/writeexcel/charts/pie.rb +1 -1
  38. data/lib/writeexcel/charts/scatter.rb +1 -1
  39. data/lib/writeexcel/charts/stock.rb +1 -1
  40. data/lib/writeexcel/col_info.rb +2 -2
  41. data/lib/writeexcel/comments.rb +1 -1
  42. data/lib/writeexcel/convert_date_time.rb +7 -7
  43. data/lib/writeexcel/excelformulaparser.rb +49 -49
  44. data/lib/writeexcel/format.rb +1 -1
  45. data/lib/writeexcel/formula.rb +2 -6
  46. data/lib/writeexcel/helper.rb +3 -3
  47. data/lib/writeexcel/properties.rb +1 -1
  48. data/lib/writeexcel/shared_string_table.rb +5 -5
  49. data/lib/writeexcel/storage_lite.rb +2 -9
  50. data/lib/writeexcel/version.rb +1 -1
  51. data/lib/writeexcel/workbook.rb +13 -14
  52. data/lib/writeexcel/worksheet.rb +43 -35
  53. data/test/helper.rb +12 -5
  54. data/test/test_00_IEEE_double.rb +1 -1
  55. data/test/test_04_dimensions.rb +2 -2
  56. data/test/test_05_rows.rb +1 -1
  57. data/test/test_06_extsst.rb +1 -1
  58. data/test/test_11_date_time.rb +1 -1
  59. data/test/test_12_date_only.rb +1 -1
  60. data/test/test_13_date_seconds.rb +1 -1
  61. data/test/test_21_escher.rb +1 -1
  62. data/test/test_22_mso_drawing_group.rb +1 -1
  63. data/test/test_23_note.rb +1 -1
  64. data/test/test_24_txo.rb +1 -1
  65. data/test/test_25_position_object.rb +1 -1
  66. data/test/test_26_autofilter.rb +1 -1
  67. data/test/test_27_autofilter.rb +1 -1
  68. data/test/test_28_autofilter.rb +1 -1
  69. data/test/test_29_process_jpg.rb +1 -43
  70. data/test/test_30_validation_dval.rb +1 -1
  71. data/test/test_31_validation_dv_strings.rb +1 -1
  72. data/test/test_32_validation_dv_formula.rb +1 -1
  73. data/test/test_40_property_types.rb +1 -1
  74. data/test/test_41_properties.rb +1 -1
  75. data/test/test_42_set_properties.rb +2 -2
  76. data/test/test_50_name_stored.rb +1 -9
  77. data/test/test_51_name_print_area.rb +3 -13
  78. data/test/test_52_name_print_titles.rb +3 -21
  79. data/test/test_53_autofilter.rb +1 -5
  80. data/test/test_60_chart_generic.rb +3 -3
  81. data/test/test_61_chart_subclasses.rb +2 -1
  82. data/test/test_62_chart_formats.rb +9 -21
  83. data/test/test_63_chart_area_formats.rb +1 -1
  84. data/test/test_compatibility.rb +1 -1
  85. data/test/test_example_match.rb +835 -835
  86. data/test/test_format.rb +1 -114
  87. data/test/test_formula.rb +1 -1
  88. data/test/test_properties.rb +1 -2
  89. data/test/test_storage_lite.rb +2 -2
  90. data/test/test_workbook.rb +1 -66
  91. data/test/test_worksheet.rb +1 -18
  92. data/test/test_write_formula_does_not_change_formula_string.rb +1 -1
  93. data/writeexcel.gemspec +4 -1
  94. metadata +38 -19
  95. data/test/test_01_add_worksheet.rb +0 -43
  96. data/test/test_02_merge_formats.rb +0 -49
  97. data/test/test_biff.rb +0 -71
  98. data/test/test_big_workbook.rb +0 -17
  99. data/test/test_ole.rb +0 -102
data/test/test_format.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'helper'
3
3
  require 'stringio'
4
4
 
5
- class TC_Format < Test::Unit::TestCase
5
+ class TC_Format < Minitest::Test
6
6
 
7
7
  TEST_DIR = File.expand_path(File.dirname(__FILE__))
8
8
  PERL_OUTDIR = File.join(TEST_DIR, 'perl_output')
@@ -253,14 +253,6 @@ set_italic()
253
253
  assert_equal(value, fmt.italic, "arg : #{arg}")
254
254
  end
255
255
 
256
- # invalid arg
257
- [-1, 0.2, 100, 'italic', true, false, nil].each do |arg|
258
- assert_raise(ArgumentError,
259
- "set_italic(#{arg}) : invalid arg. arg must be 0, 1 or none."){
260
- fmt = Writeexcel::Format.new
261
- fmt.set_italic(arg)
262
- }
263
- end
264
256
  end
265
257
 
266
258
  =begin
@@ -292,15 +284,6 @@ Set the underline property of the font.
292
284
  fmt.set_underline(arg)
293
285
  assert_equal(arg, fmt.underline, "arg : #{arg}")
294
286
  end
295
-
296
- # invalid args
297
- [-1, 0.2, 100, 'under', true, false, nil].each do |arg|
298
- assert_raise(ArgumentError,
299
- "set_underline(#{arg}) : arg must be 0, 1 or none, 2, 33, 34."){
300
- fmt = Writeexcel::Format.new
301
- fmt.set_underline(arg)
302
- }
303
- end
304
287
  end
305
288
 
306
289
  =begin
@@ -326,15 +309,6 @@ Set the strikeout property of the font.
326
309
  fmt.set_font_strikeout(arg)
327
310
  assert_equal(arg, fmt.font_strikeout, "arg : #{arg}")
328
311
  end
329
-
330
- # invalid args
331
- [-1, 0.2, 100, 'strikeout', true, false, nil].each do |arg|
332
- assert_raise(ArgumentError,
333
- "set_font_strikeout(#{arg}) : arg must be 0, 1 or none."){
334
- fmt = Writeexcel::Format.new
335
- fmt.set_font_strikeout(arg)
336
- }
337
- end
338
312
  end
339
313
 
340
314
  =begin
@@ -362,16 +336,6 @@ Set the superscript/subscript property of the font. This format is currently not
362
336
  fmt.set_font_script(arg)
363
337
  assert_equal(arg, fmt.font_script, "arg : #{arg}")
364
338
  end
365
-
366
- # invalid args
367
- [-1, 0.2, 100, 'script', true, false, nil].each do |arg|
368
- assert_raise(ArgumentError,
369
- "set_font_script(#{arg}) : arg must be 0, 1 or none, or 2."){
370
- fmt = Writeexcel::Format.new
371
- fmt.set_font_script(arg)
372
- }
373
- end
374
-
375
339
  end
376
340
 
377
341
  =begin
@@ -397,15 +361,6 @@ Macintosh only.
397
361
  fmt.set_font_outline(arg)
398
362
  assert_equal(arg, fmt.font_outline, "arg : #{arg}")
399
363
  end
400
-
401
- # invalid args
402
- [-1, 0.2, 100, 'outline', true, false, nil].each do |arg|
403
- assert_raise(ArgumentError,
404
- "set_font_outline(#{arg}) : arg must be 0, 1 or none."){
405
- fmt = Writeexcel::Format.new
406
- fmt.set_font_outline(arg)
407
- }
408
- end
409
364
  end
410
365
 
411
366
  =begin
@@ -431,15 +386,6 @@ Macintosh only.
431
386
  fmt.set_font_shadow(arg)
432
387
  assert_equal(arg, fmt.font_shadow, "arg : #{arg}")
433
388
  end
434
-
435
- # invalid args
436
- [-1, 0.2, 100, 'shadow', true, false, nil].each do |arg|
437
- assert_raise(ArgumentError,
438
- "set_font_shadow(#{arg}) : arg must be 0, 1 or none."){
439
- fmt = Writeexcel::Format.new
440
- fmt.set_font_shadow(arg)
441
- }
442
- end
443
389
  end
444
390
 
445
391
  =begin
@@ -515,15 +461,6 @@ Note: This offers weak protection even with a password,
515
461
  fmt.set_locked(arg)
516
462
  assert_equal(arg, fmt.locked, "arg : #{arg}")
517
463
  end
518
-
519
- # invalid args
520
- [-1, 0.2, 100, 'locked', true, false, nil].each do |arg|
521
- assert_raise(ArgumentError,
522
- "set_font_shadow(#{arg}) : arg must be 0, 1 or none."){
523
- fmt = Writeexcel::Format.new
524
- fmt.set_locked(arg)
525
- }
526
- end
527
464
  end
528
465
  =begin
529
466
  set_hidden()
@@ -564,15 +501,6 @@ Note: This offers weak protection even with a password,
564
501
  fmt.set_hidden(arg)
565
502
  assert_equal(arg, fmt.hidden, "arg : #{arg}")
566
503
  end
567
-
568
- # invalid args
569
- [-1, 0.2, 100, 'hidden', true, false, nil].each do |arg|
570
- assert_raise(ArgumentError,
571
- "set_font_shadow(#{arg}) : arg must be 0, 1 or none."){
572
- fmt = Writeexcel::Format.new
573
- fmt.set_hidden(arg)
574
- }
575
- end
576
504
  end
577
505
 
578
506
  =begin
@@ -703,15 +631,6 @@ set_text_wrap()
703
631
  fmt.set_text_wrap(arg)
704
632
  assert_equal(arg, fmt.text_wrap, "arg : #{arg}")
705
633
  end
706
-
707
- # invalid args
708
- [-1, 0.2, 100, 'text_wrap', true, false, nil].each do |arg|
709
- assert_raise(ArgumentError,
710
- "set_text_wrap(#{arg}) : arg must be 0, 1 or none."){
711
- fmt = Writeexcel::Format.new
712
- fmt.set_text_wrap(arg)
713
- }
714
- end
715
634
  end
716
635
 
717
636
  =begin
@@ -1025,20 +944,6 @@ Note: this is not a copy constructor, both objects must exist prior to copying.
1025
944
  assert_equal(contents, rcontents, "Contents not the same")
1026
945
  end
1027
946
 
1028
- def test_initialize
1029
- assert_nothing_raised {
1030
- Writeexcel::Format.new(
1031
- :bold => true,
1032
- :size => 10,
1033
- :color => 'black',
1034
- :fg_color => 43,
1035
- :align => 'top',
1036
- :text_wrap => true,
1037
- :border => 1
1038
- )
1039
- }
1040
- end
1041
-
1042
947
  # added by Nakamura
1043
948
 
1044
949
  def test_get_xf
@@ -1133,24 +1038,6 @@ Note: this is not a copy constructor, both objects must exist prior to copying.
1133
1038
  # :align => 'left',
1134
1039
 
1135
1040
  def get_format_property(format)
1136
- text_h_align = {
1137
- 1 => 'left',
1138
- 2 => 'center/centre',
1139
- 3 => 'right',
1140
- 4 => 'fill',
1141
- 5 => 'justiry',
1142
- 6 => 'center_across/centre_across/merge',
1143
- 7 => 'distributed/equal_space'
1144
- }
1145
-
1146
- text_v_align = {
1147
- 0 => 'top',
1148
- 1 => 'vcenter/vcentre',
1149
- 2 => 'bottom',
1150
- 3 => 'vjustify',
1151
- 4 => 'vdistributed/vequal_space'
1152
- }
1153
-
1154
1041
  return {
1155
1042
  :font => format.font,
1156
1043
  :size => format.size,
data/test/test_formula.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'helper'
3
3
 
4
- class TC_Formula < Test::Unit::TestCase
4
+ class TC_Formula < Minitest::Test
5
5
 
6
6
  def setup
7
7
  @formula = Writeexcel::Formula.new(0)
@@ -3,13 +3,12 @@
3
3
  require 'helper'
4
4
  require 'stringio'
5
5
 
6
- class TestProperties < Test::Unit::TestCase
6
+ class TestProperties < Minitest::Test
7
7
  def setup
8
8
  @workbook = WriteExcel.new(StringIO.new)
9
9
  end
10
10
 
11
11
  def test_pack_VT_FILETIME
12
- filetime =
13
12
  assert_equal(
14
13
  '40 00 00 00 00 FD 2D ED CE 48 CE 01',
15
14
  unpack_record(pack_VT_FILETIME(Time.gm(2013, 5, 4, 13, 54, 42)))
@@ -2,7 +2,7 @@
2
2
  require 'helper'
3
3
  require 'stringio'
4
4
 
5
- class TC_OLEStorageLite < Test::Unit::TestCase
5
+ class TC_OLEStorageLite < Minitest::Test
6
6
  TEST_DIR = File.expand_path(File.dirname(__FILE__))
7
7
  PERL_OUTDIR = File.join(TEST_DIR, 'perl_output')
8
8
  EXCEL_OUTDIR = File.join(TEST_DIR, 'excelfile')
@@ -45,7 +45,7 @@ class TC_OLEStorageLite < Test::Unit::TestCase
45
45
  end
46
46
  end
47
47
 
48
- class TC_OLEStorageLitePPSFile < Test::Unit::TestCase
48
+ class TC_OLEStorageLitePPSFile < Minitest::Test
49
49
  def test_constructor
50
50
  data = [
51
51
  { :name => 'name', :data => 'data' },
@@ -2,7 +2,7 @@
2
2
  require 'helper'
3
3
  require "stringio"
4
4
 
5
- class TC_Workbook < Test::Unit::TestCase
5
+ class TC_Workbook < Minitest::Test
6
6
 
7
7
  def setup
8
8
  @test_file = StringIO.new
@@ -24,71 +24,6 @@ class TC_Workbook < Test::Unit::TestCase
24
24
  end
25
25
  end
26
26
 
27
- def test_set_tempdir_after_sheet_added
28
- # after shees added, call set_tempdir raise RuntimeError
29
- @workbook.add_worksheet('name')
30
- assert_raise(RuntimeError, "already sheet exists, but set_tempdir() doesn't raise"){
31
- @workbook.set_tempdir
32
- }
33
- end
34
-
35
- def test_set_tempdir_with_invalid_dir
36
- # invalid dir raise RuntimeError
37
- while true do
38
- dir = Time.now.to_s
39
- break unless FileTest.directory?(dir)
40
- sleep 0.1
41
- end
42
- assert_raise(RuntimeError, "set_tempdir() doesn't raise invalid dir:#{dir}."){
43
- @workbook.set_tempdir(dir)
44
- }
45
- end
46
-
47
- def test_check_sheetname
48
- worksheet1 = @workbook.add_worksheet # implicit name 'Sheet1'
49
- worksheet2 = @workbook.add_worksheet # implicit name 'Sheet2'
50
- worksheet3 = @workbook.add_worksheet 'Sheet3' # explicit name 'Sheet3'
51
- worksheet4 = @workbook.add_worksheet 'Sheetz' # explicit name 'Sheetz'
52
-
53
- valid_sheetnames.each do |test|
54
- target = test[0]
55
- sheetname = test[1]
56
- caption = test[2]
57
- assert_nothing_raised { @workbook.add_worksheet(sheetname) }
58
- end
59
-
60
- invalid_sheetnames.each do |test|
61
- target = test[0]
62
- sheetname = test[1]
63
- caption = test[2]
64
- assert_raise(RuntimeError, "sheetname: #{sheetname}") {
65
- @workbook.add_worksheet(sheetname)
66
- }
67
- end
68
- end
69
-
70
- def test_check_sheetname_raise_if_same_utf16be_sheet_name
71
- smily = [0x263a].pack('n')
72
- @workbook.add_worksheet(smily, true)
73
- assert_raise(RuntimeError) { @workbook.add_worksheet(smily, true)}
74
- end
75
-
76
- def test_check_sheetname_utf8_only
77
- ['Лист 1', 'Лист 2', 'Лист 3'].each do |sheetname|
78
- assert_nothing_raised { @workbook.add_worksheet(sheetname) }
79
- end
80
- end
81
-
82
- def test_check_unicode_bytes_even
83
- assert_nothing_raised(RuntimeError){ @workbook.add_worksheet('ab', 1)}
84
- assert_raise(RuntimeError){ @workbook.add_worksheet('abc', 1)}
85
- end
86
-
87
- def test_raise_set_compatibility_after_sheet_creation
88
- @workbook.add_worksheet
89
- assert_raise(RuntimeError) { @workbook.compatibility_mode }
90
- end
91
-
92
27
  def valid_sheetnames
93
28
  [
94
29
  # Tests for valid names
@@ -2,7 +2,7 @@
2
2
  require 'helper'
3
3
  require 'stringio'
4
4
 
5
- class TC_Worksheet < Test::Unit::TestCase
5
+ class TC_Worksheet < Minitest::Test
6
6
  TEST_DIR = File.expand_path(File.dirname(__FILE__))
7
7
  PERL_OUTDIR = File.join(TEST_DIR, 'perl_output')
8
8
 
@@ -31,23 +31,6 @@ class TC_Worksheet < Test::Unit::TestCase
31
31
  assert_respond_to(@ws, :write_col)
32
32
  end
33
33
 
34
- def test_methods_no_error
35
- assert_nothing_raised{ @ws.write(0,0,nil) }
36
- assert_nothing_raised{ @ws.write(0,0,"Hello") }
37
- assert_nothing_raised{ @ws.write(0,0,888) }
38
- assert_nothing_raised{ @ws.write_row(0,0,["one","two","three"]) }
39
- assert_nothing_raised{ @ws.write_row(0,0,[1,2,3]) }
40
- assert_nothing_raised{ @ws.write_col(0,0,["one","two","three"]) }
41
- assert_nothing_raised{ @ws.write_col(0,0,[1,2,3]) }
42
- assert_nothing_raised{ @ws.write_blank(0,0,nil) }
43
- assert_nothing_raised{ @ws.write_url(0,0,"http://www.ruby-lang.org") }
44
- end
45
-
46
- def test_write_syntax
47
- assert_nothing_raised{@ws.write(0,0,"Hello")}
48
- assert_nothing_raised{@ws.write(0,0,666)}
49
- end
50
-
51
34
  def test_store_dimensions
52
35
  file = "delete_this"
53
36
  File.open(file,"w+"){ |f| f.print @ws.__send__("store_dimensions") }
@@ -3,7 +3,7 @@ require 'helper'
3
3
  require 'writeexcel'
4
4
  require 'stringio'
5
5
 
6
- class TestWriteFormula < Test::Unit::TestCase
6
+ class TestWriteFormula < Minitest::Test
7
7
  def setup
8
8
  @workbook = WriteExcel.new(StringIO.new)
9
9
  @worksheet = @workbook.add_worksheet('')
data/writeexcel.gemspec CHANGED
@@ -7,15 +7,18 @@ Gem::Specification.new do |gem|
7
7
  gem.name = "writeexcel"
8
8
  gem.version = WriteExcel::VERSION
9
9
  gem.authors = ["Hideo NAKAMURA"]
10
- gem.email = ["cxn03651@msj.biglobe.ne.jp"]
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."
12
12
  gem.summary = "Write to a cross-platform Excel binary file."
13
13
  gem.homepage = "http://github.com/cxn03651/writeexcel#readme"
14
+ gem.license = 'MIT'
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
19
  gem.require_paths = ["lib"]
20
+ gem.add_development_dependency 'minitest'
21
+ gem.add_development_dependency 'rake'
19
22
  gem.extra_rdoc_files = [
20
23
  "LICENSE.txt",
21
24
  "README.rdoc"
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: writeexcel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hideo NAKAMURA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2023-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: simplecov
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -28,7 +56,7 @@ description: Multiple worksheets can be added to a workbook and formatting can b
28
56
  applied to cells. Text, numbers, formulas, hyperlinks and images can be written
29
57
  to the cells.
30
58
  email:
31
- - cxn03651@msj.biglobe.ne.jp
59
+ - nakamura.hideo@gmail.com
32
60
  executables: []
33
61
  extensions: []
34
62
  extra_rdoc_files:
@@ -38,6 +66,7 @@ files:
38
66
  - ".document"
39
67
  - ".gitattributes"
40
68
  - ".gitignore"
69
+ - ".travis.yml"
41
70
  - Gemfile
42
71
  - LICENSE.txt
43
72
  - README.rdoc
@@ -249,8 +278,6 @@ files:
249
278
  - test/perl_output/ws_store_window2
250
279
  - test/republic.png
251
280
  - test/test_00_IEEE_double.rb
252
- - test/test_01_add_worksheet.rb
253
- - test/test_02_merge_formats.rb
254
281
  - test/test_04_dimensions.rb
255
282
  - test/test_05_rows.rb
256
283
  - test/test_06_extsst.rb
@@ -280,13 +307,10 @@ files:
280
307
  - test/test_61_chart_subclasses.rb
281
308
  - test/test_62_chart_formats.rb
282
309
  - test/test_63_chart_area_formats.rb
283
- - test/test_biff.rb
284
- - test/test_big_workbook.rb
285
310
  - test/test_compatibility.rb
286
311
  - test/test_example_match.rb
287
312
  - test/test_format.rb
288
313
  - test/test_formula.rb
289
- - test/test_ole.rb
290
314
  - test/test_properties.rb
291
315
  - test/test_storage_lite.rb
292
316
  - test/test_workbook.rb
@@ -296,9 +320,10 @@ files:
296
320
  - writeexcel.gemspec
297
321
  - writeexcel.rdoc
298
322
  homepage: http://github.com/cxn03651/writeexcel#readme
299
- licenses: []
323
+ licenses:
324
+ - MIT
300
325
  metadata: {}
301
- post_install_message:
326
+ post_install_message:
302
327
  rdoc_options: []
303
328
  require_paths:
304
329
  - lib
@@ -313,9 +338,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
313
338
  - !ruby/object:Gem::Version
314
339
  version: '0'
315
340
  requirements: []
316
- rubyforge_project:
317
- rubygems_version: 2.2.0
318
- signing_key:
341
+ rubygems_version: 3.4.19
342
+ signing_key:
319
343
  specification_version: 4
320
344
  summary: Write to a cross-platform Excel binary file.
321
345
  test_files:
@@ -408,8 +432,6 @@ test_files:
408
432
  - test/perl_output/ws_store_window2
409
433
  - test/republic.png
410
434
  - test/test_00_IEEE_double.rb
411
- - test/test_01_add_worksheet.rb
412
- - test/test_02_merge_formats.rb
413
435
  - test/test_04_dimensions.rb
414
436
  - test/test_05_rows.rb
415
437
  - test/test_06_extsst.rb
@@ -439,13 +461,10 @@ test_files:
439
461
  - test/test_61_chart_subclasses.rb
440
462
  - test/test_62_chart_formats.rb
441
463
  - test/test_63_chart_area_formats.rb
442
- - test/test_biff.rb
443
- - test/test_big_workbook.rb
444
464
  - test/test_compatibility.rb
445
465
  - test/test_example_match.rb
446
466
  - test/test_format.rb
447
467
  - test/test_formula.rb
448
- - test/test_ole.rb
449
468
  - test/test_properties.rb
450
469
  - test/test_storage_lite.rb
451
470
  - test/test_workbook.rb
@@ -1,43 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'helper'
3
-
4
- class TC_add_worksheet < Test::Unit::TestCase
5
-
6
- def setup
7
- @workbook = WriteExcel.new(StringIO.new)
8
- end
9
-
10
- def test_ascii_worksheet_name
11
-
12
- name = "Test"
13
-
14
- assert_nothing_raised {
15
- sheet = @workbook.add_worksheet(name)
16
- assert_equal name, sheet.name
17
- }
18
-
19
- end
20
-
21
- def test_utf_8_worksheet_name
22
-
23
- name = "Décembre"
24
-
25
- assert_nothing_raised {
26
- sheet = @workbook.add_worksheet(name)
27
- assert_equal utf8_to_16be(name), sheet.name
28
- }
29
-
30
- end
31
-
32
- def test_utf_16be_worksheet_name
33
-
34
- name = utf8_to_16be("Décembre")
35
-
36
- assert_nothing_raised {
37
- sheet = @workbook.add_worksheet(name, true)
38
- assert_equal name, sheet.name
39
- }
40
-
41
- end
42
-
43
- end
@@ -1,49 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'helper'
3
- require 'stringio'
4
-
5
- class TC_merge_formats < Test::Unit::TestCase
6
-
7
- def setup
8
- @workbook = WriteExcel.new(StringIO.new)
9
- @worksheet = @workbook.add_worksheet
10
- @merged_format = @workbook.add_format(:bold => 1)
11
- @non_merged_format = @workbook.add_format(:bold => 1)
12
-
13
- @worksheet.set_row( 5, nil, @merged_format)
14
- @worksheet.set_column('G:G', nil, @merged_format)
15
- end
16
-
17
- def test_some
18
- # Test 1 Normal usage.
19
- assert_nothing_raised { @worksheet.write('A1', 'Test', @non_merged_format) }
20
- assert_nothing_raised { @worksheet.write('A3:B4', 'Test', @merged_format) }
21
-
22
- # Test 2 Non merge format in merged cells.
23
- assert_nothing_raised {
24
- @worksheet.merge_range('D3:E4', 'Test', @non_merged_format)
25
- }
26
-
27
- # Test 3 Merge format in column.
28
- assert_nothing_raised { @worksheet.write('G1', 'Test') }
29
-
30
- # Test 4 Merge format in row.
31
- assert_nothing_raised { @worksheet.write('A6', 'Test') }
32
-
33
- # Test 5 Merge format in column and row.
34
- assert_nothing_raised { @worksheet.write('G6', 'Test') }
35
-
36
- # Test 6 No merge format in column and row.
37
- assert_nothing_raised { @worksheet.write('H7', 'Test') }
38
-
39
- # Test 7 Normal usage again.
40
- assert_nothing_raised {
41
- @worksheet.write('A1', 'Test', @non_merged_format)
42
- }
43
- assert_nothing_raised {
44
- @worksheet.merge_range('A3:B4', 'Test', @merged_format)
45
- }
46
- end
47
-
48
-
49
- end
data/test/test_biff.rb DELETED
@@ -1,71 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'helper'
3
- require 'stringio'
4
-
5
- class TC_BIFFWriter < Test::Unit::TestCase
6
-
7
- TEST_DIR = File.expand_path(File.dirname(__FILE__))
8
- PERL_OUTDIR = File.join(TEST_DIR, 'perl_output')
9
-
10
- def setup
11
- @biff = BIFFWriter.new
12
- @ruby_file = StringIO.new
13
- end
14
-
15
- def test_append_no_error
16
- assert_nothing_raised{ @biff.append("World") }
17
- end
18
-
19
- def test_prepend_no_error
20
- assert_nothing_raised{ @biff.prepend("Hello") }
21
- end
22
-
23
- def test_data_added
24
- assert_nothing_raised{ @biff.append("Hello", "World") }
25
- data = ''
26
- while d = @biff.get_data
27
- data += d
28
- end
29
- assert_equal("HelloWorld", data, "Bad data contents")
30
- assert_equal(10, @biff.datasize, "Bad data size")
31
- end
32
-
33
- def test_data_prepended
34
-
35
- assert_nothing_raised{ @biff.append("Hello") }
36
- assert_nothing_raised{ @biff.prepend("World") }
37
- data = ''
38
- while d = @biff.get_data
39
- data += d
40
- end
41
- assert_equal("WorldHello", data, "Bad data contents")
42
- assert_equal(10, @biff.datasize, "Bad data size")
43
- end
44
-
45
- def test_store_bof_length
46
- assert_nothing_raised{ @biff.store_bof }
47
- assert_equal(20, @biff.datasize, "Bad data size after store_bof call")
48
- end
49
-
50
- def test_store_eof_length
51
- assert_nothing_raised{ @biff.store_eof }
52
- assert_equal(4, @biff.datasize, "Bad data size after store_eof call")
53
- end
54
-
55
- def test_datasize_mixed
56
- assert_nothing_raised{ @biff.append("Hello") }
57
- assert_nothing_raised{ @biff.prepend("World") }
58
- assert_nothing_raised{ @biff.store_bof }
59
- assert_nothing_raised{ @biff.store_eof }
60
- assert_equal(34, @biff.datasize, "Bad data size for mixed data")
61
- end
62
-
63
- def test_add_continue
64
- perl_file = "#{PERL_OUTDIR}/biff_add_continue_testdata"
65
- size = File.size(perl_file)
66
- @ruby_file.print(@biff.add_continue('testdata'))
67
- rsize = @ruby_file.size
68
- assert_equal(size, rsize, "File sizes not the same")
69
- compare_file(perl_file, @ruby_file)
70
- end
71
- end
@@ -1,17 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'helper'
3
- require 'stringio'
4
-
5
- class TC_BigWorkbook < Test::Unit::TestCase
6
-
7
- def test_big_workbook_saves
8
- workbook = Workbook.new(StringIO.new)
9
- 4.times do
10
- worksheet = workbook.add_worksheet
11
- 500.times {|i| worksheet.write_row(i, 0, [rand(10000).to_s])}
12
- end
13
-
14
- assert_nothing_raised { workbook.close }
15
- end
16
-
17
- end