roo 0.2.3 → 0.2.4
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.
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/README.txt +2 -0
- data/Rakefile +2 -0
- data/lib/roo.rb +1 -0
- data/lib/roo/excel.rb +1 -1
- data/lib/roo/google.rb +182 -0
- data/lib/roo/openoffice.rb +70 -18
- data/lib/roo/version.rb +1 -1
- data/test/numbers1.ods +0 -0
- data/test/test_roo.rb +486 -255
- data/website/index.html +30 -40
- data/website/index.txt +28 -38
- metadata +13 -3
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.2.
|
36
|
+
<a href="http://rubyforge.org/projects/roo" class="numbers">0.2.4</a>
|
37
37
|
</div>
|
38
38
|
<h2>What</h2>
|
39
39
|
|
@@ -61,7 +61,7 @@
|
|
61
61
|
<p>Supposed you have created this spreadsheet:</p>
|
62
62
|
|
63
63
|
|
64
|
-
<p><img src="Screenshot-
|
64
|
+
<p><img src="Screenshot-spreadsheet3.png"></p>
|
65
65
|
|
66
66
|
|
67
67
|
<p>which includes the amount of work you have done for a customer.</p>
|
@@ -77,24 +77,20 @@
|
|
77
77
|
3
|
78
78
|
4 HOURLY_RATE = 123.45
|
79
79
|
5
|
80
|
-
6 oo = Openoffice.new("
|
80
|
+
6 oo = Openoffice.new("simple_spreadsheet.ods")
|
81
81
|
7 oo.default_sheet = oo.sheets.first
|
82
|
-
8 4.upto(
|
83
|
-
9
|
84
|
-
10
|
85
|
-
11
|
86
|
-
12
|
87
|
-
13
|
88
|
-
14
|
89
|
-
15
|
90
|
-
16
|
91
|
-
17
|
92
|
-
18
|
93
|
-
19
|
94
|
-
20 if date
|
95
|
-
21 puts "#{date}\t#{sum}\t#{amount}\t#{comment}"
|
96
|
-
22 end
|
97
|
-
23 end
|
82
|
+
8 4.upto(12) do |line|
|
83
|
+
9 date = oo.cell(line,'A')
|
84
|
+
10 start_time = oo.cell(line,'B')
|
85
|
+
11 end_time = oo.cell(line,'C')
|
86
|
+
12 pause = oo.cell(line,'D')
|
87
|
+
13 sum = (end_time - start_time) - pause
|
88
|
+
14 comment = oo.cell(line,'F')
|
89
|
+
15 amount = sum * HOURLY_RATE
|
90
|
+
16 if date
|
91
|
+
17 puts "#{date}\t#{sum}\t#{amount}\t#{comment}"
|
92
|
+
18 end
|
93
|
+
19 end
|
98
94
|
</code>
|
99
95
|
</pre>
|
100
96
|
|
@@ -103,22 +99,15 @@
|
|
103
99
|
|
104
100
|
<pre>
|
105
101
|
<code>
|
106
|
-
2007-05-07 1.
|
107
|
-
2007-05-07 1.
|
108
|
-
2007-05-
|
109
|
-
2007-05-08 1.0 123.45
|
110
|
-
2007-05-08 0
|
111
|
-
2007-05-
|
112
|
-
2007-05-14 0.5 61.725
|
113
|
-
2007-05-
|
114
|
-
2007-05-15 0.
|
115
|
-
2007-05-15 0.5 61.725 G��stebuch
|
116
|
-
2007-05-15 0.5 61.725 G��stebuch
|
117
|
-
2007-05-16 1.0 123.45 G��stebuch
|
118
|
-
2007-05-17 0.25 30.8625 G��stebuch
|
119
|
-
2007-05-17 1.25 154.3125 G��stebuch
|
120
|
-
2007-05-18 3.0 370.35 G��stebuch
|
121
|
-
2007-05-18 1.75 216.0375 G��stebuch
|
102
|
+
2007-05-07 1.0 123.45 Task 1
|
103
|
+
2007-05-07 1.75 216.0375 Task 1
|
104
|
+
2007-05-07 1.0 123.45 Task 2
|
105
|
+
2007-05-08 1.0 123.45 Task 2
|
106
|
+
2007-05-08 1.0 123.45 Task 3
|
107
|
+
2007-05-08 0.5 61.725 Task 3
|
108
|
+
2007-05-14 0.5 61.725 Task 3
|
109
|
+
2007-05-14 0.5 61.725 Task 3
|
110
|
+
2007-05-15 1.0 123.45 Task 3
|
122
111
|
</code>
|
123
112
|
</pre>
|
124
113
|
|
@@ -135,7 +124,7 @@
|
|
135
124
|
|
136
125
|
<pre>
|
137
126
|
<code>
|
138
|
-
|
127
|
+
4.upto(12) do |line|
|
139
128
|
</code>
|
140
129
|
</pre>
|
141
130
|
|
@@ -144,7 +133,7 @@
|
|
144
133
|
|
145
134
|
<pre>
|
146
135
|
<code>
|
147
|
-
|
136
|
+
4.upto(oo.last_row) do |line|
|
148
137
|
</code>
|
149
138
|
</pre>
|
150
139
|
|
@@ -156,7 +145,7 @@
|
|
156
145
|
|
157
146
|
Replace Openoffice with
|
158
147
|
<pre>
|
159
|
-
<code>oo = Excel.new("
|
148
|
+
<code>oo = Excel.new("simple_spreadsheet.xls").
|
160
149
|
|
161
150
|
</code>
|
162
151
|
</pre>
|
@@ -206,10 +195,11 @@ is the setting of the default-worksheet. OpenOffice uses the name of the workshe
|
|
206
195
|
|
207
196
|
<ul>
|
208
197
|
<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 &#
|
198
|
+
<li>for the Excel-part the “spreadsheet’:http://rubyforge.org/projects/spreadsheet/ gem is used. My functions are a convenient wrapper around the functions of this gem</li>
|
199
|
+
<li>Dirk Huth fürs Testen unter Windows</li>
|
210
200
|
</ul>
|
211
201
|
<p class="coda">
|
212
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>,
|
202
|
+
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 5th June 2007<br>
|
213
203
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
214
204
|
</p>
|
215
205
|
</div>
|
data/website/index.txt
CHANGED
@@ -18,7 +18,7 @@ h2. Demonstration of usage
|
|
18
18
|
|
19
19
|
Supposed you have created this spreadsheet:
|
20
20
|
|
21
|
-
<img src="Screenshot-
|
21
|
+
<img src="Screenshot-spreadsheet3.png">
|
22
22
|
|
23
23
|
which includes the amount of work you have done for a customer.
|
24
24
|
|
@@ -31,24 +31,20 @@ You can now process this spreadsheet with the following sample code.
|
|
31
31
|
3
|
32
32
|
4 HOURLY_RATE = 123.45
|
33
33
|
5
|
34
|
-
6 oo = Openoffice.new("
|
34
|
+
6 oo = Openoffice.new("simple_spreadsheet.ods")
|
35
35
|
7 oo.default_sheet = oo.sheets.first
|
36
|
-
8 4.upto(
|
37
|
-
9
|
38
|
-
10
|
39
|
-
11
|
40
|
-
12
|
41
|
-
13
|
42
|
-
14
|
43
|
-
15
|
44
|
-
16
|
45
|
-
17
|
46
|
-
18
|
47
|
-
19
|
48
|
-
20 if date
|
49
|
-
21 puts "#{date}\t#{sum}\t#{amount}\t#{comment}"
|
50
|
-
22 end
|
51
|
-
23 end
|
36
|
+
8 4.upto(12) do |line|
|
37
|
+
9 date = oo.cell(line,'A')
|
38
|
+
10 start_time = oo.cell(line,'B')
|
39
|
+
11 end_time = oo.cell(line,'C')
|
40
|
+
12 pause = oo.cell(line,'D')
|
41
|
+
13 sum = (end_time - start_time) - pause
|
42
|
+
14 comment = oo.cell(line,'F')
|
43
|
+
15 amount = sum * HOURLY_RATE
|
44
|
+
16 if date
|
45
|
+
17 puts "#{date}\t#{sum}\t#{amount}\t#{comment}"
|
46
|
+
18 end
|
47
|
+
19 end
|
52
48
|
</code>
|
53
49
|
</pre>
|
54
50
|
|
@@ -56,22 +52,15 @@ which produces this output
|
|
56
52
|
|
57
53
|
<pre>
|
58
54
|
<code>
|
59
|
-
2007-05-07 1.
|
60
|
-
2007-05-07 1.
|
61
|
-
2007-05-
|
62
|
-
2007-05-08 1.0 123.45
|
63
|
-
2007-05-08 0
|
64
|
-
2007-05-
|
65
|
-
2007-05-14 0.5 61.725
|
66
|
-
2007-05-
|
67
|
-
2007-05-15 0.
|
68
|
-
2007-05-15 0.5 61.725 G��stebuch
|
69
|
-
2007-05-15 0.5 61.725 G��stebuch
|
70
|
-
2007-05-16 1.0 123.45 G��stebuch
|
71
|
-
2007-05-17 0.25 30.8625 G��stebuch
|
72
|
-
2007-05-17 1.25 154.3125 G��stebuch
|
73
|
-
2007-05-18 3.0 370.35 G��stebuch
|
74
|
-
2007-05-18 1.75 216.0375 G��stebuch
|
55
|
+
2007-05-07 1.0 123.45 Task 1
|
56
|
+
2007-05-07 1.75 216.0375 Task 1
|
57
|
+
2007-05-07 1.0 123.45 Task 2
|
58
|
+
2007-05-08 1.0 123.45 Task 2
|
59
|
+
2007-05-08 1.0 123.45 Task 3
|
60
|
+
2007-05-08 0.5 61.725 Task 3
|
61
|
+
2007-05-14 0.5 61.725 Task 3
|
62
|
+
2007-05-14 0.5 61.725 Task 3
|
63
|
+
2007-05-15 1.0 123.45 Task 3
|
75
64
|
</code>
|
76
65
|
</pre>
|
77
66
|
|
@@ -86,7 +75,7 @@ you can change line 8 from
|
|
86
75
|
|
87
76
|
<pre>
|
88
77
|
<code>
|
89
|
-
|
78
|
+
4.upto(12) do |line|
|
90
79
|
</code>
|
91
80
|
</pre>
|
92
81
|
|
@@ -94,7 +83,7 @@ to
|
|
94
83
|
|
95
84
|
<pre>
|
96
85
|
<code>
|
97
|
-
|
86
|
+
4.upto(oo.last_row) do |line|
|
98
87
|
</code>
|
99
88
|
</pre>
|
100
89
|
|
@@ -104,7 +93,7 @@ You can also access MS-Excel spreadsheat.
|
|
104
93
|
|
105
94
|
Replace Openoffice with
|
106
95
|
<pre>
|
107
|
-
<code>oo = Excel.new("
|
96
|
+
<code>oo = Excel.new("simple_spreadsheet.xls").
|
108
97
|
|
109
98
|
</code>
|
110
99
|
</pre>
|
@@ -140,4 +129,5 @@ Comments are welcome. Send an email to "Thomas Preymesser":mailto:thopre@gmail.c
|
|
140
129
|
h2. Thanks
|
141
130
|
|
142
131
|
* "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 '
|
132
|
+
* for the Excel-part the "spreadsheet':http://rubyforge.org/projects/spreadsheet/ gem is used. My functions are a convenient wrapper around the functions of this gem
|
133
|
+
* Dirk Huth fürs Testen unter Windows
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: roo
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-06-
|
6
|
+
version: 0.2.4
|
7
|
+
date: 2007-06-17 00:00:00 +02:00
|
8
8
|
summary: roo can access the contents of OpenOffice-Spreadsheets
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- lib/roo/version.rb
|
39
39
|
- lib/roo/openoffice.rb
|
40
40
|
- lib/roo/excel.rb
|
41
|
+
- lib/roo/google.rb
|
41
42
|
- scripts/txt2html
|
42
43
|
- setup.rb
|
43
44
|
- test/test_helper.rb
|
@@ -86,3 +87,12 @@ dependencies:
|
|
86
87
|
- !ruby/object:Gem::Version
|
87
88
|
version: 0.9.1
|
88
89
|
version:
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: hpricot
|
92
|
+
version_requirement:
|
93
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: "0.5"
|
98
|
+
version:
|