spreadsheet 0.9.6 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.travis.yml +1 -0
- data/Excel97-2007BinaryFileFormatSpecification.pdf +0 -0
- data/GUIDE.md +7 -1
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -3
- data/History.md +23 -0
- data/Manifest.txt +1 -0
- data/README.md +2 -7
- data/excelfileformat.pdf +0 -0
- data/lib/spreadsheet/excel/internals.rb +8 -8
- data/lib/spreadsheet/excel/reader.rb +11 -5
- data/lib/spreadsheet/excel/writer/workbook.rb +3 -1
- data/lib/spreadsheet.rb +3 -1
- data/spreadsheet.gemspec +3 -1
- data/test/data/test_text_drawing.xls +0 -0
- data/test/integration.rb +7 -0
- metadata +7 -14
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDU5YTVlMjhjOGMxMTRjYmI3NmFmZjFhZTJjM2M2OWJhNTA2NmNlZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTQ4OGI0Y2VhNTdiNGNjMzdmYzdiMmJhNDJkNGE3OTRhOTk5MjNmMw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmNkOTA1ZDk4MjJjMjRmMzY2YmY5NjAyZGU4OTk4NGJjNzJlZTUyZDBiZjBm
|
10
|
+
ZmIwN2Y0ZDQ2YjUyZjI1YjNkMjEwZTU2YjQwZDk1OThiNjVkMzdkODBkNDkw
|
11
|
+
MzBmMGE3ODQ4ZTNlY2RkNWQwYzM3NTgxNzgyNzk0NjUzNGM3NjQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NmViNzExZjEwMzgxOWE4MzRiZTJmNjdmZTNiNzY2OWQxODliZGQ5N2U1M2Zl
|
14
|
+
YTM2MDUwMDZiNTFjNTViZDg0MjI1YmMxMjZiMDg4NzZjZTgyODMzYTZjZDcy
|
15
|
+
MzgyNzA2YjllNmE5MmU3ZjAwNThlNzZhNTRjZWM5MmFiNGI2Zjg=
|
data/.travis.yml
CHANGED
Binary file
|
data/GUIDE.md
CHANGED
@@ -169,6 +169,12 @@ end
|
|
169
169
|
book.write '/path/to/output/excel-file.xls'
|
170
170
|
```
|
171
171
|
|
172
|
+
Or you can directly access the cell that you want and add your text on it:
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
sheet.rows[2][1] = "X"
|
176
|
+
```
|
177
|
+
|
172
178
|
## Date and DateTime
|
173
179
|
Excel does not know a separate Datatype for Dates. Instead it encodes Dates
|
174
180
|
into standard floating-point numbers and recognizes a Date-Cell by its
|
@@ -317,7 +323,7 @@ Again, you will have to manually uninstall the spreadsheet-excel library.
|
|
317
323
|
|
318
324
|
If you perform fancy formatting, you may run into trouble as the
|
319
325
|
Format implementation has changed considerably. If that is the case, please
|
320
|
-
drop me a line at
|
326
|
+
drop me a line at "zdavatz at ywesee dot com" and I will try to help you. Don't
|
321
327
|
forget to include the offending code-snippet!
|
322
328
|
|
323
329
|
All compatibility code is deprecated and will be removed in version 1.0.0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/History.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
### 0.9.9 / 28.08.2014
|
2
|
+
|
3
|
+
Author: PikachuEXE <pikachuexe@gmail.com>
|
4
|
+
Date: Wed Aug 27 09:55:41 2014 +0800
|
5
|
+
|
6
|
+
* Add custom error classes
|
7
|
+
* Raise custom error for unknown code page or unsupported encoding
|
8
|
+
|
9
|
+
### 0.9.8 / 19.08.2014
|
10
|
+
|
11
|
+
Author: PikachuEXE <pikachuexe@gmail.com>
|
12
|
+
Date: Tue Aug 19 09:54:30 2014 +0800
|
13
|
+
|
14
|
+
* Fix Encoding for MRI 2.1.0
|
15
|
+
|
16
|
+
### 0.9.7 / 04.02.2014
|
17
|
+
|
18
|
+
* Avoid exception when reading text objects
|
19
|
+
* Add test for drawings with text (currenty broken)
|
20
|
+
* Restore xlsopcodes script which had been mangled in previous commits
|
21
|
+
* Remove ruby 1.9 from roadmap, it's already working fine
|
22
|
+
* Fix excel file format documentation which had been mangled in previous commits
|
23
|
+
|
1
24
|
### 0.9.6 / 02.12.2013
|
2
25
|
|
3
26
|
Author: Malcolm Blyth <trashbat@co.ck>
|
data/Manifest.txt
CHANGED
@@ -66,6 +66,7 @@ test/data/test_merged_and_protected.xls
|
|
66
66
|
test/data/test_merged_cells.xls
|
67
67
|
test/data/test_missing_row.xls
|
68
68
|
test/data/test_pagesetup.xls
|
69
|
+
test/data/test_text_drawing.xls
|
69
70
|
test/data/test_version_excel5.xls
|
70
71
|
test/data/test_version_excel95.xls
|
71
72
|
test/data/test_version_excel97.xls
|
data/README.md
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
Forked to continue comment extraction based on andrewinkelmann's fork
|
2
|
-
|
3
|
-
|
4
|
-
Last Update: 31.05.2013 - Zeno R.R. Davatz
|
5
|
-
|
6
1
|
# Spreadsheet
|
7
2
|
|
3
|
+
[](http://travis-ci.org/zdavatz/spreadsheet)
|
4
|
+
|
8
5
|
https://github.com/zdavatz/spreadsheet
|
9
6
|
|
10
7
|
The Mailing List can be found here:
|
@@ -60,7 +57,6 @@ Floats returned for any number.
|
|
60
57
|
* Formula Support
|
61
58
|
* Document Modification: Formulas
|
62
59
|
* Write-Support: BIFF5
|
63
|
-
* Ruby 1.9 Support;
|
64
60
|
* Remove backward compatibility code
|
65
61
|
|
66
62
|
Note: Spreadsheet supports Ruby 1.8.6, 1.8.7, 1.9.2, 1.9.3
|
@@ -70,7 +66,6 @@ You will get a deprecated warning about iconv when using spreadsheet with Ruby
|
|
70
66
|
|
71
67
|
## Dependencies
|
72
68
|
|
73
|
-
* ruby 1.8
|
74
69
|
* [ruby-ole](http://code.google.com/p/ruby-ole/)
|
75
70
|
|
76
71
|
|
data/excelfileformat.pdf
CHANGED
Binary file
|
@@ -34,10 +34,10 @@ module Internals
|
|
34
34
|
866 => "IBM866", #(Cyrillic (Russian))
|
35
35
|
869 => "IBM869", #(Greek (Modern))
|
36
36
|
874 => "WINDOWS-874", #(Thai)
|
37
|
-
932 => "
|
38
|
-
936 => "
|
39
|
-
949 => "
|
40
|
-
950 => "
|
37
|
+
932 => "Windows-31J", #(Japanese Shift-JIS)
|
38
|
+
936 => "GBK", #(Chinese Simplified GBK)
|
39
|
+
949 => "CP949", #(Korean (Wansung))
|
40
|
+
950 => "CP950", #(Chinese Traditional BIG5)
|
41
41
|
1200 => "UTF-16LE", #(BIFF8)
|
42
42
|
1250 => "WINDOWS-1250", #(Latin II) (Central European)
|
43
43
|
1251 => "WINDOWS-1251", #(Cyrillic)
|
@@ -380,9 +380,9 @@ module Internals
|
|
380
380
|
:wsbool => 0x0081, # ○ WSBOOL ➜ 6.113
|
381
381
|
:defcolwidth => 0x0055, # ○ DEFCOLWIDTH ➜ 6.29
|
382
382
|
:sort => 0x0090, # ○ SORT ➜ 6.95
|
383
|
-
:note => 0x001c,
|
384
|
-
:obj => 0x005d,
|
385
|
-
:drawing => 0x00EC,
|
383
|
+
:note => 0x001c,
|
384
|
+
:obj => 0x005d,
|
385
|
+
:drawing => 0x00EC,
|
386
386
|
:txo => 0x01B6,
|
387
387
|
}
|
388
388
|
=begin ## unknown opcodes
|
@@ -441,7 +441,7 @@ module Internals
|
|
441
441
|
0x0d => :slanted_medium_dash_dotted
|
442
442
|
}
|
443
443
|
# ensure reader always gets a valid line style
|
444
|
-
XF_BORDER_LINE_STYLES.default = :none
|
444
|
+
XF_BORDER_LINE_STYLES.default = :none
|
445
445
|
SELYTS_ENIL_REDROB_FX = XF_BORDER_LINE_STYLES.invert
|
446
446
|
SELYTS_ENIL_REDROB_FX.default = 0x00
|
447
447
|
OPCODE_SIZE = 4
|
@@ -71,10 +71,16 @@ class Reader
|
|
71
71
|
value
|
72
72
|
end
|
73
73
|
def encoding codepage_id
|
74
|
-
name = CODEPAGES.fetch(codepage_id)
|
75
|
-
raise "Unknown Codepage 0x%04x" % codepage_id
|
74
|
+
name = CODEPAGES.fetch(codepage_id) do
|
75
|
+
raise Spreadsheet::Errors::UnknownCodepage, "Unknown Codepage 0x%04x" % codepage_id
|
76
|
+
end
|
77
|
+
|
76
78
|
if RUBY_VERSION >= '1.9'
|
77
|
-
|
79
|
+
begin
|
80
|
+
Encoding.find name
|
81
|
+
rescue ArgumentError
|
82
|
+
raise Spreadsheet::Errors::UnsupportedEncoding, "Unsupported encoding with name '#{name}'"
|
83
|
+
end
|
78
84
|
else
|
79
85
|
name
|
80
86
|
end
|
@@ -903,7 +909,7 @@ class Reader
|
|
903
909
|
#p work
|
904
910
|
end
|
905
911
|
when :continue # this contains the actual note text
|
906
|
-
if previous == :txo
|
912
|
+
if previous == :txo && @noteObject
|
907
913
|
#puts "\nDEBUG: found Continue record"
|
908
914
|
continueFmt = work.unpack('C')
|
909
915
|
if (continueFmt.first == 0)
|
@@ -933,7 +939,7 @@ class Reader
|
|
933
939
|
set_missing_row_address worksheet, work, pos, len
|
934
940
|
end
|
935
941
|
end
|
936
|
-
previous = op
|
942
|
+
previous = op
|
937
943
|
#previous = op unless op == :continue
|
938
944
|
end
|
939
945
|
end
|
@@ -273,7 +273,9 @@ class Workbook < Spreadsheet::Writer
|
|
273
273
|
if RUBY_VERSION >= '1.9' && enc.is_a?(Encoding)
|
274
274
|
enc = enc.name.upcase
|
275
275
|
end
|
276
|
-
cp = SEGAPEDOC
|
276
|
+
cp = SEGAPEDOC.fetch(enc) do
|
277
|
+
raise Spreadsheet::Errors::UnknownCodepage, "Invalid or Unknown Codepage '#{enc}'"
|
278
|
+
end
|
277
279
|
write_op writer, 0x0042, [cp].pack('v')
|
278
280
|
end
|
279
281
|
def write_eof workbook, writer
|
data/lib/spreadsheet.rb
CHANGED
@@ -24,6 +24,8 @@
|
|
24
24
|
# 8006 Zürich
|
25
25
|
### Switzerland
|
26
26
|
|
27
|
+
require 'spreadsheet/errors'
|
28
|
+
|
27
29
|
require 'spreadsheet/excel/workbook'
|
28
30
|
require 'spreadsheet/excel/reader'
|
29
31
|
require 'spreadsheet/excel/rgb'
|
@@ -43,7 +45,7 @@ module Spreadsheet
|
|
43
45
|
|
44
46
|
##
|
45
47
|
# The version of Spreadsheet you are using.
|
46
|
-
VERSION = '0.9.
|
48
|
+
VERSION = '0.9.9'
|
47
49
|
|
48
50
|
##
|
49
51
|
# Default client Encoding. Change this value if your application uses a
|
data/spreadsheet.gemspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'lib', 'spreadsheet')
|
2
|
+
|
1
3
|
spec = Gem::Specification.new do |s|
|
2
4
|
s.name = "spreadsheet"
|
3
|
-
s.version =
|
5
|
+
s.version = Spreadsheet::VERSION
|
4
6
|
s.summary = "The Spreadsheet Library is designed to read and write Spreadsheet Documents"
|
5
7
|
s.description = "As of version 0.6.0, only Microsoft Excel compatible spreadsheets are supported"
|
6
8
|
s.author = "Masaomi Hatakeyama, Zeno R.R. Davatz"
|
Binary file
|
data/test/integration.rb
CHANGED
@@ -1365,6 +1365,13 @@ module Spreadsheet
|
|
1365
1365
|
assert_equal(:visible, book2.worksheet(1).visibility)
|
1366
1366
|
end
|
1367
1367
|
|
1368
|
+
def test_text_drawing
|
1369
|
+
path = File.join @data, 'test_text_drawing.xls'
|
1370
|
+
book = Spreadsheet.open path
|
1371
|
+
assert_nothing_raised do
|
1372
|
+
book.worksheet(0).row(0)
|
1373
|
+
end
|
1374
|
+
end
|
1368
1375
|
private
|
1369
1376
|
|
1370
1377
|
# Validates the workbook's SST
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.9
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Masaomi Hatakeyama, Zeno R.R. Davatz
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ruby-ole
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rdoc
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: hoe
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -69,6 +62,7 @@ extra_rdoc_files:
|
|
69
62
|
- LICENSE.txt
|
70
63
|
- Manifest.txt
|
71
64
|
files:
|
65
|
+
- .gemtest
|
72
66
|
- .gitignore
|
73
67
|
- .travis.yml
|
74
68
|
- Excel97-2007BinaryFileFormatSpecification.pdf
|
@@ -137,6 +131,7 @@ files:
|
|
137
131
|
- test/data/test_merged_cells.xls
|
138
132
|
- test/data/test_missing_row.xls
|
139
133
|
- test/data/test_pagesetup.xls
|
134
|
+
- test/data/test_text_drawing.xls
|
140
135
|
- test/data/test_version_excel5.xls
|
141
136
|
- test/data/test_version_excel95.xls
|
142
137
|
- test/data/test_version_excel97.xls
|
@@ -154,9 +149,9 @@ files:
|
|
154
149
|
- test/workbook.rb
|
155
150
|
- test/workbook_protection.rb
|
156
151
|
- test/worksheet.rb
|
157
|
-
- .gemtest
|
158
152
|
homepage:
|
159
153
|
licenses: []
|
154
|
+
metadata: {}
|
160
155
|
post_install_message:
|
161
156
|
rdoc_options:
|
162
157
|
- --main
|
@@ -164,21 +159,19 @@ rdoc_options:
|
|
164
159
|
require_paths:
|
165
160
|
- lib
|
166
161
|
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
-
none: false
|
168
162
|
requirements:
|
169
163
|
- - ! '>='
|
170
164
|
- !ruby/object:Gem::Version
|
171
165
|
version: '0'
|
172
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
-
none: false
|
174
167
|
requirements:
|
175
168
|
- - ! '>='
|
176
169
|
- !ruby/object:Gem::Version
|
177
170
|
version: '0'
|
178
171
|
requirements: []
|
179
172
|
rubyforge_project: spreadsheet
|
180
|
-
rubygems_version:
|
173
|
+
rubygems_version: 2.3.0
|
181
174
|
signing_key:
|
182
|
-
specification_version:
|
175
|
+
specification_version: 4
|
183
176
|
summary: ''
|
184
177
|
test_files: []
|