writeexcel 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +8 -0
- data/README.rdoc +9 -1
- data/examples/a_simple.rb +0 -1
- data/examples/chart_area.rb +0 -1
- data/examples/chart_legend.rb +0 -1
- data/examples/copyformat.rb +0 -1
- data/examples/data_validate.rb +1 -2
- data/examples/date_time.rb +0 -1
- data/examples/demo.rb +0 -1
- data/examples/diag_border.rb +0 -1
- data/examples/formats.rb +0 -1
- data/examples/header.rb +0 -1
- data/examples/hide_sheet.rb +0 -1
- data/examples/hyperlink.rb +0 -1
- data/examples/hyperlink2.rb +0 -1
- data/examples/images.rb +0 -1
- data/examples/merge1.rb +0 -1
- data/examples/merge2.rb +0 -1
- data/examples/merge3.rb +0 -1
- data/examples/merge4.rb +0 -1
- data/examples/merge5.rb +0 -1
- data/examples/password_protection.rb +0 -1
- data/examples/properties.rb +0 -1
- data/examples/properties_jp.rb +0 -1
- data/examples/protection.rb +0 -1
- data/examples/regions.rb +0 -1
- data/examples/repeat.rb +0 -1
- data/examples/set_first_sheet.rb +0 -1
- data/examples/stocks.rb +0 -1
- data/examples/store_formula.rb +0 -1
- data/examples/tab_colors.rb +0 -1
- data/examples/write_arrays.rb +0 -1
- data/lib/writeexcel/biffwriter.rb +2 -1
- data/lib/writeexcel/chart.rb +2 -3
- data/lib/writeexcel/charts/area.rb +1 -1
- data/lib/writeexcel/charts/pie.rb +1 -1
- data/lib/writeexcel/charts/scatter.rb +1 -1
- data/lib/writeexcel/charts/stock.rb +1 -1
- data/lib/writeexcel/col_info.rb +2 -2
- data/lib/writeexcel/comments.rb +1 -1
- data/lib/writeexcel/convert_date_time.rb +7 -7
- data/lib/writeexcel/excelformulaparser.rb +49 -49
- data/lib/writeexcel/format.rb +1 -1
- data/lib/writeexcel/formula.rb +2 -6
- data/lib/writeexcel/helper.rb +3 -3
- data/lib/writeexcel/properties.rb +1 -1
- data/lib/writeexcel/shared_string_table.rb +5 -5
- data/lib/writeexcel/storage_lite.rb +2 -9
- data/lib/writeexcel/version.rb +1 -1
- data/lib/writeexcel/workbook.rb +13 -14
- data/lib/writeexcel/worksheet.rb +43 -35
- data/test/helper.rb +12 -5
- data/test/test_00_IEEE_double.rb +1 -1
- data/test/test_04_dimensions.rb +2 -2
- data/test/test_05_rows.rb +1 -1
- data/test/test_06_extsst.rb +1 -1
- data/test/test_11_date_time.rb +1 -1
- data/test/test_12_date_only.rb +1 -1
- data/test/test_13_date_seconds.rb +1 -1
- data/test/test_21_escher.rb +1 -1
- data/test/test_22_mso_drawing_group.rb +1 -1
- data/test/test_23_note.rb +1 -1
- data/test/test_24_txo.rb +1 -1
- data/test/test_25_position_object.rb +1 -1
- data/test/test_26_autofilter.rb +1 -1
- data/test/test_27_autofilter.rb +1 -1
- data/test/test_28_autofilter.rb +1 -1
- data/test/test_29_process_jpg.rb +1 -43
- data/test/test_30_validation_dval.rb +1 -1
- data/test/test_31_validation_dv_strings.rb +1 -1
- data/test/test_32_validation_dv_formula.rb +1 -1
- data/test/test_40_property_types.rb +1 -1
- data/test/test_41_properties.rb +1 -1
- data/test/test_42_set_properties.rb +2 -2
- data/test/test_50_name_stored.rb +1 -9
- data/test/test_51_name_print_area.rb +3 -13
- data/test/test_52_name_print_titles.rb +3 -21
- data/test/test_53_autofilter.rb +1 -5
- data/test/test_60_chart_generic.rb +3 -3
- data/test/test_61_chart_subclasses.rb +2 -1
- data/test/test_62_chart_formats.rb +9 -21
- data/test/test_63_chart_area_formats.rb +1 -1
- data/test/test_compatibility.rb +1 -1
- data/test/test_example_match.rb +835 -835
- data/test/test_format.rb +1 -114
- data/test/test_formula.rb +1 -1
- data/test/test_properties.rb +1 -2
- data/test/test_storage_lite.rb +2 -2
- data/test/test_workbook.rb +1 -66
- data/test/test_worksheet.rb +1 -18
- data/test/test_write_formula_does_not_change_formula_string.rb +1 -1
- data/writeexcel.gemspec +4 -1
- metadata +38 -19
- data/test/test_01_add_worksheet.rb +0 -43
- data/test/test_02_merge_formats.rb +0 -49
- data/test/test_biff.rb +0 -71
- data/test/test_big_workbook.rb +0 -17
- data/test/test_ole.rb +0 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aef741d4929e644f22197dc922a779d1049e686bcda4458f8fdd07a1dc6d45a0
|
4
|
+
data.tar.gz: 7431195b6609b5220f0a72cab8df664594c2ad1a1f2124187fe13515c2dd9d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ced7ba9cea632a819acd69fd242a03939abd331eca99f3ff2604ea8429998fd467ee795bbbbef5a6ce1b3f66ed970b57583f6d0c85f9aefc311247aaba39c5ae
|
7
|
+
data.tar.gz: 38955288d47faa5dc1ec3b8aad5960b0bcac352b61c8503b975eb1c0446ae41785a306b84952797883621cc38f241a9e3343b364f5b8060abee869221fbff1aa
|
data/.travis.yml
ADDED
data/README.rdoc
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
Write to a cross-platform Excel binary file.
|
4
4
|
|
5
5
|
{<img src="https://badge.fury.io/rb/writeexcel.png" alt="Gem Version" />}[http://badge.fury.io/rb/writeexcel]
|
6
|
+
{<img src="https://travis-ci.org/cxn03651/writeexcel.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/cxn03651/writeexcel]
|
6
7
|
|
7
8
|
== Description
|
8
9
|
|
@@ -84,6 +85,13 @@ Example Code:
|
|
84
85
|
* and ......
|
85
86
|
|
86
87
|
== Recent Change
|
88
|
+
v1.0.6
|
89
|
+
* support Ruby 3.2
|
90
|
+
* use minitest gem instead of test-unit.
|
91
|
+
|
92
|
+
v1.0.5
|
93
|
+
* use test-unit gem instead of test/unit.
|
94
|
+
|
87
95
|
v1.0.4
|
88
96
|
* put formula parsers classes in a module to avoid namespace conflicts. (thanks Kevin)
|
89
97
|
|
@@ -105,7 +113,7 @@ v1.0.0
|
|
105
113
|
Original was written in Perl by John McNamara (jmcnamara@cpan.org).
|
106
114
|
|
107
115
|
Convert to ruby by Hideo Nakamura (cxn03651@msj.biglobe.ne.jp)
|
108
|
-
Copyright (c) 2009-
|
116
|
+
Copyright (c) 2009-2014 Hideo NAKAMURA. See LICENSE.txt for details.
|
109
117
|
|
110
118
|
== License
|
111
119
|
|
data/examples/a_simple.rb
CHANGED
data/examples/chart_area.rb
CHANGED
data/examples/chart_legend.rb
CHANGED
data/examples/copyformat.rb
CHANGED
data/examples/data_validate.rb
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
13
13
|
#
|
14
14
|
|
15
|
-
require 'rubygems'
|
16
15
|
require 'writeexcel'
|
17
16
|
|
18
17
|
workbook = WriteExcel.new('data_validate.xls')
|
@@ -152,7 +151,7 @@ worksheet.write(row, 0, txt)
|
|
152
151
|
worksheet.data_validation(row, 1,
|
153
152
|
{
|
154
153
|
:validate => 'list',
|
155
|
-
:source => '
|
154
|
+
:source => '=$E$4:$G$4'
|
156
155
|
})
|
157
156
|
|
158
157
|
|
data/examples/date_time.rb
CHANGED
data/examples/demo.rb
CHANGED
data/examples/diag_border.rb
CHANGED
data/examples/formats.rb
CHANGED
data/examples/header.rb
CHANGED
data/examples/hide_sheet.rb
CHANGED
data/examples/hyperlink.rb
CHANGED
data/examples/hyperlink2.rb
CHANGED
data/examples/images.rb
CHANGED
data/examples/merge1.rb
CHANGED
data/examples/merge2.rb
CHANGED
data/examples/merge3.rb
CHANGED
data/examples/merge4.rb
CHANGED
data/examples/merge5.rb
CHANGED
data/examples/properties.rb
CHANGED
data/examples/properties_jp.rb
CHANGED
data/examples/protection.rb
CHANGED
data/examples/regions.rb
CHANGED
data/examples/repeat.rb
CHANGED
data/examples/set_first_sheet.rb
CHANGED
data/examples/stocks.rb
CHANGED
data/examples/store_formula.rb
CHANGED
data/examples/tab_colors.rb
CHANGED
data/examples/write_arrays.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
#
|
3
4
|
# BIFFwriter - An abstract base class for Excel workbooks and worksheets.
|
4
5
|
#
|
@@ -187,7 +188,7 @@ class BIFFWriter < WriteFile #:nodoc:
|
|
187
188
|
# The header contains version and instance info packed into 2 bytes.
|
188
189
|
header = version | (instance << 4)
|
189
190
|
|
190
|
-
|
191
|
+
[header, type, length].pack('vvV') + data
|
191
192
|
end
|
192
193
|
|
193
194
|
def not_using_tmpfile
|
data/lib/writeexcel/chart.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
###############################################################################
|
3
4
|
#
|
4
5
|
# Chart - A writer class for Excel Charts.
|
@@ -649,8 +650,6 @@ class Chart < Worksheet
|
|
649
650
|
# information required for _store_series() and the SERIES record.
|
650
651
|
#
|
651
652
|
def parse_series_formula(formula) # :nodoc:
|
652
|
-
encoding = 0
|
653
|
-
length = 0
|
654
653
|
count = 0
|
655
654
|
tokens = []
|
656
655
|
|
@@ -677,7 +676,7 @@ class Chart < Worksheet
|
|
677
676
|
|
678
677
|
# Extract the range from the parse formula.
|
679
678
|
if formula.ord == 0x3B
|
680
|
-
|
679
|
+
row_1, row_2 = formula.unpack('Cv5')[2, 2]
|
681
680
|
|
682
681
|
# TODO. Remove high bit on relative references.
|
683
682
|
count = row_2 - row_1 + 1
|
data/lib/writeexcel/col_info.rb
CHANGED
data/lib/writeexcel/comments.rb
CHANGED
@@ -81,7 +81,7 @@ module ConvertDateTime
|
|
81
81
|
epoch = date_1904 ? 1904 : 1900
|
82
82
|
offset = date_1904 ? 4 : 0
|
83
83
|
norm = 300
|
84
|
-
range = year -epoch
|
84
|
+
range = year - epoch
|
85
85
|
|
86
86
|
# Set month days and check for leap year.
|
87
87
|
mdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
@@ -92,15 +92,15 @@ module ConvertDateTime
|
|
92
92
|
# Some boundary checks
|
93
93
|
return nil if year < epoch or year > 9999
|
94
94
|
return nil if month < 1 or month > 12
|
95
|
-
return nil if day < 1 or day > mdays[month -1]
|
95
|
+
return nil if day < 1 or day > mdays[month - 1]
|
96
96
|
|
97
97
|
# Accumulate the number of days since the epoch.
|
98
98
|
days = mdays[0, month - 1].inject(day) {|result, mday| result + mday} # days from 1, Jan
|
99
|
-
days += range *365
|
100
|
-
days += ((range)
|
101
|
-
days -= ((range + offset)
|
102
|
-
days += ((range + offset + norm)/400) # Add 400 year leapdays
|
103
|
-
days -= leap
|
99
|
+
days += range * 365 # Add days for past years
|
100
|
+
days += ((range) / 4) # Add leapdays
|
101
|
+
days -= ((range + offset) / 100) # Subtract 100 year leapdays
|
102
|
+
days += ((range + offset + norm) / 400) # Add 400 year leapdays
|
103
|
+
days -= leap # Already counted above
|
104
104
|
|
105
105
|
# Adjust for Excel erroneously treating 1900 as a leap year.
|
106
106
|
days += 1 if !date_1904 and days > 59
|