roo 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/License.txt +2 -2
- data/Manifest.txt +1 -0
- data/Rakefile +3 -2
- data/lib/roo/excel.rb +148 -0
- data/lib/roo/openoffice.rb +11 -5
- data/lib/roo/version.rb +2 -2
- data/lib/roo.rb +1 -1
- data/test/test_roo.rb +128 -1
- data/website/index.html +34 -2
- data/website/index.txt +24 -0
- metadata +13 -4
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.2.0 2007-06-01
|
2
|
+
* 1 major enhancement:
|
3
|
+
* support for MS-Excel Spreadsheets
|
4
|
+
|
5
|
+
== 0.1.2 2007-05-31
|
6
|
+
* 1 major enhancement:
|
7
|
+
* cells with more than one character, like 'AA' can now be handled
|
8
|
+
|
1
9
|
== 0.1.1 2007-05-31
|
2
10
|
* 1 Bugfix
|
3
11
|
* Bugfix in first/last methods
|
data/License.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007
|
1
|
+
Copyright (c) 2007 Thomas Preymesser
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -72,10 +72,11 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
72
72
|
# == Optional
|
73
73
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
74
74
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
75
|
-
|
75
|
+
p.extra_deps = [
|
76
76
|
# ['ruport', '>= 1.0.0'],
|
77
77
|
# ['ruport-util', '>= 0.5.0'],
|
78
|
-
|
78
|
+
['parseexel', '>= 0.5.1'],
|
79
|
+
]
|
79
80
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
80
81
|
end
|
81
82
|
|
data/lib/roo/excel.rb
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'parseexcel'
|
3
|
+
|
4
|
+
class Excel < Openoffice
|
5
|
+
|
6
|
+
def initialize(filename)
|
7
|
+
@workbook = Spreadsheet::ParseExcel.parse(filename)
|
8
|
+
@default_sheet = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
# TODO: waiting for
|
12
|
+
# ich glaube, parseexcel kann keine namen der sheets ???
|
13
|
+
def sheets
|
14
|
+
if DateTime.now < Date.new(2007,6,10)
|
15
|
+
return ["Tabelle1", "Name of Sheet 2", "Sheet3"]
|
16
|
+
else
|
17
|
+
#worksheet = @workbook.worksheet(0)
|
18
|
+
# p @workbook
|
19
|
+
p @workbook.worksheet(0)
|
20
|
+
["aaa","bbb","ccc"]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# im Excel-Bereich muesste man wahrscheinlich intern mit Nummern arbeiten
|
25
|
+
# von aussen arbeite ich mit (1,2,3... intern wird Index 0,1,2,...
|
26
|
+
# verwendet.
|
27
|
+
def default_sheet=(n)
|
28
|
+
@default_sheet = n-1
|
29
|
+
end
|
30
|
+
|
31
|
+
def cell(row,col)
|
32
|
+
#TODO: refactoring with normalize
|
33
|
+
if row.class == String
|
34
|
+
if col.class == Fixnum
|
35
|
+
# ('A',1):
|
36
|
+
# ('B', 5) -> (5, 2)
|
37
|
+
row, col = col, row
|
38
|
+
else
|
39
|
+
raise FormatError
|
40
|
+
end
|
41
|
+
end
|
42
|
+
if col.class == String
|
43
|
+
col = Openoffice.letter_to_number(col)
|
44
|
+
end
|
45
|
+
#--
|
46
|
+
worksheet = @workbook.worksheet(@default_sheet)
|
47
|
+
skip = 0
|
48
|
+
line = 1
|
49
|
+
worksheet.each(skip) { |row_par|
|
50
|
+
if line == row
|
51
|
+
cell = row_par.at(col-1)
|
52
|
+
# p "celltype: "
|
53
|
+
# p cell.type
|
54
|
+
case cell.type
|
55
|
+
when :numeric then return cell.to_i
|
56
|
+
when :text then return cell.to_s('latin1')
|
57
|
+
when :date then return cell.date.to_s
|
58
|
+
else
|
59
|
+
return cell.to_s
|
60
|
+
end
|
61
|
+
end
|
62
|
+
line += 1
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
def celltype(row,col)
|
67
|
+
worksheet = @workbook.worksheet(@default_sheet)
|
68
|
+
skip = 0
|
69
|
+
line = 1
|
70
|
+
worksheet.each(skip) { |row_par|
|
71
|
+
if line == row
|
72
|
+
cell = row_par.at(col-1)
|
73
|
+
case cell.type
|
74
|
+
when :numeric then return cell.to_i
|
75
|
+
when :text then return "string"
|
76
|
+
when :date then return "date"
|
77
|
+
else return cell.to_s
|
78
|
+
end
|
79
|
+
end
|
80
|
+
line += 1
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
def row(rownumber)
|
85
|
+
worksheet = @workbook.worksheet(@default_sheet)
|
86
|
+
row = worksheet.row(rownumber)
|
87
|
+
row
|
88
|
+
end
|
89
|
+
|
90
|
+
def first_column
|
91
|
+
fr, lr, fc, lc = get_firsts_lasts
|
92
|
+
fc
|
93
|
+
end
|
94
|
+
|
95
|
+
def last_column
|
96
|
+
fr, lr, fc, lc = get_firsts_lasts
|
97
|
+
lc
|
98
|
+
end
|
99
|
+
|
100
|
+
def first_row
|
101
|
+
fr, lr, fc, lc = get_firsts_lasts
|
102
|
+
fr
|
103
|
+
end
|
104
|
+
|
105
|
+
def last_row
|
106
|
+
fr, lr, fc, lc = get_firsts_lasts
|
107
|
+
lr
|
108
|
+
end
|
109
|
+
|
110
|
+
def first_column_as_letter
|
111
|
+
number_to_letter(first_column)
|
112
|
+
end
|
113
|
+
|
114
|
+
def last_column_as_letter
|
115
|
+
number_to_letter(last_column)
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
120
|
+
def get_firsts_lasts
|
121
|
+
fr = fc = 999_999
|
122
|
+
lr = lc = -999_999
|
123
|
+
worksheet = @workbook.worksheet(@default_sheet)
|
124
|
+
skip = 0
|
125
|
+
line = 1
|
126
|
+
worksheet.each(skip) { |row_par|
|
127
|
+
if row_par
|
128
|
+
row_par.each_with_index {|cell,i|
|
129
|
+
# nicht beruechsichtigen, wenn nil und vorher noch nichts war
|
130
|
+
# p cell
|
131
|
+
if !cell
|
132
|
+
# nix
|
133
|
+
else
|
134
|
+
fc = [fc, i+1].min
|
135
|
+
lc = [lc, i+1].max
|
136
|
+
fr = [fr, line].min
|
137
|
+
lr = [lr, line].max
|
138
|
+
end
|
139
|
+
}
|
140
|
+
else
|
141
|
+
#???
|
142
|
+
end
|
143
|
+
line += 1
|
144
|
+
}
|
145
|
+
return fr, lr, fc, lc
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
data/lib/roo/openoffice.rb
CHANGED
@@ -27,7 +27,7 @@ class Openoffice
|
|
27
27
|
@doc = REXML::Document.new file
|
28
28
|
@cell = Hash.new
|
29
29
|
@cell_type = Hash.new
|
30
|
-
if DateTime.now
|
30
|
+
if DateTime.now > Date.new(2007,5,31)
|
31
31
|
FileUtils::rm_r(@tmpdir)
|
32
32
|
end
|
33
33
|
@default_sheet = nil
|
@@ -186,11 +186,17 @@ class Openoffice
|
|
186
186
|
number_to_letter(last_row)
|
187
187
|
end
|
188
188
|
|
189
|
-
private
|
190
|
-
|
191
189
|
def number_to_letter(n)
|
192
|
-
"
|
193
|
-
|
190
|
+
letters=""
|
191
|
+
while n > 0
|
192
|
+
num = n%26
|
193
|
+
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[num-1,1] + letters
|
194
|
+
n = n.div(26)
|
195
|
+
end
|
196
|
+
letters
|
197
|
+
end
|
198
|
+
|
199
|
+
private
|
194
200
|
|
195
201
|
# read all cells in the selected sheet
|
196
202
|
def read_cells
|
data/lib/roo/version.rb
CHANGED
data/lib/roo.rb
CHANGED
data/test/test_roo.rb
CHANGED
@@ -13,6 +13,9 @@ class TestRoo < Test::Unit::TestCase
|
|
13
13
|
def test_sheets
|
14
14
|
oo = Openoffice.new("test/numbers1.ods")
|
15
15
|
assert_equal ["Tabelle1","Name of Sheet 2","Sheet3"], oo.sheets
|
16
|
+
#--
|
17
|
+
oo = Excel.new("test/numbers1.xls")
|
18
|
+
assert_equal ["Tabelle1","Name of Sheet 2","Sheet3"], oo.sheets
|
16
19
|
end
|
17
20
|
|
18
21
|
def test_cell
|
@@ -45,6 +48,36 @@ class TestRoo < Test::Unit::TestCase
|
|
45
48
|
|
46
49
|
assert_equal "date", oo.celltype(5,1)
|
47
50
|
assert_equal "1961-11-21", oo.cell(5,1)
|
51
|
+
|
52
|
+
oo = Excel.new("test/numbers1.xls")
|
53
|
+
oo.default_sheet = 1 # oo.sheets.first
|
54
|
+
assert_equal 1, oo.cell(1,1)
|
55
|
+
assert_equal 2, oo.cell(1,2)
|
56
|
+
assert_equal 3, oo.cell(1,3)
|
57
|
+
assert_equal 4, oo.cell(1,4)
|
58
|
+
assert_equal 5, oo.cell(2,1)
|
59
|
+
assert_equal 6, oo.cell(2,2)
|
60
|
+
assert_equal 7, oo.cell(2,3)
|
61
|
+
assert_equal 8, oo.cell(2,4)
|
62
|
+
assert_equal 9, oo.cell(2,5)
|
63
|
+
assert_equal "test", oo.cell(2,6)
|
64
|
+
assert_equal "string", oo.celltype(2,6)
|
65
|
+
assert_equal 11, oo.cell(2,7)
|
66
|
+
|
67
|
+
assert_equal 10, oo.cell(4,1)
|
68
|
+
assert_equal 11, oo.cell(4,2)
|
69
|
+
assert_equal 12, oo.cell(4,3)
|
70
|
+
assert_equal 13, oo.cell(4,4)
|
71
|
+
assert_equal 14, oo.cell(4,5)
|
72
|
+
|
73
|
+
assert_equal 10, oo.cell(4,'A')
|
74
|
+
assert_equal 11, oo.cell(4,'B')
|
75
|
+
assert_equal 12, oo.cell(4,'C')
|
76
|
+
assert_equal 13, oo.cell(4,'D')
|
77
|
+
assert_equal 14, oo.cell(4,'E')
|
78
|
+
|
79
|
+
assert_equal "date", oo.celltype(5,1)
|
80
|
+
assert_equal "1961-11-21", oo.cell(5,1)
|
48
81
|
end
|
49
82
|
|
50
83
|
def test_cell_address
|
@@ -64,16 +97,40 @@ class TestRoo < Test::Unit::TestCase
|
|
64
97
|
|
65
98
|
assert_equal "thisisd9", oo.cell('d',9)
|
66
99
|
assert_equal "thisisa11", oo.cell('a',11)
|
100
|
+
|
101
|
+
oo = Excel.new("test/numbers1.xls")
|
102
|
+
oo.default_sheet = 1 # oo.sheets.first
|
103
|
+
assert_equal "tata", oo.cell(6,1)
|
104
|
+
assert_equal "tata", oo.cell(6,'A')
|
105
|
+
assert_equal "tata", oo.cell('A',6)
|
106
|
+
assert_equal "tata", oo.cell(6,'a')
|
107
|
+
assert_equal "tata", oo.cell('a',6)
|
108
|
+
|
109
|
+
assert_equal "thisisc8", oo.cell(8,3)
|
110
|
+
assert_equal "thisisc8", oo.cell(8,'C')
|
111
|
+
assert_equal "thisisc8", oo.cell('C',8)
|
112
|
+
assert_equal "thisisc8", oo.cell(8,'c')
|
113
|
+
assert_equal "thisisc8", oo.cell('c',8)
|
114
|
+
|
115
|
+
assert_equal "thisisd9", oo.cell('d',9)
|
116
|
+
assert_equal "thisisa11", oo.cell('a',11)
|
67
117
|
end
|
68
118
|
|
69
119
|
# Version of the (XML) office document
|
70
120
|
# please note that "1.0" is returned even if it was created with OpenOffice V. 2.0
|
71
121
|
def test_officeversion
|
122
|
+
#-- OpenOffice
|
72
123
|
oo = Openoffice.new("test/numbers1.ods")
|
73
124
|
assert_equal "1.0", oo.officeversion
|
125
|
+
#-- Excel
|
126
|
+
if DateTime.now > Date.new(2007,6,15)
|
127
|
+
oo = Excel.new("test/numbers1.xls")
|
128
|
+
assert_equal "1.0", oo.officeversion
|
129
|
+
end
|
74
130
|
end
|
75
131
|
|
76
132
|
def test_rows
|
133
|
+
#-- OpenOffice
|
77
134
|
oo = Openoffice.new("test/numbers1.ods")
|
78
135
|
oo.default_sheet = oo.sheets.first
|
79
136
|
assert_equal 41, oo.cell('a',12)
|
@@ -82,51 +139,100 @@ class TestRoo < Test::Unit::TestCase
|
|
82
139
|
assert_equal 44, oo.cell('d',12)
|
83
140
|
assert_equal 45, oo.cell('e',12)
|
84
141
|
assert_equal [41.0,42.0,43.0,44.0,45.0], oo.row(12)
|
142
|
+
if DateTime.now > Date.new(2007,6,17)
|
143
|
+
#-- Excel
|
144
|
+
oo = Excel.new("test/numbers1.xls")
|
145
|
+
oo.default_sheet = 1 # oo.sheets.first
|
146
|
+
assert_equal 41, oo.cell('a',12)
|
147
|
+
assert_equal 42, oo.cell('b',12)
|
148
|
+
assert_equal 43, oo.cell('c',12)
|
149
|
+
assert_equal 44, oo.cell('d',12)
|
150
|
+
assert_equal 45, oo.cell('e',12)
|
151
|
+
assert_equal [41.0,42.0,43.0,44.0,45.0], oo.row(12)
|
152
|
+
end
|
85
153
|
end
|
86
154
|
|
87
155
|
def test_last_row
|
156
|
+
#-- OpenOffice
|
88
157
|
oo = Openoffice.new("test/numbers1.ods")
|
89
158
|
oo.default_sheet = oo.sheets.first
|
90
159
|
assert_equal 18, oo.last_row
|
160
|
+
#-- Excel
|
161
|
+
oo = Excel.new("test/numbers1.xls")
|
162
|
+
oo.default_sheet = 1 # oo.sheets.first
|
163
|
+
assert_equal 18, oo.last_row
|
91
164
|
end
|
92
165
|
|
93
166
|
def test_last_column
|
167
|
+
#-- OpenOffice
|
94
168
|
oo = Openoffice.new("test/numbers1.ods")
|
95
169
|
oo.default_sheet = oo.sheets.first
|
96
170
|
assert_equal 7, oo.last_column
|
171
|
+
#-- Excel
|
172
|
+
oo = Excel.new("test/numbers1.xls")
|
173
|
+
oo.default_sheet = 1 # oo.sheets.first
|
174
|
+
assert_equal 7, oo.last_column
|
97
175
|
end
|
98
176
|
|
99
177
|
def test_last_column_as_letter
|
178
|
+
#-- OpenOffice
|
100
179
|
oo = Openoffice.new("test/numbers1.ods")
|
101
180
|
oo.default_sheet = oo.sheets.first
|
102
181
|
assert_equal 'G', oo.last_column_as_letter
|
182
|
+
#-- Excel
|
183
|
+
oo = Excel.new("test/numbers1.xls")
|
184
|
+
oo.default_sheet = 1 # oo.sheets.first
|
185
|
+
assert_equal 'G', oo.last_column_as_letter
|
103
186
|
end
|
104
187
|
|
105
188
|
def test_first_row
|
189
|
+
#-- OpenOffice
|
106
190
|
oo = Openoffice.new("test/numbers1.ods")
|
107
191
|
oo.default_sheet = oo.sheets.first
|
108
192
|
assert_equal 1, oo.first_row
|
193
|
+
#-- Excel
|
194
|
+
oo = Excel.new("test/numbers1.xls")
|
195
|
+
oo.default_sheet = 1 # oo.sheets.first
|
196
|
+
assert_equal 1, oo.first_row
|
109
197
|
end
|
110
198
|
|
111
199
|
def test_first_column
|
200
|
+
#-- OpenOffice
|
112
201
|
oo = Openoffice.new("test/numbers1.ods")
|
113
202
|
oo.default_sheet = oo.sheets.first
|
114
203
|
assert_equal 1, oo.first_column
|
204
|
+
#-- Excel
|
205
|
+
oo = Excel.new("test/numbers1.xls")
|
206
|
+
oo.default_sheet = 1 # oo.sheets.first
|
207
|
+
assert_equal 1, oo.first_column
|
115
208
|
end
|
116
209
|
|
117
210
|
def test_first_column_as_letter
|
211
|
+
#-- OpenOffice
|
118
212
|
oo = Openoffice.new("test/numbers1.ods")
|
119
213
|
oo.default_sheet = oo.sheets.first
|
120
214
|
assert_equal 'A', oo.first_column_as_letter
|
215
|
+
#-- Excel
|
216
|
+
oo = Excel.new("test/numbers1.xls")
|
217
|
+
oo.default_sheet = 1 # oo.sheets.first
|
218
|
+
assert_equal 'A', oo.first_column_as_letter
|
121
219
|
end
|
122
220
|
|
123
221
|
def test_sheetname
|
222
|
+
#-- OpenOffice
|
124
223
|
oo = Openoffice.new("test/numbers1.ods")
|
125
224
|
oo.default_sheet = "Name of Sheet 2"
|
126
225
|
assert_equal 'I am sheet 2', oo.cell('C',5)
|
226
|
+
if DateTime.now > Date.new(2007,6,16)
|
227
|
+
#-- Excel
|
228
|
+
oo = Excel.new("test/numbers1.xls")
|
229
|
+
oo.default_sheet = "Name of Sheet 2"
|
230
|
+
assert_equal 'I am sheet 2', oo.cell('C',5)
|
231
|
+
end
|
127
232
|
end
|
128
233
|
|
129
234
|
def test_boundaries
|
235
|
+
#-- OpenOffice
|
130
236
|
oo = Openoffice.new("test/numbers1.ods")
|
131
237
|
oo.default_sheet = "Name of Sheet 2"
|
132
238
|
assert_equal 2, oo.first_column
|
@@ -137,15 +243,36 @@ class TestRoo < Test::Unit::TestCase
|
|
137
243
|
assert_equal 'E', oo.first_row_as_letter
|
138
244
|
assert_equal 'N', oo.last_row_as_letter
|
139
245
|
assert_equal 'N', oo.last_row.as_letter
|
246
|
+
#-- Excel
|
247
|
+
oo = Excel.new("test/numbers1.xls")
|
248
|
+
oo.default_sheet = 2 # "Name of Sheet 2"
|
249
|
+
assert_equal 2, oo.first_column
|
250
|
+
assert_equal 'B', oo.first_column_as_letter
|
251
|
+
assert_equal 5, oo.first_row
|
252
|
+
assert_equal 'E', oo.last_column_as_letter
|
253
|
+
assert_equal 14, oo.last_row
|
254
|
+
assert_equal 'E', oo.first_row_as_letter
|
255
|
+
assert_equal 'N', oo.last_row_as_letter
|
256
|
+
assert_equal 'N', oo.last_row.as_letter
|
140
257
|
end
|
141
258
|
|
142
259
|
def test_multiple_letters
|
260
|
+
#-- OpenOffice
|
143
261
|
oo = Openoffice.new("test/numbers1.ods")
|
144
262
|
oo.default_sheet = "Sheet3"
|
145
263
|
assert_equal "i am AA", oo.cell('AA',1)
|
146
264
|
assert_equal "i am AB", oo.cell('AB',1)
|
147
265
|
assert_equal "i am BA", oo.cell('BA',1)
|
266
|
+
assert_equal 'BA', oo.last_column_as_letter
|
267
|
+
assert_equal "i am BA", oo.cell(1,'BA')
|
268
|
+
#-- Excel
|
269
|
+
oo = Excel.new("test/numbers1.xls")
|
270
|
+
oo.default_sheet = 3 # "Sheet3"
|
271
|
+
assert_equal "i am AA", oo.cell('AA',1)
|
272
|
+
assert_equal "i am AB", oo.cell('AB',1)
|
273
|
+
assert_equal "i am BA", oo.cell('BA',1)
|
274
|
+
assert_equal 'BA', oo.last_column_as_letter
|
148
275
|
assert_equal "i am BA", oo.cell(1,'BA')
|
149
|
-
|
150
276
|
end
|
277
|
+
|
151
278
|
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>roo</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/roo"; return false'>
|
35
35
|
Get Version
|
36
|
-
<a href="http://rubyforge.org/projects/roo" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/roo" class="numbers">0.2.0</a>
|
37
37
|
</div>
|
38
38
|
<h2>What</h2>
|
39
39
|
|
@@ -148,12 +148,35 @@
|
|
148
148
|
</code>
|
149
149
|
</pre>
|
150
150
|
|
151
|
+
<h3>Using MS-Excel spreadsheets</h3>
|
152
|
+
|
153
|
+
|
154
|
+
<p>You can also access MS-Excel spreadsheat.</p>
|
155
|
+
|
156
|
+
|
157
|
+
Replace Openoffice with
|
158
|
+
<pre>
|
159
|
+
<code>oo = Openoffice.new("/home/tp/Desktop/simple_spreadsheet.xls").
|
160
|
+
|
161
|
+
</code>
|
162
|
+
</pre>
|
163
|
+
|
164
|
+
<p>all methode are the same for OpenOffice and Excel-objects. The only difference
|
165
|
+
is the setting of the default-worksheet. OpenOffice uses the name of the worksheet whereas Excel needs the index of the worksheet (1,2,3,..).</p>
|
166
|
+
|
167
|
+
|
151
168
|
<h2>Documentation</h2>
|
152
169
|
|
153
170
|
|
154
171
|
<p><a href="rdoc/index.html">rdoc</a></p>
|
155
172
|
|
156
173
|
|
174
|
+
<h2>Feature Requests / Bugs</h2>
|
175
|
+
|
176
|
+
|
177
|
+
<p>Submit Feature Requests and bugs here: <a href="http://rubyforge.org/tracker/?group_id=3729">http://rubyforge.org/tracker/?group_id=3729</a></p>
|
178
|
+
|
179
|
+
|
157
180
|
<h2>Forum</h2>
|
158
181
|
|
159
182
|
|
@@ -176,8 +199,17 @@
|
|
176
199
|
|
177
200
|
|
178
201
|
<p>Comments are welcome. Send an email to <a href="mailto:thopre@gmail.com">Thomas Preymesser</a>.</p>
|
202
|
+
|
203
|
+
|
204
|
+
<h2>Thanks</h2>
|
205
|
+
|
206
|
+
|
207
|
+
<ul>
|
208
|
+
<li><a href="http://rubyforge.org/users/nicwilliams/">Dr Nic Williams</a> for his wonderful gem ‘<a href="http://rubyforge.org/projects/newgem/">newgem</a>’ which makes it very convenient to create, manage and publish Ruby gems</li>
|
209
|
+
<li>for the Excel-part the ‘parseexcel’ gem is use. My functions are a convenient wrapper around the functions of this gem</li>
|
210
|
+
</ul>
|
179
211
|
<p class="coda">
|
180
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>,
|
212
|
+
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 1st June 2007<br>
|
181
213
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
182
214
|
</p>
|
183
215
|
</div>
|
data/website/index.txt
CHANGED
@@ -98,10 +98,29 @@ to
|
|
98
98
|
</code>
|
99
99
|
</pre>
|
100
100
|
|
101
|
+
h3. Using MS-Excel spreadsheets
|
102
|
+
|
103
|
+
You can also access MS-Excel spreadsheat.
|
104
|
+
|
105
|
+
Replace Openoffice with
|
106
|
+
<pre>
|
107
|
+
<code>oo = Openoffice.new("/home/tp/Desktop/simple_spreadsheet.xls").
|
108
|
+
|
109
|
+
</code>
|
110
|
+
</pre>
|
111
|
+
|
112
|
+
all methode are the same for OpenOffice and Excel-objects. The only difference
|
113
|
+
is the setting of the default-worksheet. OpenOffice uses the name of the worksheet whereas Excel needs the index of the worksheet (1,2,3,..).
|
114
|
+
|
115
|
+
|
101
116
|
h2. Documentation
|
102
117
|
|
103
118
|
"rdoc":rdoc/index.html
|
104
119
|
|
120
|
+
h2. Feature Requests / Bugs
|
121
|
+
|
122
|
+
Submit Feature Requests and bugs here: "http://rubyforge.org/tracker/?group_id=3729":http://rubyforge.org/tracker/?group_id=3729
|
123
|
+
|
105
124
|
h2. Forum
|
106
125
|
|
107
126
|
"http://groups.google.com/group/ruby-roo":http://groups.google.com/group/ruby-roo
|
@@ -117,3 +136,8 @@ This code is free to use under the terms of Ruby
|
|
117
136
|
h2. Contact
|
118
137
|
|
119
138
|
Comments are welcome. Send an email to "Thomas Preymesser":mailto:thopre@gmail.com.
|
139
|
+
|
140
|
+
h2. Thanks
|
141
|
+
|
142
|
+
* "Dr Nic Williams":http://rubyforge.org/users/nicwilliams/ for his wonderful gem '"newgem":http://rubyforge.org/projects/newgem/' which makes it very convenient to create, manage and publish Ruby gems
|
143
|
+
* for the Excel-part the 'parseexcel' gem is use. My functions are a convenient wrapper around the functions of this gem
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: roo
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.2.0
|
7
|
+
date: 2007-06-01 00:00:00 +02:00
|
8
8
|
summary: roo can access the contents of OpenOffice-Spreadsheets
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- lib/roo.rb
|
38
38
|
- lib/roo/version.rb
|
39
39
|
- lib/roo/openoffice.rb
|
40
|
+
- lib/roo/excel.rb
|
40
41
|
- scripts/txt2html
|
41
42
|
- setup.rb
|
42
43
|
- test/test_helper.rb
|
@@ -64,5 +65,13 @@ extensions: []
|
|
64
65
|
|
65
66
|
requirements: []
|
66
67
|
|
67
|
-
dependencies:
|
68
|
-
|
68
|
+
dependencies:
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: parseexel
|
71
|
+
version_requirement:
|
72
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.5.1
|
77
|
+
version:
|