write_xlsx 0.64.1 → 0.65.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +10 -1
- data/examples/conditional_format.rb +251 -18
- data/examples/demo.rb +2 -3
- data/examples/macros.rb +42 -0
- data/examples/outline_collapsed.rb +160 -0
- data/examples/republic.png +0 -0
- data/examples/shape3.rb +2 -2
- data/examples/shape4.rb +5 -5
- data/examples/shape5.rb +6 -6
- data/examples/shape6.rb +6 -6
- data/examples/shape7.rb +11 -11
- data/examples/shape8.rb +10 -10
- data/examples/shape_all.rb +0 -0
- data/examples/vbaProject.bin +0 -0
- data/lib/write_xlsx/chart.rb +656 -56
- data/lib/write_xlsx/chartsheet.rb +26 -2
- data/lib/write_xlsx/format.rb +50 -27
- data/lib/write_xlsx/formats.rb +32 -0
- data/lib/write_xlsx/package/packager.rb +45 -238
- data/lib/write_xlsx/package/table.rb +9 -18
- data/lib/write_xlsx/package/xml_writer_simple.rb +26 -9
- data/lib/write_xlsx/sheets.rb +223 -0
- data/lib/write_xlsx/sparkline.rb +140 -4
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +34 -121
- data/lib/write_xlsx/worksheet/data_validation.rb +291 -0
- data/lib/write_xlsx/worksheet/hyperlink.rb +111 -0
- data/lib/write_xlsx/worksheet/page_setup.rb +170 -0
- data/lib/write_xlsx/worksheet.rb +1112 -1334
- data/test/helper.rb +1 -1
- data/test/package/styles/test_styles_01.rb +1 -10
- data/test/package/styles/test_styles_02.rb +1 -10
- data/test/package/styles/test_styles_03.rb +1 -10
- data/test/package/styles/test_styles_04.rb +1 -10
- data/test/package/styles/test_styles_05.rb +1 -10
- data/test/package/styles/test_styles_06.rb +1 -10
- data/test/package/styles/test_styles_07.rb +1 -10
- data/test/package/styles/test_styles_08.rb +1 -10
- data/test/package/styles/test_styles_09.rb +1 -10
- data/test/perl_output/conditional_format.xlsx +0 -0
- data/test/perl_output/outline_collapsed.xlsx +0 -0
- data/test/perl_output/protection.xlsx +0 -0
- data/test/regression/test_chart_gap01.rb +47 -0
- data/test/regression/test_chart_gap02.rb +47 -0
- data/test/regression/test_chart_gap03.rb +47 -0
- data/test/regression/test_format05.rb +26 -0
- data/test/regression/test_rich_string12.rb +32 -0
- data/test/regression/xlsx_files/chart_gap01.xlsx +0 -0
- data/test/regression/xlsx_files/chart_gap02.xlsx +0 -0
- data/test/regression/xlsx_files/chart_gap03.xlsx +0 -0
- data/test/regression/xlsx_files/format05.xlsx +0 -0
- data/test/regression/xlsx_files/rich_string12.xlsx +0 -0
- data/test/test_example_match.rb +253 -20
- data/test/worksheet/test_set_column.rb +25 -0
- data/test/worksheet/test_worksheet_03.rb +1 -1
- data/test/worksheet/test_worksheet_04.rb +1 -1
- data/test/worksheet/test_write_array_formula_01.rb +7 -0
- data/test/worksheet/test_write_col_breaks.rb +2 -2
- data/test/worksheet/test_write_col_info.rb +8 -8
- data/test/worksheet/test_write_conditional_formatting.rb +4 -4
- data/test/worksheet/test_write_formula_does_not_change_formula_string.rb +18 -0
- data/test/worksheet/test_write_header_footer.rb +8 -3
- data/test/worksheet/test_write_hyperlink.rb +10 -5
- data/test/worksheet/test_write_merge_cells.rb +6 -6
- data/test/worksheet/test_write_page_set_up_pr.rb +1 -1
- data/test/worksheet/test_write_page_setup.rb +1 -1
- data/test/worksheet/test_write_row_breaks.rb +2 -2
- data/test/worksheet/test_write_row_element.rb +1 -1
- data/test/worksheet/test_write_sheet_pr.rb +2 -2
- data/test/worksheet/test_write_sheet_view.rb +0 -9
- data/test/worksheet/test_write_url.rb +19 -0
- data/test/worksheet/test_write_worksheet_attributes.rb +21 -0
- metadata +38 -5
- data/lib/write_xlsx/worksheet/print_style.rb +0 -51
- data/test/worksheet/test_write_worksheet.rb +0 -19
@@ -39,7 +39,7 @@ class TestWriteRow < Test::Unit::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_write_row_6_nil_nil_format
|
42
|
-
format = Writexlsx::Format.new(
|
42
|
+
format = Writexlsx::Format.new(Writexlsx::Formats.new, :xf_index => 1)
|
43
43
|
@worksheet.__send__('write_row_element', 6, nil, nil, format)
|
44
44
|
result = @worksheet.instance_variable_get(:@writer).string
|
45
45
|
expected = '<row r="7" s="1" customFormat="1">'
|
@@ -10,7 +10,7 @@ class TestWriteSheetPr < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_write_sheet_pr_fit_page
|
13
|
-
@worksheet.instance_variable_get(:@
|
13
|
+
@worksheet.instance_variable_get(:@page_setup).fit_page = true
|
14
14
|
@worksheet.__send__('write_sheet_pr')
|
15
15
|
result = @worksheet.instance_variable_get(:@writer).string
|
16
16
|
expected = '<sheetPr><pageSetUpPr fitToPage="1"/></sheetPr>'
|
@@ -26,7 +26,7 @@ class TestWriteSheetPr < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_write_sheet_pr_fit_page_and_tab_color
|
29
|
-
@worksheet.instance_variable_get(:@
|
29
|
+
@worksheet.instance_variable_get(:@page_setup).fit_page = true
|
30
30
|
@worksheet.tab_color = 'red'
|
31
31
|
@worksheet.__send__('write_sheet_pr')
|
32
32
|
result = @worksheet.instance_variable_get(:@writer).string
|
@@ -33,15 +33,6 @@ class TestWriteSheetView < Test::Unit::TestCase
|
|
33
33
|
assert_equal(expected, result)
|
34
34
|
end
|
35
35
|
|
36
|
-
def test_write_sheet_view_tab_selected_and_hide_gridlines_true
|
37
|
-
@worksheet.select
|
38
|
-
@worksheet.hide_gridlines(true)
|
39
|
-
@worksheet.__send__('write_sheet_view')
|
40
|
-
result = @worksheet.instance_variable_get(:@writer).string
|
41
|
-
expected = '<sheetView showGridLines="0" tabSelected="1" workbookViewId="0"/>'
|
42
|
-
assert_equal(expected, result)
|
43
|
-
end
|
44
|
-
|
45
36
|
def test_write_sheet_view_tab_selected_and_hide_gridlines_false
|
46
37
|
@worksheet.select
|
47
38
|
@worksheet.hide_gridlines(false)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
require 'write_xlsx/workbook'
|
4
|
+
require 'write_xlsx/worksheet'
|
5
|
+
require 'stringio'
|
6
|
+
|
7
|
+
class TestWriteUrl < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
@workbook = WriteXLSX.new(StringIO.new)
|
10
|
+
@worksheet = @workbook.add_worksheet('')
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_write_url_does_not_change_url
|
14
|
+
url = 'external:c:\temp\foo.xlsx#my_name'.freeze
|
15
|
+
assert_nothing_raised do
|
16
|
+
@worksheet.write_url('A1', url)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
require 'write_xlsx/workbook'
|
4
|
+
require 'write_xlsx/worksheet'
|
5
|
+
require 'stringio'
|
6
|
+
|
7
|
+
class TestWriteWorksheetAttributes < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
@workbook = WriteXLSX.new(StringIO.new)
|
10
|
+
@worksheet = @workbook.add_worksheet('')
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_write_worksheet_attributes
|
14
|
+
result = @worksheet.__send__('write_worksheet_attributes')
|
15
|
+
expected = [
|
16
|
+
'xmlns', "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
|
17
|
+
'xmlns:r', "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
|
18
|
+
]
|
19
|
+
assert_equal(expected, result)
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: write_xlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.65.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hideo NAKAMURA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- examples/hide_sheet.rb
|
97
97
|
- examples/hyperlink1.rb
|
98
98
|
- examples/indent.rb
|
99
|
+
- examples/macros.rb
|
99
100
|
- examples/merge1.rb
|
100
101
|
- examples/merge2.rb
|
101
102
|
- examples/merge3.rb
|
@@ -103,10 +104,12 @@ files:
|
|
103
104
|
- examples/merge5.rb
|
104
105
|
- examples/merge6.rb
|
105
106
|
- examples/outline.rb
|
107
|
+
- examples/outline_collapsed.rb
|
106
108
|
- examples/panes.rb
|
107
109
|
- examples/properties.rb
|
108
110
|
- examples/protection.rb
|
109
111
|
- examples/regions.rb
|
112
|
+
- examples/republic.png
|
110
113
|
- examples/rich_strings.rb
|
111
114
|
- examples/right_to_left.rb
|
112
115
|
- examples/shape1.rb
|
@@ -145,6 +148,7 @@ files:
|
|
145
148
|
- lib/write_xlsx/compatibility.rb
|
146
149
|
- lib/write_xlsx/drawing.rb
|
147
150
|
- lib/write_xlsx/format.rb
|
151
|
+
- lib/write_xlsx/formats.rb
|
148
152
|
- lib/write_xlsx/package/app.rb
|
149
153
|
- lib/write_xlsx/package/button.rb
|
150
154
|
- lib/write_xlsx/package/comments.rb
|
@@ -160,13 +164,16 @@ files:
|
|
160
164
|
- lib/write_xlsx/package/vml.rb
|
161
165
|
- lib/write_xlsx/package/xml_writer_simple.rb
|
162
166
|
- lib/write_xlsx/shape.rb
|
167
|
+
- lib/write_xlsx/sheets.rb
|
163
168
|
- lib/write_xlsx/sparkline.rb
|
164
169
|
- lib/write_xlsx/utility.rb
|
165
170
|
- lib/write_xlsx/version.rb
|
166
171
|
- lib/write_xlsx/workbook.rb
|
167
172
|
- lib/write_xlsx/worksheet.rb
|
168
173
|
- lib/write_xlsx/worksheet/cell_data.rb
|
169
|
-
- lib/write_xlsx/worksheet/
|
174
|
+
- lib/write_xlsx/worksheet/data_validation.rb
|
175
|
+
- lib/write_xlsx/worksheet/hyperlink.rb
|
176
|
+
- lib/write_xlsx/worksheet/page_setup.rb
|
170
177
|
- lib/write_xlsx/zip_file_utils.rb
|
171
178
|
- test/chart/test_add_series.rb
|
172
179
|
- test/chart/test_process_names.rb
|
@@ -469,6 +476,9 @@ files:
|
|
469
476
|
- test/regression/test_chart_format16.rb
|
470
477
|
- test/regression/test_chart_format17.rb
|
471
478
|
- test/regression/test_chart_format18.rb
|
479
|
+
- test/regression/test_chart_gap01.rb
|
480
|
+
- test/regression/test_chart_gap02.rb
|
481
|
+
- test/regression/test_chart_gap03.rb
|
472
482
|
- test/regression/test_chart_gridlines01.rb
|
473
483
|
- test/regression/test_chart_gridlines02.rb
|
474
484
|
- test/regression/test_chart_gridlines03.rb
|
@@ -567,6 +577,7 @@ files:
|
|
567
577
|
- test/regression/test_format02.rb
|
568
578
|
- test/regression/test_format03.rb
|
569
579
|
- test/regression/test_format04.rb
|
580
|
+
- test/regression/test_format05.rb
|
570
581
|
- test/regression/test_gridlines01.rb
|
571
582
|
- test/regression/test_hyperlink01.rb
|
572
583
|
- test/regression/test_hyperlink02.rb
|
@@ -641,6 +652,7 @@ files:
|
|
641
652
|
- test/regression/test_rich_string09.rb
|
642
653
|
- test/regression/test_rich_string10.rb
|
643
654
|
- test/regression/test_rich_string11.rb
|
655
|
+
- test/regression/test_rich_string12.rb
|
644
656
|
- test/regression/test_row_col_format01.rb
|
645
657
|
- test/regression/test_row_col_format02.rb
|
646
658
|
- test/regression/test_row_col_format03.rb
|
@@ -806,6 +818,9 @@ files:
|
|
806
818
|
- test/regression/xlsx_files/chart_format16.xlsx
|
807
819
|
- test/regression/xlsx_files/chart_format17.xlsx
|
808
820
|
- test/regression/xlsx_files/chart_format18.xlsx
|
821
|
+
- test/regression/xlsx_files/chart_gap01.xlsx
|
822
|
+
- test/regression/xlsx_files/chart_gap02.xlsx
|
823
|
+
- test/regression/xlsx_files/chart_gap03.xlsx
|
809
824
|
- test/regression/xlsx_files/chart_gridlines01.xlsx
|
810
825
|
- test/regression/xlsx_files/chart_gridlines02.xlsx
|
811
826
|
- test/regression/xlsx_files/chart_gridlines03.xlsx
|
@@ -903,6 +918,7 @@ files:
|
|
903
918
|
- test/regression/xlsx_files/format02.xlsx
|
904
919
|
- test/regression/xlsx_files/format03.xlsx
|
905
920
|
- test/regression/xlsx_files/format04.xlsx
|
921
|
+
- test/regression/xlsx_files/format05.xlsx
|
906
922
|
- test/regression/xlsx_files/gridlines01.xlsx
|
907
923
|
- test/regression/xlsx_files/hyperlink01.xlsx
|
908
924
|
- test/regression/xlsx_files/hyperlink02.xlsx
|
@@ -977,6 +993,7 @@ files:
|
|
977
993
|
- test/regression/xlsx_files/rich_string09.xlsx
|
978
994
|
- test/regression/xlsx_files/rich_string10.xlsx
|
979
995
|
- test/regression/xlsx_files/rich_string11.xlsx
|
996
|
+
- test/regression/xlsx_files/rich_string12.xlsx
|
980
997
|
- test/regression/xlsx_files/row_col_format01.xlsx
|
981
998
|
- test/regression/xlsx_files/row_col_format02.xlsx
|
982
999
|
- test/regression/xlsx_files/row_col_format03.xlsx
|
@@ -1062,6 +1079,7 @@ files:
|
|
1062
1079
|
- test/worksheet/test_parse_filter_expression.rb
|
1063
1080
|
- test/worksheet/test_position_object.rb
|
1064
1081
|
- test/worksheet/test_repeat_formula.rb
|
1082
|
+
- test/worksheet/test_set_column.rb
|
1065
1083
|
- test/worksheet/test_sparkline_01.rb
|
1066
1084
|
- test/worksheet/test_sparkline_02.rb
|
1067
1085
|
- test/worksheet/test_sparkline_03.rb
|
@@ -1093,6 +1111,7 @@ files:
|
|
1093
1111
|
- test/worksheet/test_write_filter.rb
|
1094
1112
|
- test/worksheet/test_write_filter_column.rb
|
1095
1113
|
- test/worksheet/test_write_filters.rb
|
1114
|
+
- test/worksheet/test_write_formula_does_not_change_formula_string.rb
|
1096
1115
|
- test/worksheet/test_write_header_footer.rb
|
1097
1116
|
- test/worksheet/test_write_hyperlink.rb
|
1098
1117
|
- test/worksheet/test_write_legacy_drawing.rb
|
@@ -1124,7 +1143,8 @@ files:
|
|
1124
1143
|
- test/worksheet/test_write_sheet_view8.rb
|
1125
1144
|
- test/worksheet/test_write_sheet_view9.rb
|
1126
1145
|
- test/worksheet/test_write_tab_color.rb
|
1127
|
-
- test/worksheet/
|
1146
|
+
- test/worksheet/test_write_url.rb
|
1147
|
+
- test/worksheet/test_write_worksheet_attributes.rb
|
1128
1148
|
- write_xlsx.gemspec
|
1129
1149
|
homepage: http://github.com/cxn03651/write_xlsx#readme
|
1130
1150
|
licenses: []
|
@@ -1451,6 +1471,9 @@ test_files:
|
|
1451
1471
|
- test/regression/test_chart_format16.rb
|
1452
1472
|
- test/regression/test_chart_format17.rb
|
1453
1473
|
- test/regression/test_chart_format18.rb
|
1474
|
+
- test/regression/test_chart_gap01.rb
|
1475
|
+
- test/regression/test_chart_gap02.rb
|
1476
|
+
- test/regression/test_chart_gap03.rb
|
1454
1477
|
- test/regression/test_chart_gridlines01.rb
|
1455
1478
|
- test/regression/test_chart_gridlines02.rb
|
1456
1479
|
- test/regression/test_chart_gridlines03.rb
|
@@ -1549,6 +1572,7 @@ test_files:
|
|
1549
1572
|
- test/regression/test_format02.rb
|
1550
1573
|
- test/regression/test_format03.rb
|
1551
1574
|
- test/regression/test_format04.rb
|
1575
|
+
- test/regression/test_format05.rb
|
1552
1576
|
- test/regression/test_gridlines01.rb
|
1553
1577
|
- test/regression/test_hyperlink01.rb
|
1554
1578
|
- test/regression/test_hyperlink02.rb
|
@@ -1623,6 +1647,7 @@ test_files:
|
|
1623
1647
|
- test/regression/test_rich_string09.rb
|
1624
1648
|
- test/regression/test_rich_string10.rb
|
1625
1649
|
- test/regression/test_rich_string11.rb
|
1650
|
+
- test/regression/test_rich_string12.rb
|
1626
1651
|
- test/regression/test_row_col_format01.rb
|
1627
1652
|
- test/regression/test_row_col_format02.rb
|
1628
1653
|
- test/regression/test_row_col_format03.rb
|
@@ -1788,6 +1813,9 @@ test_files:
|
|
1788
1813
|
- test/regression/xlsx_files/chart_format16.xlsx
|
1789
1814
|
- test/regression/xlsx_files/chart_format17.xlsx
|
1790
1815
|
- test/regression/xlsx_files/chart_format18.xlsx
|
1816
|
+
- test/regression/xlsx_files/chart_gap01.xlsx
|
1817
|
+
- test/regression/xlsx_files/chart_gap02.xlsx
|
1818
|
+
- test/regression/xlsx_files/chart_gap03.xlsx
|
1791
1819
|
- test/regression/xlsx_files/chart_gridlines01.xlsx
|
1792
1820
|
- test/regression/xlsx_files/chart_gridlines02.xlsx
|
1793
1821
|
- test/regression/xlsx_files/chart_gridlines03.xlsx
|
@@ -1885,6 +1913,7 @@ test_files:
|
|
1885
1913
|
- test/regression/xlsx_files/format02.xlsx
|
1886
1914
|
- test/regression/xlsx_files/format03.xlsx
|
1887
1915
|
- test/regression/xlsx_files/format04.xlsx
|
1916
|
+
- test/regression/xlsx_files/format05.xlsx
|
1888
1917
|
- test/regression/xlsx_files/gridlines01.xlsx
|
1889
1918
|
- test/regression/xlsx_files/hyperlink01.xlsx
|
1890
1919
|
- test/regression/xlsx_files/hyperlink02.xlsx
|
@@ -1959,6 +1988,7 @@ test_files:
|
|
1959
1988
|
- test/regression/xlsx_files/rich_string09.xlsx
|
1960
1989
|
- test/regression/xlsx_files/rich_string10.xlsx
|
1961
1990
|
- test/regression/xlsx_files/rich_string11.xlsx
|
1991
|
+
- test/regression/xlsx_files/rich_string12.xlsx
|
1962
1992
|
- test/regression/xlsx_files/row_col_format01.xlsx
|
1963
1993
|
- test/regression/xlsx_files/row_col_format02.xlsx
|
1964
1994
|
- test/regression/xlsx_files/row_col_format03.xlsx
|
@@ -2044,6 +2074,7 @@ test_files:
|
|
2044
2074
|
- test/worksheet/test_parse_filter_expression.rb
|
2045
2075
|
- test/worksheet/test_position_object.rb
|
2046
2076
|
- test/worksheet/test_repeat_formula.rb
|
2077
|
+
- test/worksheet/test_set_column.rb
|
2047
2078
|
- test/worksheet/test_sparkline_01.rb
|
2048
2079
|
- test/worksheet/test_sparkline_02.rb
|
2049
2080
|
- test/worksheet/test_sparkline_03.rb
|
@@ -2075,6 +2106,7 @@ test_files:
|
|
2075
2106
|
- test/worksheet/test_write_filter.rb
|
2076
2107
|
- test/worksheet/test_write_filter_column.rb
|
2077
2108
|
- test/worksheet/test_write_filters.rb
|
2109
|
+
- test/worksheet/test_write_formula_does_not_change_formula_string.rb
|
2078
2110
|
- test/worksheet/test_write_header_footer.rb
|
2079
2111
|
- test/worksheet/test_write_hyperlink.rb
|
2080
2112
|
- test/worksheet/test_write_legacy_drawing.rb
|
@@ -2106,4 +2138,5 @@ test_files:
|
|
2106
2138
|
- test/worksheet/test_write_sheet_view8.rb
|
2107
2139
|
- test/worksheet/test_write_sheet_view9.rb
|
2108
2140
|
- test/worksheet/test_write_tab_color.rb
|
2109
|
-
- test/worksheet/
|
2141
|
+
- test/worksheet/test_write_url.rb
|
2142
|
+
- test/worksheet/test_write_worksheet_attributes.rb
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
module Writexlsx
|
4
|
-
class Worksheet
|
5
|
-
class PrintStyle # :nodoc:
|
6
|
-
attr_accessor :margin_left, :margin_right, :margin_top, :margin_bottom # :nodoc:
|
7
|
-
attr_accessor :margin_header, :margin_footer # :nodoc:
|
8
|
-
attr_accessor :repeat_rows, :repeat_cols, :print_area # :nodoc:
|
9
|
-
attr_accessor :hbreaks, :vbreaks, :scale # :nodoc:
|
10
|
-
attr_accessor :fit_page, :fit_width, :fit_height, :page_setup_changed # :nodoc:
|
11
|
-
attr_accessor :across # :nodoc:
|
12
|
-
attr_accessor :orientation # :nodoc:
|
13
|
-
|
14
|
-
def initialize # :nodoc:
|
15
|
-
@margin_left = 0.7
|
16
|
-
@margin_right = 0.7
|
17
|
-
@margin_top = 0.75
|
18
|
-
@margin_bottom = 0.75
|
19
|
-
@margin_header = 0.3
|
20
|
-
@margin_footer = 0.3
|
21
|
-
@repeat_rows = ''
|
22
|
-
@repeat_cols = ''
|
23
|
-
@print_area = ''
|
24
|
-
@hbreaks = []
|
25
|
-
@vbreaks = []
|
26
|
-
@scale = 100
|
27
|
-
@fit_page = false
|
28
|
-
@fit_width = nil
|
29
|
-
@fit_height = nil
|
30
|
-
@page_setup_changed = false
|
31
|
-
@across = false
|
32
|
-
@orientation = true
|
33
|
-
end
|
34
|
-
|
35
|
-
def attributes # :nodoc:
|
36
|
-
[
|
37
|
-
'left', @margin_left,
|
38
|
-
'right', @margin_right,
|
39
|
-
'top', @margin_top,
|
40
|
-
'bottom', @margin_bottom,
|
41
|
-
'header', @margin_header,
|
42
|
-
'footer', @margin_footer
|
43
|
-
]
|
44
|
-
end
|
45
|
-
|
46
|
-
def orientation?
|
47
|
-
!!@orientation
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require 'helper'
|
3
|
-
require 'write_xlsx/workbook'
|
4
|
-
require 'write_xlsx/worksheet'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
class TestWriteWorksheet < Test::Unit::TestCase
|
8
|
-
def setup
|
9
|
-
@workbook = WriteXLSX.new(StringIO.new)
|
10
|
-
@worksheet = @workbook.add_worksheet('')
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_write_worksheet
|
14
|
-
@worksheet.__send__('write_worksheet')
|
15
|
-
result = @worksheet.instance_variable_get(:@writer).string
|
16
|
-
expected = '<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'
|
17
|
-
assert_equal(expected, result)
|
18
|
-
end
|
19
|
-
end
|