writeexcel 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/{README → README.rdoc} +14 -3
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/charts/chartex.rb +315 -0
- data/charts/demo1.rb +45 -0
- data/charts/demo101.bin +0 -0
- data/charts/demo2.rb +64 -0
- data/charts/demo201.bin +0 -0
- data/charts/demo3.rb +116 -0
- data/charts/demo301.bin +0 -0
- data/charts/demo4.rb +118 -0
- data/charts/demo401.bin +0 -0
- data/charts/demo5.rb +47 -0
- data/charts/demo501.bin +0 -0
- data/examples/demo.rb +4 -1
- data/examples/images.rb +14 -4
- data/examples/stats.rb +0 -2
- data/lib/writeexcel.rb +0 -1
- data/lib/writeexcel/excelformula.y +139 -0
- data/lib/writeexcel/formula.rb +3 -1
- data/lib/writeexcel/workbook.rb +9 -9
- data/test/helper.rb +9 -0
- data/test/perl_output/defined_name.xls +0 -0
- data/test/test_00_IEEE_double.rb +1 -3
- data/test/test_01_add_worksheet.rb +1 -4
- data/test/test_02_merge_formats.rb +1 -4
- data/test/test_04_dimensions.rb +1 -4
- data/test/test_05_rows.rb +1 -4
- data/test/test_06_extsst.rb +1 -4
- data/test/test_11_date_time.rb +1 -4
- data/test/test_12_date_only.rb +1 -4
- data/test/test_13_date_seconds.rb +1 -4
- data/test/test_21_escher.rb +1 -4
- data/test/test_22_mso_drawing_group.rb +1 -4
- data/test/test_23_note.rb +1 -4
- data/test/test_24_txo.rb +1 -4
- data/test/test_25_position_object.rb +1 -4
- data/test/test_26_autofilter.rb +1 -4
- data/test/test_27_autofilter.rb +1 -4
- data/test/test_28_autofilter.rb +1 -4
- data/test/test_29_process_jpg.rb +1 -4
- data/test/test_30_validation_dval.rb +1 -4
- data/test/test_31_validation_dv_strings.rb +1 -4
- data/test/test_32_validation_dv_formula.rb +1 -4
- data/test/test_40_property_types.rb +1 -5
- data/test/test_41_properties.rb +1 -5
- data/test/test_42_set_properties.rb +1 -5
- data/test/test_50_name_stored.rb +1 -4
- data/test/test_51_name_print_area.rb +1 -4
- data/test/test_52_name_print_titles.rb +1 -4
- data/test/test_53_autofilter.rb +1 -4
- data/test/test_60_chart_generic.rb +1 -4
- data/test/test_61_chart_subclasses.rb +1 -4
- data/test/test_62_chart_formats.rb +1 -4
- data/test/test_63_chart_area_formats.rb +1 -4
- data/test/{tc_biff.rb → test_biff.rb} +1 -4
- data/test/{tc_example_match.rb → test_example_match.rb} +84 -69
- data/test/{tc_format.rb → test_format.rb} +1 -4
- data/test/{tc_formula.rb → test_formula.rb} +1 -4
- data/test/{tc_ole.rb → test_ole.rb} +1 -4
- data/test/{tc_storage_lite.rb → test_storage_lite.rb} +1 -4
- data/test/{tc_workbook.rb → test_workbook.rb} +1 -4
- data/test/{tc_worksheet.rb → test_worksheet.rb} +1 -4
- data/writeexcel.gemspec +287 -16
- metadata +123 -35
- data/test/tc_all.rb +0 -32
- data/test/tc_chart.rb +0 -22
- data/test/test_chartex.rb +0 -35
- data/test/ts_all.rb +0 -46
data/lib/writeexcel/formula.rb
CHANGED
@@ -185,7 +185,9 @@ class Formula < ExcelFormulaParser #:nodoc:
|
|
185
185
|
q.push [:LT , s.matched]
|
186
186
|
elsif s.scan(/>/)
|
187
187
|
q.push [:GT , s.matched]
|
188
|
-
elsif s.scan(/[A-Z0-9_.]
|
188
|
+
elsif s.scan(/[A-Z0-9_.]+\(/)
|
189
|
+
s.unscan
|
190
|
+
s.scan(/[A-Z0-9_.]+/)
|
189
191
|
q.push [:FUNC, s.matched]
|
190
192
|
elsif s.scan(/[A-Za-z_]\w+/)
|
191
193
|
q.push [:NAME , s.matched]
|
data/lib/writeexcel/workbook.rb
CHANGED
@@ -712,7 +712,7 @@ class Workbook < BIFFWriter
|
|
712
712
|
# workbook.set_custom_color(40, 0xFF, 0x66, 0x00) # Same thing
|
713
713
|
# workbook.set_custom_color(40, '#FF6600' ) # Same thing
|
714
714
|
#
|
715
|
-
# font = workbook.add_format(color => 40) # Use the modified colour
|
715
|
+
# font = workbook.add_format(:color => 40) # Use the modified colour
|
716
716
|
#
|
717
717
|
# The return value from set_custom_color() is the index of the colour that
|
718
718
|
# was changed:
|
@@ -720,9 +720,9 @@ class Workbook < BIFFWriter
|
|
720
720
|
# ferrari = workbook.set_custom_color(40, 216, 12, 12)
|
721
721
|
#
|
722
722
|
# format = workbook.add_format(
|
723
|
-
# bg_color => $ferrari,
|
724
|
-
# pattern => 1,
|
725
|
-
# border => 1
|
723
|
+
# :bg_color => $ferrari,
|
724
|
+
# :pattern => 1,
|
725
|
+
# :border => 1
|
726
726
|
# )
|
727
727
|
#
|
728
728
|
def set_custom_color(index = nil, red = nil, green = nil, blue = nil)
|
@@ -973,9 +973,9 @@ class Workbook < BIFFWriter
|
|
973
973
|
# The properties should be passed as a hash of values as follows:
|
974
974
|
#
|
975
975
|
# workbook.set_properties(
|
976
|
-
# title => 'This is an example spreadsheet',
|
977
|
-
# author => 'cxn03651',
|
978
|
-
# comments => 'Created with Ruby and WriteExcel',
|
976
|
+
# :title => 'This is an example spreadsheet',
|
977
|
+
# :author => 'cxn03651',
|
978
|
+
# :comments => 'Created with Ruby and WriteExcel',
|
979
979
|
# )
|
980
980
|
#
|
981
981
|
# The properties that can be set are:
|
@@ -994,7 +994,7 @@ class Workbook < BIFFWriter
|
|
994
994
|
# You can also pass UTF-8 strings as properties.
|
995
995
|
#
|
996
996
|
# $workbook->set_properties(
|
997
|
-
# subject => "住所録",
|
997
|
+
# :subject => "住所録",
|
998
998
|
# );
|
999
999
|
#
|
1000
1000
|
# Usually WriteExcel allows you to use UTF-16. However, document properties
|
@@ -1006,7 +1006,7 @@ class Workbook < BIFFWriter
|
|
1006
1006
|
#
|
1007
1007
|
# workbook.set_properties(
|
1008
1008
|
# ...,
|
1009
|
-
# comments => 'Created with Ruby and WriteExcel',
|
1009
|
+
# :comments => 'Created with Ruby and WriteExcel',
|
1010
1010
|
# ...,
|
1011
1011
|
# )
|
1012
1012
|
#
|
data/test/helper.rb
ADDED
Binary file
|
data/test/test_00_IEEE_double.rb
CHANGED
data/test/test_04_dimensions.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
############################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_dimensions < Test::Unit::TestCase
|
19
16
|
|
data/test/test_05_rows.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
############################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_rows < Test::Unit::TestCase
|
19
16
|
|
data/test/test_06_extsst.rb
CHANGED
@@ -17,10 +17,7 @@
|
|
17
17
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
18
18
|
#
|
19
19
|
############################################################################
|
20
|
-
|
21
|
-
|
22
|
-
require "test/unit"
|
23
|
-
require 'writeexcel'
|
20
|
+
require 'helper'
|
24
21
|
require 'stringio'
|
25
22
|
|
26
23
|
class TC_extsst < Test::Unit::TestCase
|
data/test/test_11_date_time.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
############################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_data_time < Test::Unit::TestCase
|
19
16
|
|
data/test/test_12_date_only.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
############################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_data_only < Test::Unit::TestCase
|
19
16
|
|
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
############################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_data_seconds < Test::Unit::TestCase
|
19
16
|
|
data/test/test_21_escher.rb
CHANGED
@@ -18,10 +18,7 @@
|
|
18
18
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
19
19
|
#
|
20
20
|
############################################################################
|
21
|
-
|
22
|
-
|
23
|
-
require "test/unit"
|
24
|
-
require 'writeexcel'
|
21
|
+
require 'helper'
|
25
22
|
|
26
23
|
class TC_escher < Test::Unit::TestCase
|
27
24
|
|
@@ -15,10 +15,7 @@
|
|
15
15
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
16
16
|
#
|
17
17
|
#########################################################################
|
18
|
-
|
19
|
-
|
20
|
-
require "test/unit"
|
21
|
-
require 'writeexcel'
|
18
|
+
require 'helper'
|
22
19
|
|
23
20
|
class TC_mso_drawing_group < Test::Unit::TestCase
|
24
21
|
|
data/test/test_23_note.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
#########################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_note < Test::Unit::TestCase
|
19
16
|
|
data/test/test_24_txo.rb
CHANGED
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
#########################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_txo < Test::Unit::TestCase
|
19
16
|
|
@@ -13,10 +13,7 @@
|
|
13
13
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
14
14
|
#
|
15
15
|
#########################################################################
|
16
|
-
|
17
|
-
|
18
|
-
require "test/unit"
|
19
|
-
require 'writeexcel'
|
16
|
+
require 'helper'
|
20
17
|
require 'stringio'
|
21
18
|
|
22
19
|
class TC_position_object < Test::Unit::TestCase
|
data/test/test_26_autofilter.rb
CHANGED
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require "test/unit"
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
|
17
14
|
class TC_26_autofilter < Test::Unit::TestCase
|
18
15
|
|
data/test/test_27_autofilter.rb
CHANGED
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require "test/unit"
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
|
17
14
|
class TC_27_autofilter < Test::Unit::TestCase
|
18
15
|
|
data/test/test_28_autofilter.rb
CHANGED
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require "test/unit"
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
|
17
14
|
class TC_28_autofilter < Test::Unit::TestCase
|
18
15
|
|
data/test/test_29_process_jpg.rb
CHANGED
@@ -15,10 +15,7 @@
|
|
15
15
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
16
16
|
#
|
17
17
|
#########################################################################
|
18
|
-
|
19
|
-
|
20
|
-
require "test/unit"
|
21
|
-
require 'writeexcel'
|
18
|
+
require 'helper'
|
22
19
|
require 'stringio'
|
23
20
|
|
24
21
|
class TC_29_process_jpg < Test::Unit::TestCase
|
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require "test/unit"
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
|
17
14
|
class TC_validation_dval < Test::Unit::TestCase
|
18
15
|
|
@@ -10,10 +10,7 @@
|
|
10
10
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
11
11
|
#
|
12
12
|
#########################################################################
|
13
|
-
|
14
|
-
|
15
|
-
require "test/unit"
|
16
|
-
require 'writeexcel'
|
13
|
+
require 'helper'
|
17
14
|
|
18
15
|
class TC_validation_dv_strings < Test::Unit::TestCase
|
19
16
|
|
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require "test/unit"
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
|
17
14
|
class TC_validation_dv_formula < Test::Unit::TestCase
|
18
15
|
|
@@ -9,11 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require 'test/unit'
|
15
|
-
require 'rubygems'
|
16
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
17
13
|
|
18
14
|
class TC_property_types < Test::Unit::TestCase
|
19
15
|
|
data/test/test_41_properties.rb
CHANGED
@@ -9,11 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
|
14
|
-
require 'test/unit'
|
15
|
-
require 'rubygems'
|
16
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
17
13
|
|
18
14
|
class TC_properties < Test::Unit::TestCase
|
19
15
|
|
@@ -15,11 +15,7 @@
|
|
15
15
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
16
16
|
#
|
17
17
|
#########################################################################
|
18
|
-
|
19
|
-
|
20
|
-
require 'test/unit'
|
21
|
-
require 'rubygems'
|
22
|
-
require 'writeexcel'
|
18
|
+
require 'helper'
|
23
19
|
|
24
20
|
class TC_set_properties < Test::Unit::TestCase
|
25
21
|
|
data/test/test_50_name_stored.rb
CHANGED
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
require 'test/unit'
|
14
|
-
require 'rubygems'
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
require 'stringio'
|
17
14
|
|
18
15
|
class TC_Name_Stored < Test::Unit::TestCase
|
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
require 'test/unit'
|
14
|
-
require 'rubygems'
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
require 'stringio'
|
17
14
|
|
18
15
|
class TC_Name_Print_Area < Test::Unit::TestCase
|
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
require 'test/unit'
|
14
|
-
require 'rubygems'
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
require 'stringio'
|
17
14
|
|
18
15
|
class TC_Name_Print_Titles < Test::Unit::TestCase
|
data/test/test_53_autofilter.rb
CHANGED
@@ -9,10 +9,7 @@
|
|
9
9
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
10
10
|
#
|
11
11
|
#########################################################################
|
12
|
-
|
13
|
-
require 'test/unit'
|
14
|
-
require 'rubygems'
|
15
|
-
require 'writeexcel'
|
12
|
+
require 'helper'
|
16
13
|
require 'stringio'
|
17
14
|
|
18
15
|
class TC_autofilter < Test::Unit::TestCase
|