write_xlsx 0.90.0 → 0.97.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +37 -0
- data/README.md +1 -1
- data/examples/a_simple.rb +1 -6
- data/examples/conditional_format.rb +73 -46
- data/examples/demo.rb +1 -7
- data/examples/hyperlink1.rb +4 -11
- data/lib/write_xlsx/chart.rb +81 -205
- data/lib/write_xlsx/chart/axis.rb +2 -2
- data/lib/write_xlsx/chart/caption.rb +3 -1
- data/lib/write_xlsx/chart/pie.rb +2 -0
- data/lib/write_xlsx/chart/series.rb +11 -7
- data/lib/write_xlsx/format.rb +15 -11
- data/lib/write_xlsx/package/conditional_format.rb +351 -38
- data/lib/write_xlsx/package/content_types.rb +10 -0
- data/lib/write_xlsx/package/custom.rb +125 -0
- data/lib/write_xlsx/package/packager.rb +26 -0
- data/lib/write_xlsx/package/styles.rb +53 -21
- data/lib/write_xlsx/package/table.rb +11 -4
- data/lib/write_xlsx/utility.rb +234 -34
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +88 -1
- data/lib/write_xlsx/worksheet.rb +247 -23
- data/test/helper.rb +6 -1
- data/test/regression/_test_hyperlink31.rb +26 -0
- data/test/regression/images/zero_dpi.jpg +0 -0
- data/test/regression/test_chart_bar08.rb +3 -0
- data/test/regression/test_chart_bar11.rb +3 -0
- data/test/regression/test_chart_bar14.rb +3 -0
- data/test/regression/test_chart_chartarea05.rb +16 -17
- data/test/regression/test_chart_chartarea06.rb +49 -0
- data/test/regression/test_chart_data_labels25.rb +61 -0
- data/test/regression/test_chart_format26.rb +48 -0
- data/test/regression/test_chart_format27.rb +58 -0
- data/test/regression/test_chart_format28.rb +52 -0
- data/test/regression/test_chart_format29.rb +59 -0
- data/test/regression/test_chart_format30.rb +53 -0
- data/test/regression/test_chart_format31.rb +60 -0
- data/test/regression/test_chart_table03.rb +56 -0
- data/test/regression/test_cond_format14.rb +42 -0
- data/test/regression/test_cond_format15.rb +53 -0
- data/test/regression/test_cond_format16.rb +53 -0
- data/test/regression/test_cond_format17.rb +37 -0
- data/test/regression/test_cond_format18.rb +136 -0
- data/test/regression/test_date_1904_01.rb +1 -1
- data/test/regression/test_escapes04.rb +3 -0
- data/test/regression/test_escapes05.rb +3 -0
- data/test/regression/test_escapes07.rb +3 -0
- data/test/regression/test_escapes08.rb +3 -0
- data/test/regression/test_hyperlink01.rb +3 -0
- data/test/regression/test_hyperlink02.rb +3 -0
- data/test/regression/test_hyperlink03.rb +4 -0
- data/test/regression/test_hyperlink04.rb +3 -0
- data/test/regression/test_hyperlink05.rb +3 -0
- data/test/regression/test_hyperlink06.rb +3 -0
- data/test/regression/test_hyperlink07.rb +3 -0
- data/test/regression/test_hyperlink08.rb +3 -0
- data/test/regression/test_hyperlink09.rb +3 -0
- data/test/regression/test_hyperlink10.rb +3 -0
- data/test/regression/test_hyperlink11.rb +3 -0
- data/test/regression/test_hyperlink12.rb +3 -0
- data/test/regression/test_hyperlink13.rb +3 -0
- data/test/regression/test_hyperlink14.rb +3 -0
- data/test/regression/test_hyperlink15.rb +3 -0
- data/test/regression/test_hyperlink16.rb +3 -0
- data/test/regression/test_hyperlink17.rb +3 -0
- data/test/regression/test_hyperlink18.rb +3 -0
- data/test/regression/test_hyperlink20.rb +3 -0
- data/test/regression/test_hyperlink21.rb +3 -0
- data/test/regression/test_hyperlink22.rb +3 -0
- data/test/regression/test_hyperlink23.rb +3 -0
- data/test/regression/test_hyperlink24.rb +3 -0
- data/test/regression/test_hyperlink25.rb +3 -0
- data/test/regression/test_hyperlink26.rb +3 -0
- data/test/regression/test_hyperlink27.rb +3 -0
- data/test/regression/test_hyperlink28.rb +50 -0
- data/test/regression/test_hyperlink29.rb +27 -0
- data/test/regression/test_hyperlink30.rb +36 -0
- data/test/regression/test_image35.rb +26 -0
- data/test/regression/test_properties01.rb +1 -4
- data/test/regression/test_properties02.rb +1 -4
- data/test/regression/test_properties03.rb +26 -0
- data/test/regression/test_properties04.rb +61 -0
- data/test/regression/test_properties05.rb +30 -0
- data/test/regression/test_table03.rb +3 -0
- data/test/regression/test_table04.rb +3 -0
- data/test/regression/test_table05.rb +3 -0
- data/test/regression/test_table06.rb +3 -0
- data/test/regression/test_table20.rb +34 -0
- data/test/regression/test_table21.rb +36 -0
- data/test/regression/test_table22.rb +32 -0
- data/test/regression/xlsx_files/chart_chartarea05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_chartarea06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels25.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format26.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format27.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format28.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format29.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format30.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format31.xlsx +0 -0
- data/test/regression/xlsx_files/chart_table03.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format14.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format15.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format16.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format17.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format18.xlsx +0 -0
- data/test/regression/xlsx_files/date_1904_01.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink28.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink29.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink30.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink31.xlsx +0 -0
- data/test/regression/xlsx_files/image35.xlsx +0 -0
- data/test/regression/xlsx_files/properties03.xlsx +0 -0
- data/test/regression/xlsx_files/properties04.xlsx +0 -0
- data/test/regression/xlsx_files/properties05.xlsx +0 -0
- data/test/regression/xlsx_files/table21.xlsx +0 -0
- data/test/regression/xlsx_files/table22.xlsx +0 -0
- data/test/workbook/test_write_workbook_view.rb +81 -0
- data/test/worksheet/test_cond_format_22.rb +266 -0
- data/test/worksheet/test_cond_format_23.rb +242 -0
- data/test/worksheet/test_cond_format_24.rb +303 -0
- data/test/worksheet/test_data_bar_01.rb +53 -0
- data/test/worksheet/test_data_bar_02.rb +79 -0
- data/test/worksheet/test_data_bar_03.rb +147 -0
- data/test/worksheet/test_data_bar_04.rb +145 -0
- data/test/worksheet/test_data_bar_05.rb +147 -0
- data/test/worksheet/test_data_bar_06.rb +145 -0
- data/test/worksheet/test_data_bar_07.rb +146 -0
- data/test/worksheet/test_data_bar_08.rb +54 -0
- data/test/worksheet/test_data_bar_09.rb +80 -0
- data/test/worksheet/test_data_bar_10.rb +165 -0
- data/test/worksheet/test_data_bar_11.rb +167 -0
- data/test/worksheet/test_data_bar_12.rb +104 -0
- data/test/worksheet/test_write_data_validation_02.rb +27 -0
- metadata +135 -2
@@ -18,7 +18,7 @@ def test_date_1904_01
|
|
18
18
|
|
19
19
|
worksheet.set_column('A:A', 12)
|
20
20
|
|
21
|
-
worksheet.write_date_time('A1', '1900-01-
|
21
|
+
worksheet.write_date_time('A1', '1900-01-01T', format)
|
22
22
|
worksheet.write_date_time('A2', '1902-09-26T', format)
|
23
23
|
worksheet.write_date_time('A3', '1913-09-08T', format)
|
24
24
|
worksheet.write_date_time('A4', '1927-05-18T', format)
|
@@ -15,6 +15,9 @@ def test_escapes04
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'http://www.perl.com/?a=1&b=2')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -16,6 +16,9 @@ def test_escapes05
|
|
16
16
|
worksheet1 = workbook.add_worksheet('Start')
|
17
17
|
worksheet2 = workbook.add_worksheet('A & B')
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet1.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet1.write_url('A1', "internal:'A & B'!A1", 'Jump to A & B')
|
20
23
|
|
21
24
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_escapes07
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url(
|
19
22
|
'A1',
|
20
23
|
"http://example.com/!\"$%&'( )*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
@@ -15,6 +15,9 @@ def test_escapes08
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
# Test an already escaped string.
|
19
22
|
worksheet.write_url(
|
20
23
|
'A1',
|
@@ -15,6 +15,9 @@ def test_hyperlink01
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write('A1', 'http://www.perl.org/')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink02
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write('A1', 'http://www.perl.org/')
|
19
22
|
worksheet.write('D4', 'http://www.perl.org/')
|
20
23
|
worksheet.write('A8', 'http://www.perl.org/')
|
@@ -16,6 +16,10 @@ def test_hyperlink03
|
|
16
16
|
worksheet1 = workbook.add_worksheet
|
17
17
|
worksheet2 = workbook.add_worksheet
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet1.instance_variable_set(:@default_url_format, nil)
|
21
|
+
worksheet2.instance_variable_set(:@default_url_format, nil)
|
22
|
+
|
19
23
|
worksheet1.write_url('A1', 'http://www.perl.org/')
|
20
24
|
worksheet1.write_url('D4', 'http://www.perl.org/')
|
21
25
|
worksheet1.write_url('A8', 'http://www.perl.org/')
|
@@ -17,6 +17,9 @@ def test_hyperlink04
|
|
17
17
|
worksheet2 = workbook.add_worksheet
|
18
18
|
worksheet3 = workbook.add_worksheet('Data Sheet')
|
19
19
|
|
20
|
+
# Turn off default URL format for testing.
|
21
|
+
worksheet1.instance_variable_set(:@default_url_format, nil)
|
22
|
+
|
20
23
|
worksheet1.write_url('A1', "internal:Sheet2!A1")
|
21
24
|
worksheet1.write_url('A3', "internal:Sheet2!A1:A5")
|
22
25
|
worksheet1.write_url('A5', "internal:'Data Sheet'!D5", 'Some text')
|
@@ -15,6 +15,9 @@ def test_hyperlink05
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'http://www.perl.org/')
|
19
22
|
worksheet.write_url('A3', 'http://www.perl.org/', 'Perl home')
|
20
23
|
worksheet.write_url('A5', 'http://www.perl.org/', 'Perl home', nil, 'Tool Tip')
|
@@ -15,6 +15,9 @@ def test_hyperlink06
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'external:C:\Temp\foo.xlsx')
|
19
22
|
worksheet.write_url('A3', 'external:C:\Temp\foo.xlsx#Sheet1!A1')
|
20
23
|
worksheet.write_url('A5', 'external:C:\Temp\foo.xlsx#Sheet1!A1', 'External', nil, 'Tip')
|
@@ -11,6 +11,9 @@ def test_hyperlink07
|
|
11
11
|
workbook = WriteXLSX.new(@io)
|
12
12
|
worksheet = workbook.add_worksheet
|
13
13
|
|
14
|
+
# Turn off default URL format for testing.
|
15
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
16
|
+
|
14
17
|
worksheet.write_url('A1', 'external:\\\\VBOXSVR\share\foo.xlsx', 'J:\foo.xlsx')
|
15
18
|
worksheet.write_url('A3', 'external:foo.xlsx')
|
16
19
|
|
@@ -15,6 +15,9 @@ def test_hyperlink08
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'external://VBOXSVR/share/foo.xlsx', 'J:/foo.xlsx')
|
19
22
|
worksheet.write_url('A3', 'external:foo.xlsx')
|
20
23
|
|
@@ -15,6 +15,9 @@ def test_hyperlink09
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'external:..\foo.xlsx')
|
19
22
|
worksheet.write_url('A3', 'external:..\foo.xlsx#Sheet1!A1')
|
20
23
|
worksheet.write_url('A5', 'external:\\\\VBOXSVR\share\foo.xlsx#Sheet1!B2', 'J:\foo.xlsx#Sheet1!B2')
|
@@ -16,6 +16,9 @@ def test_hyperlink10
|
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
format = workbook.add_format(:color => 'red', :underline => 1)
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet.write_url('A1', 'http://www.perl.org/', format)
|
20
23
|
|
21
24
|
workbook.close
|
@@ -16,6 +16,9 @@ def test_hyperlink11
|
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
format = workbook.add_format(:color => 'blue', :underline => 1)
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet.write_url('A1', 'http://www.perl.org/', format)
|
20
23
|
|
21
24
|
workbook.close
|
@@ -16,6 +16,9 @@ def test_hyperlink12
|
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
format = workbook.add_format(:color => 'blue', :underline => 1)
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet.write_url('A1', 'mailto:jmcnamara@cpan.org', format)
|
20
23
|
worksheet.write_url('A3', 'ftp://perl.org/', format)
|
21
24
|
|
@@ -16,6 +16,9 @@ def test_hyperlink13
|
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
format = workbook.add_format(:align => 'center')
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet.merge_range('C4:E5', 'http://www.perl.org/', format)
|
20
23
|
|
21
24
|
workbook.close
|
@@ -16,6 +16,9 @@ def test_hyperlink14
|
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
format = workbook.add_format(:align => 'center')
|
18
18
|
|
19
|
+
# Turn off default URL format for testing.
|
20
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
21
|
+
|
19
22
|
worksheet.merge_range('C4:E5', 'http://www.perl.org/', format, 'Perl Home')
|
20
23
|
|
21
24
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink15
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('B2', 'external:./subdir/blank.xlsx')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink16
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('B2', 'external:./subdir/blank.xlsx')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink17
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
# Test URL with whitespace.
|
19
22
|
worksheet.write_url('A1', 'http://google.com/some link')
|
20
23
|
|
@@ -15,6 +15,9 @@ def test_hyperlink18
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
# Test long URL at Excel limit.
|
19
22
|
worksheet.write_url('A1', 'http://google.com/00000000001111111111222222222233333333334444444444555555555566666666666777777777778888888888999999999990000000000111111111122222222223333333333444444444455555555556666666666677777777777888888888899999999999000000000011111111112222222222x')
|
20
23
|
|
@@ -19,6 +19,9 @@ def test_hyperlink20
|
|
19
19
|
format1 = workbook.add_format(:color => 'blue', :underline => 1)
|
20
20
|
format2 = workbook.add_format(:color => 'red', :underline => 1)
|
21
21
|
|
22
|
+
# Turn off default URL format for testing.
|
23
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
24
|
+
|
22
25
|
worksheet.write_url('A1', 'http://www.python.org/1', format1)
|
23
26
|
worksheet.write_url('A2', 'http://www.python.org/2', format2)
|
24
27
|
|
@@ -15,6 +15,9 @@ def test_hyperlink21
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'external:C:\Temp\Test 1')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink22
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'external:\\\\Vboxsvr\share\foo bar.xlsx')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink23
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'https://en.wikipedia.org/wiki/Microsoft_Excel#Data_storage_and_communication', 'Display text')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink24
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'http://www.example.com/some_long_url_that_is_255_characters_long_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_z#some_long_location_that_is_255_characters_long_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_abcdefgh_z')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink25
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'http://www.google.com/#foo#bar')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink26
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', 'http://www.google.com/foo#bar#baz')
|
19
22
|
|
20
23
|
workbook.close
|
@@ -15,6 +15,9 @@ def test_hyperlink27
|
|
15
15
|
workbook = WriteXLSX.new(@io)
|
16
16
|
worksheet = workbook.add_worksheet
|
17
17
|
|
18
|
+
# Turn off default URL format for testing.
|
19
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
20
|
+
|
18
21
|
worksheet.write_url('A1', %q(external:\\\\Vboxsvr\share\foo bar.xlsx#'Some Sheet'!A1))
|
19
22
|
|
20
23
|
workbook.close
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionHyperlink28 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true) if @tempfile
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_hyperlink28
|
14
|
+
@xlsx = 'hyperlink28.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
format = workbook.add_format(:hyperlink => 1)
|
18
|
+
|
19
|
+
worksheet.write_url('A1', 'http://www.perl.org/', format)
|
20
|
+
|
21
|
+
workbook.close
|
22
|
+
|
23
|
+
compare_for_regression
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_hyperlink28_2
|
27
|
+
@xlsx = 'hyperlink28.xlsx'
|
28
|
+
workbook = WriteXLSX.new(@io)
|
29
|
+
worksheet = workbook.add_worksheet
|
30
|
+
|
31
|
+
worksheet.write_url('A1', 'http://www.perl.org/')
|
32
|
+
|
33
|
+
workbook.close
|
34
|
+
|
35
|
+
compare_for_regression
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_hyperlink28_3
|
39
|
+
@xlsx = 'hyperlink28.xlsx'
|
40
|
+
workbook = WriteXLSX.new(@io)
|
41
|
+
worksheet = workbook.add_worksheet
|
42
|
+
format = workbook.get_default_url_format
|
43
|
+
|
44
|
+
worksheet.write_url('A1', 'http://www.perl.org/', format)
|
45
|
+
|
46
|
+
workbook.close
|
47
|
+
|
48
|
+
compare_for_regression
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionHyperlink29 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true) if @tempfile
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_hyperlink29
|
14
|
+
@xlsx = 'hyperlink29.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
format1 = workbook.add_format(:hyperlink => 1)
|
18
|
+
format2 = workbook.add_format(:color => 'red', :underline => 1)
|
19
|
+
|
20
|
+
worksheet.write_url('A1', 'http://www.perl.org/', format1)
|
21
|
+
worksheet.write_url('A2', 'http://www.perl.com/', format2)
|
22
|
+
|
23
|
+
workbook.close
|
24
|
+
|
25
|
+
compare_for_regression
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionHyperlink30 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true) if @tempfile
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_hyperlink30
|
14
|
+
@xlsx = 'hyperlink30.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
|
17
|
+
# Simulate custom color for testing.
|
18
|
+
workbook.instance_variable_set(:@custom_colors, ['FF0000FF'])
|
19
|
+
|
20
|
+
worksheet = workbook.add_worksheet
|
21
|
+
format1 = workbook.add_format(:hyperlink => 1)
|
22
|
+
format2 = workbook.add_format(:color => 'red', :underline => 1)
|
23
|
+
format3 = workbook.add_format(:color => 'blue', :underline => 1)
|
24
|
+
|
25
|
+
# Turn off default URL format for testing.
|
26
|
+
worksheet.instance_variable_set(:@default_url_format, nil)
|
27
|
+
|
28
|
+
worksheet.write_url('A1', 'http://www.python.org/1', format1)
|
29
|
+
worksheet.write_url('A2', 'http://www.python.org/2', format2)
|
30
|
+
worksheet.write_url('A3', 'http://www.python.org/3', format3)
|
31
|
+
|
32
|
+
workbook.close
|
33
|
+
|
34
|
+
compare_for_regression
|
35
|
+
end
|
36
|
+
end
|