beway 1.0.2 → 1.0.3
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/Gemfile +1 -1
- data/README +7 -16
- data/README.rdoc +8 -20
- data/doc/Beway.html +136 -183
- data/doc/Beway/Auction.html +630 -816
- data/doc/Beway/AuctionParseError.html +139 -158
- data/doc/Beway/Bidder.html +384 -529
- data/doc/Beway/BidderError.html +139 -158
- data/doc/Beway/CliRunner.html +742 -818
- data/doc/Beway/EbayData.html +398 -451
- data/doc/Beway/EbayDataParseError.html +139 -158
- data/doc/Beway/InvalidUrlError.html +139 -158
- data/doc/README.html +129 -167
- data/doc/created.rid +6 -6
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +134 -223
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/lib/beway/auction_rb.html +1 -1
- data/doc/lib/beway/bidder_rb.html +1 -1
- data/doc/lib/beway/cli_runner_rb.html +1 -1
- data/doc/lib/beway/ebay_data_rb.html +1 -1
- data/doc/rdoc.css +310 -473
- data/doc/table_of_contents.html +154 -0
- data/lib/beway.rb +4 -0
- data/lib/beway/auction.rb +5 -7
- data/lib/beway/cli_runner.rb +2 -3
- data/lib/beway/ebay_data.rb +1 -1
- data/spec/auction_spec.rb +12 -1
- data/spec/bidder_spec.rb +19 -3
- data/spec/config.rb +2 -2
- data/spec/html/kodak-film-old.html +59 -0
- metadata +82 -97
data/doc/Beway/EbayData.html
CHANGED
|
@@ -1,453 +1,400 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
5
4
|
<head>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
<pre>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<pre>
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
</div>
|
|
403
|
-
|
|
404
|
-
<div class="method-description">
|
|
405
|
-
|
|
406
|
-
<p>
|
|
407
|
-
The localtime offset from ebay time.
|
|
408
|
-
</p>
|
|
409
|
-
<p>
|
|
410
|
-
add this offset to localtime to get an estimated ebay time
|
|
411
|
-
</p>
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
<div class="method-source-code"
|
|
416
|
-
id="time-offset-source">
|
|
417
|
-
<pre>
|
|
418
|
-
<span class="ruby-comment cmt"># File lib/beway/ebay_data.rb, line 31</span>
|
|
419
|
-
31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_offset</span>
|
|
420
|
-
32: <span class="ruby-identifier">calc_time_offset</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@time_offset</span>
|
|
421
|
-
33: <span class="ruby-ivar">@time_offset</span>
|
|
422
|
-
34: <span class="ruby-keyword kw">end</span></pre>
|
|
423
|
-
</div>
|
|
424
|
-
|
|
425
|
-
</div>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
</div>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
</div>
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
</div>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
|
440
|
-
|
|
441
|
-
<p>Disabled; run with --debug to generate this.</p>
|
|
442
|
-
|
|
443
|
-
</div>
|
|
444
|
-
|
|
445
|
-
<div id="validator-badges">
|
|
446
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
447
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|
448
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
|
449
|
-
</div>
|
|
450
|
-
|
|
451
|
-
</body>
|
|
452
|
-
</html>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>class Beway::EbayData - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "../";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="class">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="../index.html">Home</a>
|
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div id="file-metadata">
|
|
47
|
+
<nav id="file-list-section" class="section">
|
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
|
49
|
+
<ul>
|
|
50
|
+
<li>lib/beway/ebay_data.rb
|
|
51
|
+
</ul>
|
|
52
|
+
</nav>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div id="class-metadata">
|
|
58
|
+
|
|
59
|
+
<nav id="parent-class-section" class="section">
|
|
60
|
+
<h3 class="section-header">Parent</h3>
|
|
61
|
+
|
|
62
|
+
<p class="link">Object
|
|
63
|
+
|
|
64
|
+
</nav>
|
|
65
|
+
|
|
66
|
+
<!-- Included Modules -->
|
|
67
|
+
<nav id="includes-section" class="section">
|
|
68
|
+
<h3 class="section-header">Included Modules</h3>
|
|
69
|
+
|
|
70
|
+
<ul class="link-list">
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<li><span class="include">Singleton</span>
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
</ul>
|
|
77
|
+
</nav>
|
|
78
|
+
|
|
79
|
+
<!-- Method Quickref -->
|
|
80
|
+
<nav id="method-list-section" class="section">
|
|
81
|
+
<h3 class="section-header">Methods</h3>
|
|
82
|
+
|
|
83
|
+
<ul class="link-list">
|
|
84
|
+
|
|
85
|
+
<li><a href="#method-c-new">::new</a>
|
|
86
|
+
|
|
87
|
+
<li><a href="#method-i-calc_time_offset">#calc_time_offset</a>
|
|
88
|
+
|
|
89
|
+
<li><a href="#method-i-official_time">#official_time</a>
|
|
90
|
+
|
|
91
|
+
<li><a href="#method-i-seconds_to">#seconds_to</a>
|
|
92
|
+
|
|
93
|
+
<li><a href="#method-i-time">#time</a>
|
|
94
|
+
|
|
95
|
+
<li><a href="#method-i-time_offset">#time_offset</a>
|
|
96
|
+
|
|
97
|
+
</ul>
|
|
98
|
+
</nav>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div id="project-metadata">
|
|
103
|
+
<nav id="fileindex-section" class="section project-section">
|
|
104
|
+
<h3 class="section-header">Pages</h3>
|
|
105
|
+
|
|
106
|
+
<ul>
|
|
107
|
+
|
|
108
|
+
<li class="file"><a href="../README.html">README</a>
|
|
109
|
+
|
|
110
|
+
</ul>
|
|
111
|
+
</nav>
|
|
112
|
+
|
|
113
|
+
<nav id="classindex-section" class="section project-section">
|
|
114
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
115
|
+
|
|
116
|
+
<ul class="link-list">
|
|
117
|
+
|
|
118
|
+
<li><a href="../Beway.html">Beway</a>
|
|
119
|
+
|
|
120
|
+
<li><a href="../Beway/Auction.html">Beway::Auction</a>
|
|
121
|
+
|
|
122
|
+
<li><a href="../Beway/AuctionParseError.html">Beway::AuctionParseError</a>
|
|
123
|
+
|
|
124
|
+
<li><a href="../Beway/Bidder.html">Beway::Bidder</a>
|
|
125
|
+
|
|
126
|
+
<li><a href="../Beway/BidderError.html">Beway::BidderError</a>
|
|
127
|
+
|
|
128
|
+
<li><a href="../Beway/CliRunner.html">Beway::CliRunner</a>
|
|
129
|
+
|
|
130
|
+
<li><a href="../Beway/EbayData.html">Beway::EbayData</a>
|
|
131
|
+
|
|
132
|
+
<li><a href="../Beway/EbayDataParseError.html">Beway::EbayDataParseError</a>
|
|
133
|
+
|
|
134
|
+
<li><a href="../Beway/InvalidUrlError.html">Beway::InvalidUrlError</a>
|
|
135
|
+
|
|
136
|
+
</ul>
|
|
137
|
+
</nav>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
</nav>
|
|
141
|
+
|
|
142
|
+
<div id="documentation">
|
|
143
|
+
<h1 class="class">class Beway::EbayData</h1>
|
|
144
|
+
|
|
145
|
+
<div id="description" class="description">
|
|
146
|
+
|
|
147
|
+
<p><a href="EbayData.html">EbayData</a></p>
|
|
148
|
+
|
|
149
|
+
<p>Singleton class to handle ebay queries that are not auction-related.</p>
|
|
150
|
+
|
|
151
|
+
</div><!-- description -->
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
<!-- Constants -->
|
|
163
|
+
<section id="constants-list" class="section">
|
|
164
|
+
<h3 class="section-header">Constants</h3>
|
|
165
|
+
<dl>
|
|
166
|
+
|
|
167
|
+
<dt id="EBAY_OFFICIAL_TIME_URL">EBAY_OFFICIAL_TIME_URL
|
|
168
|
+
|
|
169
|
+
<dd class="description">
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</dl>
|
|
173
|
+
</section>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<!-- Methods -->
|
|
179
|
+
|
|
180
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
181
|
+
<h3 class="section-header">Public Class Methods</h3>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
<div id="method-c-new" class="method-detail ">
|
|
185
|
+
|
|
186
|
+
<div class="method-heading">
|
|
187
|
+
<span class="method-name">new</span><span
|
|
188
|
+
class="method-args">()</span>
|
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
<div class="method-description">
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<div class="method-source-code" id="new-source">
|
|
200
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 18</span>
|
|
201
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
|
|
202
|
+
<span class="ruby-ivar">@time_offset</span> = <span class="ruby-keyword">nil</span>
|
|
203
|
+
<span class="ruby-ivar">@last_time_offset</span> = <span class="ruby-keyword">nil</span>
|
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
|
205
|
+
</div><!-- new-source -->
|
|
206
|
+
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</div><!-- new-method -->
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
</section><!-- public-class-method-details -->
|
|
216
|
+
|
|
217
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
218
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<div id="method-i-calc_time_offset" class="method-detail ">
|
|
222
|
+
|
|
223
|
+
<div class="method-heading">
|
|
224
|
+
<span class="method-name">calc_time_offset</span><span
|
|
225
|
+
class="method-args">()</span>
|
|
226
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
<div class="method-description">
|
|
231
|
+
|
|
232
|
+
<p>Calculate the ebay time offset</p>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
<div class="method-source-code" id="calc_time_offset-source">
|
|
237
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 37</span>
|
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">calc_time_offset</span>
|
|
239
|
+
<span class="ruby-ivar">@last_time_offset</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
|
240
|
+
<span class="ruby-ivar">@time_offset</span> = <span class="ruby-identifier">official_time</span> <span class="ruby-operator">-</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">localtime</span>
|
|
241
|
+
<span class="ruby-keyword">end</span></pre>
|
|
242
|
+
</div><!-- calc_time_offset-source -->
|
|
243
|
+
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
</div><!-- calc_time_offset-method -->
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
<div id="method-i-official_time" class="method-detail ">
|
|
253
|
+
|
|
254
|
+
<div class="method-heading">
|
|
255
|
+
<span class="method-name">official_time</span><span
|
|
256
|
+
class="method-args">()</span>
|
|
257
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<div class="method-description">
|
|
262
|
+
|
|
263
|
+
<p>Retrieve the official ebay time</p>
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
<div class="method-source-code" id="official_time-source">
|
|
268
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 43</span>
|
|
269
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">official_time</span>
|
|
270
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">HTML</span>(<span class="ruby-identifier">open</span>(<span class="ruby-constant">EBAY_OFFICIAL_TIME_URL</span>))
|
|
271
|
+
|
|
272
|
+
<span class="ruby-identifier">time_label</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">at_xpath</span>(<span class="ruby-string">'//p[contains(text(), "The official eBay Time is now:")]'</span>)
|
|
273
|
+
|
|
274
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">EbayDataParseError</span>, <span class="ruby-string">"Couldn't find time label"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">time_label</span>
|
|
275
|
+
|
|
276
|
+
<span class="ruby-identifier">time_node</span> = <span class="ruby-identifier">time_label</span>.<span class="ruby-identifier">next_sibling</span>.<span class="ruby-identifier">next_sibling</span>
|
|
277
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">EbayDataParseError</span>, <span class="ruby-string">"Couldn't find time node"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">time_node</span>
|
|
278
|
+
|
|
279
|
+
<span class="ruby-identifier">time_str</span> = <span class="ruby-identifier">time_node</span>.<span class="ruby-identifier">inner_text</span>
|
|
280
|
+
<span class="ruby-identifier">time_re</span> = <span class="ruby-regexp">%r(Sun|Mon|Tues|Wednes|Thurs|Fri|Satur)day, (January|February|March|April|May|June|July|August|September|October|November|December) \d\d, 20\d\d \d\d:\d\d:\d\d P[SD]T/</span>
|
|
281
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">EbayDataParseError</span>, <span class="ruby-node">"Time in unexpected format: #{time_str}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">time_re</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">time_str</span>)
|
|
282
|
+
|
|
283
|
+
<span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">time_str</span>).<span class="ruby-identifier">localtime</span>
|
|
284
|
+
<span class="ruby-keyword">end</span></pre>
|
|
285
|
+
</div><!-- official_time-source -->
|
|
286
|
+
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
</div><!-- official_time-method -->
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
<div id="method-i-seconds_to" class="method-detail ">
|
|
296
|
+
|
|
297
|
+
<div class="method-heading">
|
|
298
|
+
<span class="method-name">seconds_to</span><span
|
|
299
|
+
class="method-args">(some_ebay_time)</span>
|
|
300
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<div class="method-description">
|
|
305
|
+
|
|
306
|
+
<p>Returns the number of seconds to some_ebay_time</p>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
<div class="method-source-code" id="seconds_to-source">
|
|
311
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 61</span>
|
|
312
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">seconds_to</span>(<span class="ruby-identifier">some_ebay_time</span>)
|
|
313
|
+
<span class="ruby-identifier">some_ebay_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">time</span>
|
|
314
|
+
<span class="ruby-keyword">end</span></pre>
|
|
315
|
+
</div><!-- seconds_to-source -->
|
|
316
|
+
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
</div><!-- seconds_to-method -->
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<div id="method-i-time" class="method-detail ">
|
|
326
|
+
|
|
327
|
+
<div class="method-heading">
|
|
328
|
+
<span class="method-name">time</span><span
|
|
329
|
+
class="method-args">()</span>
|
|
330
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
<div class="method-description">
|
|
335
|
+
|
|
336
|
+
<p>The current ebay time as calculated by an offset from localtime.</p>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
<div class="method-source-code" id="time-source">
|
|
341
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 24</span>
|
|
342
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">time</span>
|
|
343
|
+
<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">localtime</span> <span class="ruby-operator">+</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">time_offset</span>
|
|
344
|
+
<span class="ruby-keyword">end</span></pre>
|
|
345
|
+
</div><!-- time-source -->
|
|
346
|
+
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
</div><!-- time-method -->
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
<div id="method-i-time_offset" class="method-detail ">
|
|
356
|
+
|
|
357
|
+
<div class="method-heading">
|
|
358
|
+
<span class="method-name">time_offset</span><span
|
|
359
|
+
class="method-args">()</span>
|
|
360
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
<div class="method-description">
|
|
365
|
+
|
|
366
|
+
<p>The localtime offset from ebay time.</p>
|
|
367
|
+
|
|
368
|
+
<p>add this offset to localtime to get an estimated ebay time</p>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
<div class="method-source-code" id="time_offset-source">
|
|
373
|
+
<pre><span class="ruby-comment"># File lib/beway/ebay_data.rb, line 31</span>
|
|
374
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">time_offset</span>
|
|
375
|
+
<span class="ruby-identifier">calc_time_offset</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@time_offset</span>
|
|
376
|
+
<span class="ruby-ivar">@time_offset</span>
|
|
377
|
+
<span class="ruby-keyword">end</span></pre>
|
|
378
|
+
</div><!-- time_offset-source -->
|
|
379
|
+
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
</div><!-- time_offset-method -->
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
</section><!-- public-instance-method-details -->
|
|
389
|
+
|
|
390
|
+
</section><!-- 5Buntitled-5D -->
|
|
391
|
+
|
|
392
|
+
</div><!-- documentation -->
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
<footer id="validator-badges">
|
|
396
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
397
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
|
398
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
399
|
+
</footer>
|
|
453
400
|
|