ruby-spreadsheet 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.document +5 -0
  2. data/GUIDE.txt +267 -0
  3. data/Gemfile +12 -0
  4. data/Gemfile.lock +20 -0
  5. data/History.txt +307 -0
  6. data/LICENSE.txt +619 -0
  7. data/README.txt +91 -0
  8. data/Rakefile +53 -0
  9. data/VERSION +1 -0
  10. data/bin/xlsopcodes +18 -0
  11. data/lib/parseexcel.rb +27 -0
  12. data/lib/parseexcel/parseexcel.rb +75 -0
  13. data/lib/parseexcel/parser.rb +11 -0
  14. data/lib/spreadsheet.rb +79 -0
  15. data/lib/spreadsheet/column.rb +71 -0
  16. data/lib/spreadsheet/compatibility.rb +23 -0
  17. data/lib/spreadsheet/datatypes.rb +110 -0
  18. data/lib/spreadsheet/encodings.rb +46 -0
  19. data/lib/spreadsheet/excel.rb +88 -0
  20. data/lib/spreadsheet/excel/error.rb +26 -0
  21. data/lib/spreadsheet/excel/internals.rb +386 -0
  22. data/lib/spreadsheet/excel/internals/biff5.rb +17 -0
  23. data/lib/spreadsheet/excel/internals/biff8.rb +19 -0
  24. data/lib/spreadsheet/excel/offset.rb +41 -0
  25. data/lib/spreadsheet/excel/reader.rb +1173 -0
  26. data/lib/spreadsheet/excel/reader/biff5.rb +22 -0
  27. data/lib/spreadsheet/excel/reader/biff8.rb +193 -0
  28. data/lib/spreadsheet/excel/row.rb +92 -0
  29. data/lib/spreadsheet/excel/sst_entry.rb +46 -0
  30. data/lib/spreadsheet/excel/workbook.rb +80 -0
  31. data/lib/spreadsheet/excel/worksheet.rb +100 -0
  32. data/lib/spreadsheet/excel/writer.rb +1 -0
  33. data/lib/spreadsheet/excel/writer/biff8.rb +75 -0
  34. data/lib/spreadsheet/excel/writer/format.rb +253 -0
  35. data/lib/spreadsheet/excel/writer/workbook.rb +652 -0
  36. data/lib/spreadsheet/excel/writer/worksheet.rb +948 -0
  37. data/lib/spreadsheet/font.rb +92 -0
  38. data/lib/spreadsheet/format.rb +177 -0
  39. data/lib/spreadsheet/formula.rb +9 -0
  40. data/lib/spreadsheet/helpers.rb +11 -0
  41. data/lib/spreadsheet/link.rb +43 -0
  42. data/lib/spreadsheet/row.rb +132 -0
  43. data/lib/spreadsheet/workbook.rb +120 -0
  44. data/lib/spreadsheet/worksheet.rb +279 -0
  45. data/lib/spreadsheet/writer.rb +30 -0
  46. data/ruby-spreadsheet.gemspec +126 -0
  47. data/test/data/test_changes.xls +0 -0
  48. data/test/data/test_copy.xls +0 -0
  49. data/test/data/test_datetime.xls +0 -0
  50. data/test/data/test_empty.xls +0 -0
  51. data/test/data/test_formula.xls +0 -0
  52. data/test/data/test_missing_row.xls +0 -0
  53. data/test/data/test_version_excel5.xls +0 -0
  54. data/test/data/test_version_excel95.xls +0 -0
  55. data/test/data/test_version_excel97.xls +0 -0
  56. data/test/excel/row.rb +35 -0
  57. data/test/excel/writer/worksheet.rb +23 -0
  58. data/test/font.rb +163 -0
  59. data/test/integration.rb +1281 -0
  60. data/test/row.rb +33 -0
  61. data/test/suite.rb +14 -0
  62. data/test/workbook.rb +21 -0
  63. data/test/worksheet.rb +80 -0
  64. metadata +203 -0
data/test/row.rb ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ # TestRow -- Spreadsheet -- 08.01.2009 -- hwyss@ywesee.com
3
+
4
+ $: << File.expand_path('../../lib', File.dirname(__FILE__))
5
+
6
+ require 'test/unit'
7
+ require 'spreadsheet'
8
+
9
+ module Spreadsheet
10
+ class TestRow < Test::Unit::TestCase
11
+ def setup
12
+ @workbook = Excel::Workbook.new
13
+ @worksheet = Excel::Worksheet.new
14
+ @workbook.add_worksheet @worksheet
15
+ end
16
+ def test_formatted
17
+ row = Row.new @worksheet, 0, [nil, 1]
18
+ assert_equal 2, row.formatted.size
19
+ row.set_format 3, Format.new
20
+ assert_equal 4, row.formatted.size
21
+ end
22
+ def test_concat
23
+ row = Row.new @worksheet, 0, [nil, 1, nil]
24
+ assert_equal [nil, 1, nil], row
25
+ row.concat [2, nil]
26
+ assert_equal [nil, 1, nil, 2, nil], row
27
+ row.concat [3]
28
+ assert_equal [nil, 1, nil, 2, nil, 3], row
29
+ row.concat [nil, 4]
30
+ assert_equal [nil, 1, nil, 2, nil, 3, nil, 4], row
31
+ end
32
+ end
33
+ end
data/test/suite.rb ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # suite.rb -- oddb -- 08.01.2009 -- hwyss@ywesee.com
3
+
4
+ require 'find'
5
+
6
+ here = File.dirname(__FILE__)
7
+
8
+ $: << here
9
+
10
+ Find.find(here) do |file|
11
+ if /(?<!suite)\.rb$/o.match(file)
12
+ require file
13
+ end
14
+ end
data/test/workbook.rb ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ # TestWorkbook -- Spreadheet -- 24.09.2008 -- hwyss@ywesee.com
3
+
4
+ $: << File.expand_path('../lib', File.dirname(__FILE__))
5
+
6
+ require 'test/unit'
7
+ require 'spreadsheet'
8
+ require 'fileutils'
9
+ require 'stringio'
10
+
11
+ module Spreadsheet
12
+ class TestWorkbook < Test::Unit::TestCase
13
+ def setup
14
+ @io = StringIO.new ''
15
+ @book = Workbook.new
16
+ end
17
+ def test_writer__default_excel
18
+ assert_instance_of Excel::Writer::Workbook, @book.writer(@io)
19
+ end
20
+ end
21
+ end
data/test/worksheet.rb ADDED
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env ruby
2
+ # TestWorksheet -- Spreadheet -- 30.09.2008 -- hwyss@ywesee.com
3
+
4
+ $: << File.expand_path('../lib', File.dirname(__FILE__))
5
+
6
+ require 'test/unit'
7
+ require 'spreadsheet'
8
+
9
+ module Spreadsheet
10
+ class TestWorksheet < Test::Unit::TestCase
11
+ def setup
12
+ @book = Workbook.new
13
+ @sheet = @book.create_worksheet
14
+ end
15
+ def test_cell_writer
16
+ assert_nil @sheet[0,0]
17
+ assert_equal 0, @sheet.column_count
18
+ assert_equal 0, @sheet.row_count
19
+ @sheet[0,0] = 'foo'
20
+ assert_equal 'foo', @sheet[0,0]
21
+ assert_equal 1, @sheet.column_count
22
+ assert_equal 1, @sheet.row_count
23
+ @sheet[1,0] = 'bar'
24
+ assert_equal 1, @sheet.column_count
25
+ assert_equal 2, @sheet.row_count
26
+ @sheet[0,1] = 'bar'
27
+ assert_equal 2, @sheet.column_count
28
+ assert_equal 2, @sheet.row_count
29
+ @sheet[1,0] = nil
30
+ assert_equal 2, @sheet.column_count
31
+ assert_equal 2, @sheet.row_count
32
+ @sheet[0,1] = nil
33
+ assert_equal 2, @sheet.column_count
34
+ assert_equal 2, @sheet.row_count
35
+ end
36
+ def test_column_count
37
+ assert_equal 0, @sheet.column_count
38
+ @sheet.replace_row 3, nil, nil, 1, 2, 'foo, bar'
39
+ assert_equal 3, @sheet.column_count
40
+ @sheet.replace_row 8, nil, 'something', 4, 7, nil
41
+ assert_equal 4, @sheet.column_count
42
+ @sheet.replace_row 5, 4, 'something', 4, 7, nil
43
+ assert_equal 5, @sheet.column_count
44
+ @sheet.replace_row 5, nil, 'something', 4, 7, nil
45
+ assert_equal 4, @sheet.column_count
46
+ @sheet.replace_row 3
47
+ assert_equal 4, @sheet.column_count
48
+ end
49
+ def test_row_count
50
+ assert_equal 0, @sheet.row_count
51
+ @sheet.replace_row 3, nil, nil, 1, 2, 'foo, bar'
52
+ assert_equal 1, @sheet.row_count
53
+ @sheet.replace_row 8, nil, 'something', 4, 7, nil
54
+ assert_equal 6, @sheet.row_count
55
+ @sheet.replace_row 5, 4, 'something', 4, 7, nil
56
+ assert_equal 6, @sheet.row_count
57
+ @sheet.replace_row 5, nil, 'something', 4, 7, nil
58
+ assert_equal 6, @sheet.row_count
59
+ @sheet.replace_row 3
60
+ assert_equal 6, @sheet.row_count
61
+ @sheet.delete_row 3
62
+ assert_equal 5, @sheet.row_count
63
+ @sheet.delete_row 3
64
+ assert_equal 4, @sheet.row_count
65
+ @sheet.delete_row 2
66
+ assert_equal 4, @sheet.row_count
67
+ @sheet.delete_row 2
68
+ assert_equal 3, @sheet.row_count
69
+ end
70
+ def test_modify_column
71
+ assert_equal 10, @sheet.column(0).width
72
+ @sheet.column(1).width = 20
73
+ assert_equal 10, @sheet.column(0).width
74
+ assert_equal 20, @sheet.column(1).width
75
+ @sheet.column(0).width = 30
76
+ assert_equal 30, @sheet.column(0).width
77
+ assert_equal 20, @sheet.column(1).width
78
+ end
79
+ end
80
+ end
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-spreadsheet
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 5
9
+ version: 0.6.5
10
+ platform: ruby
11
+ authors:
12
+ - Dmitry Lihachev
13
+ - Masaomi Hatakeyama
14
+ - Zeno R.R. Davatz
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2010-12-20 00:00:00 +06:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: ruby-ole
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: bundler
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: jeweler
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: *id003
61
+ - !ruby/object:Gem::Dependency
62
+ name: rcov
63
+ requirement: &id004 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: *id004
74
+ - !ruby/object:Gem::Dependency
75
+ name: ruby-ole
76
+ requirement: &id005 !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">"
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 1
83
+ - 2
84
+ version: "1.2"
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: *id005
88
+ description: As of version 0.6.0, only Microsoft Excel compatible spreadsheets are supported
89
+ email: lda@openteam.ru, mhatakeyama@ywesee.com, zdavatz@ywesee.com
90
+ executables:
91
+ - xlsopcodes
92
+ - xlsopcodes
93
+ extensions: []
94
+
95
+ extra_rdoc_files:
96
+ - LICENSE.txt
97
+ - README.txt
98
+ files:
99
+ - .document
100
+ - GUIDE.txt
101
+ - Gemfile
102
+ - Gemfile.lock
103
+ - History.txt
104
+ - LICENSE.txt
105
+ - README.txt
106
+ - Rakefile
107
+ - VERSION
108
+ - bin/xlsopcodes
109
+ - lib/parseexcel.rb
110
+ - lib/parseexcel/parseexcel.rb
111
+ - lib/parseexcel/parser.rb
112
+ - lib/spreadsheet.rb
113
+ - lib/spreadsheet/column.rb
114
+ - lib/spreadsheet/compatibility.rb
115
+ - lib/spreadsheet/datatypes.rb
116
+ - lib/spreadsheet/encodings.rb
117
+ - lib/spreadsheet/excel.rb
118
+ - lib/spreadsheet/excel/error.rb
119
+ - lib/spreadsheet/excel/internals.rb
120
+ - lib/spreadsheet/excel/internals/biff5.rb
121
+ - lib/spreadsheet/excel/internals/biff8.rb
122
+ - lib/spreadsheet/excel/offset.rb
123
+ - lib/spreadsheet/excel/reader.rb
124
+ - lib/spreadsheet/excel/reader/biff5.rb
125
+ - lib/spreadsheet/excel/reader/biff8.rb
126
+ - lib/spreadsheet/excel/row.rb
127
+ - lib/spreadsheet/excel/sst_entry.rb
128
+ - lib/spreadsheet/excel/workbook.rb
129
+ - lib/spreadsheet/excel/worksheet.rb
130
+ - lib/spreadsheet/excel/writer.rb
131
+ - lib/spreadsheet/excel/writer/biff8.rb
132
+ - lib/spreadsheet/excel/writer/format.rb
133
+ - lib/spreadsheet/excel/writer/workbook.rb
134
+ - lib/spreadsheet/excel/writer/worksheet.rb
135
+ - lib/spreadsheet/font.rb
136
+ - lib/spreadsheet/format.rb
137
+ - lib/spreadsheet/formula.rb
138
+ - lib/spreadsheet/helpers.rb
139
+ - lib/spreadsheet/link.rb
140
+ - lib/spreadsheet/row.rb
141
+ - lib/spreadsheet/workbook.rb
142
+ - lib/spreadsheet/worksheet.rb
143
+ - lib/spreadsheet/writer.rb
144
+ - ruby-spreadsheet.gemspec
145
+ - test/data/test_changes.xls
146
+ - test/data/test_copy.xls
147
+ - test/data/test_datetime.xls
148
+ - test/data/test_empty.xls
149
+ - test/data/test_formula.xls
150
+ - test/data/test_missing_row.xls
151
+ - test/data/test_version_excel5.xls
152
+ - test/data/test_version_excel95.xls
153
+ - test/data/test_version_excel97.xls
154
+ - test/excel/row.rb
155
+ - test/excel/writer/worksheet.rb
156
+ - test/font.rb
157
+ - test/integration.rb
158
+ - test/row.rb
159
+ - test/suite.rb
160
+ - test/workbook.rb
161
+ - test/worksheet.rb
162
+ has_rdoc: true
163
+ homepage: http://github.com/lda/ruby-spreadsheet
164
+ licenses:
165
+ - GPLv3
166
+ post_install_message:
167
+ rdoc_options: []
168
+
169
+ require_paths:
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ hash: 761537663868309834
177
+ segments:
178
+ - 0
179
+ version: "0"
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ none: false
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ segments:
186
+ - 0
187
+ version: "0"
188
+ requirements: []
189
+
190
+ rubyforge_project:
191
+ rubygems_version: 1.3.7
192
+ signing_key:
193
+ specification_version: 3
194
+ summary: The Spreadsheet Library is designed to read and write Spreadsheet Documents
195
+ test_files:
196
+ - test/excel/row.rb
197
+ - test/excel/writer/worksheet.rb
198
+ - test/font.rb
199
+ - test/integration.rb
200
+ - test/row.rb
201
+ - test/suite.rb
202
+ - test/workbook.rb
203
+ - test/worksheet.rb