beway 0.0.2 → 1.0.0
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/doc/Beway/CliRunner.html +86 -83
- data/doc/created.rid +2 -2
- data/doc/lib/beway/cli_runner_rb.html +1 -1
- data/lib/beway/cli_runner.rb +3 -0
- metadata +3 -3
data/doc/Beway/CliRunner.html
CHANGED
@@ -302,14 +302,17 @@ auction
|
|
302
302
|
95: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"That auction is done already! Try another, or 'exit' to quit."</span>
|
303
303
|
96: <span class="ruby-keyword kw">next</span>
|
304
304
|
97: <span class="ruby-keyword kw">end</span>
|
305
|
-
98: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">
|
306
|
-
99: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Sorry, we can't
|
305
|
+
98: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidUrlError</span>
|
306
|
+
99: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Sorry, we can't snipe that url."</span>
|
307
307
|
100: <span class="ruby-keyword kw">next</span>
|
308
|
-
101: <span class="ruby-keyword kw">
|
309
|
-
102:
|
310
|
-
103:
|
311
|
-
104:
|
312
|
-
105:
|
308
|
+
101: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">AuctionParseError</span>
|
309
|
+
102: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Sorry, we can't parse that url as an auction"</span>
|
310
|
+
103: <span class="ruby-keyword kw">next</span>
|
311
|
+
104: <span class="ruby-keyword kw">end</span>
|
312
|
+
105:
|
313
|
+
106: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">auction</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prompt_confirm_auction</span>(<span class="ruby-identifier">auction</span>)
|
314
|
+
107: <span class="ruby-keyword kw">end</span>
|
315
|
+
108: <span class="ruby-keyword kw">end</span></pre>
|
313
316
|
</div>
|
314
317
|
|
315
318
|
</div>
|
@@ -377,17 +380,17 @@ auction
|
|
377
380
|
<div class="method-source-code"
|
378
381
|
id="display-auction-source">
|
379
382
|
<pre>
|
380
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
383
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 114</span>
|
384
|
+
114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display_auction</span>(<span class="ruby-identifier">a</span>)
|
385
|
+
115: <span class="ruby-identifier">puts</span>
|
386
|
+
116: <span class="ruby-identifier">puts</span> <span class="ruby-node">"URL: #{a.url}"</span>
|
387
|
+
117: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Description: #{a.description}"</span>
|
388
|
+
118: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Auction Number: #{a.auction_number}"</span>
|
389
|
+
119: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Current Bid: #{a.current_bid}"</span>
|
390
|
+
120: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Min Bid: #{a.min_bid || '-- bidding closed --'}"</span>
|
391
|
+
121: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Time Left: #{a.time_left || '-- bidding closed --'}"</span>
|
392
|
+
122: <span class="ruby-identifier">puts</span> <span class="ruby-node">"End Time: #{a.end_time}"</span>
|
393
|
+
123: <span class="ruby-keyword kw">end</span></pre>
|
391
394
|
</div>
|
392
395
|
|
393
396
|
</div>
|
@@ -418,10 +421,10 @@ auction
|
|
418
421
|
<div class="method-source-code"
|
419
422
|
id="display-intro-source">
|
420
423
|
<pre>
|
421
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
422
|
-
|
423
|
-
|
424
|
-
|
424
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 110</span>
|
425
|
+
110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display_intro</span>
|
426
|
+
111: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Welcome to Beway's CLI interface"</span>
|
427
|
+
112: <span class="ruby-keyword kw">end</span></pre>
|
425
428
|
</div>
|
426
429
|
|
427
430
|
</div>
|
@@ -452,12 +455,12 @@ auction
|
|
452
455
|
<div class="method-source-code"
|
453
456
|
id="get-user-input-source">
|
454
457
|
<pre>
|
455
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
458
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 180</span>
|
459
|
+
180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_user_input</span>
|
460
|
+
181: <span class="ruby-identifier">s</span> = <span class="ruby-identifier">gets</span>
|
461
|
+
182: <span class="ruby-identifier">exit</span> <span class="ruby-keyword kw">if</span> <span class="ruby-value str">'exit'</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">downcase</span>
|
462
|
+
183: <span class="ruby-identifier">s</span>
|
463
|
+
184: <span class="ruby-keyword kw">end</span></pre>
|
461
464
|
</div>
|
462
465
|
|
463
466
|
</div>
|
@@ -488,15 +491,15 @@ auction
|
|
488
491
|
<div class="method-source-code"
|
489
492
|
id="prompt-bid-source">
|
490
493
|
<pre>
|
491
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
494
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 140</span>
|
495
|
+
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_bid</span>(<span class="ruby-identifier">min</span>=<span class="ruby-keyword kw">nil</span>)
|
496
|
+
141: <span class="ruby-identifier">print</span> <span class="ruby-value str">"Enter your bid for the item >> "</span>
|
497
|
+
142: <span class="ruby-identifier">bid</span> = <span class="ruby-identifier">get_user_input</span>.<span class="ruby-identifier">to_f</span>
|
498
|
+
143: <span class="ruby-identifier">puts</span>
|
499
|
+
144: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bid</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">min</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">bid</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">min</span>
|
500
|
+
145: <span class="ruby-identifier">puts</span> <span class="ruby-node">"The minimum bid for this auction is #{min}. Try again, or type 'exit' to quit."</span>
|
501
|
+
146: <span class="ruby-identifier">prompt_bid</span>(<span class="ruby-identifier">min</span>)
|
502
|
+
147: <span class="ruby-keyword kw">end</span></pre>
|
500
503
|
</div>
|
501
504
|
|
502
505
|
</div>
|
@@ -527,17 +530,17 @@ auction
|
|
527
530
|
<div class="method-source-code"
|
528
531
|
id="prompt-confirm-auction-source">
|
529
532
|
<pre>
|
530
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
533
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 160</span>
|
534
|
+
160: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_confirm_auction</span>(<span class="ruby-identifier">a</span>)
|
535
|
+
161: <span class="ruby-identifier">display_auction</span>(<span class="ruby-identifier">a</span>)
|
536
|
+
162: <span class="ruby-identifier">print</span> <span class="ruby-value str">'Does this look like your auction? (y\n) >> '</span>
|
537
|
+
163: <span class="ruby-identifier">confirm</span> = <span class="ruby-identifier">get_user_input</span>
|
538
|
+
164: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confirm</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">chr</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'y'</span>
|
539
|
+
165: <span class="ruby-keyword kw">true</span>
|
540
|
+
166: <span class="ruby-keyword kw">else</span>
|
541
|
+
167: <span class="ruby-keyword kw">false</span>
|
542
|
+
168: <span class="ruby-keyword kw">end</span>
|
543
|
+
169: <span class="ruby-keyword kw">end</span></pre>
|
541
544
|
</div>
|
542
545
|
|
543
546
|
</div>
|
@@ -568,17 +571,17 @@ auction
|
|
568
571
|
<div class="method-source-code"
|
569
572
|
id="prompt-confirm-bid-source">
|
570
573
|
<pre>
|
571
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
574
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 149</span>
|
575
|
+
149: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_confirm_bid</span>(<span class="ruby-identifier">amount</span>)
|
576
|
+
150: <span class="ruby-identifier">printf</span> <span class="ruby-value str">"Are you sure you want to bid %.2f? (y\\n) >> "</span>, <span class="ruby-identifier">amount</span>
|
577
|
+
151: <span class="ruby-identifier">confirm</span> = <span class="ruby-identifier">get_user_input</span>
|
578
|
+
152: <span class="ruby-identifier">puts</span>
|
579
|
+
153: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confirm</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">chr</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'y'</span>
|
580
|
+
154: <span class="ruby-keyword kw">true</span>
|
581
|
+
155: <span class="ruby-keyword kw">else</span>
|
582
|
+
156: <span class="ruby-keyword kw">false</span>
|
583
|
+
157: <span class="ruby-keyword kw">end</span>
|
584
|
+
158: <span class="ruby-keyword kw">end</span></pre>
|
582
585
|
</div>
|
583
586
|
|
584
587
|
</div>
|
@@ -609,16 +612,16 @@ auction
|
|
609
612
|
<div class="method-source-code"
|
610
613
|
id="prompt-password-source">
|
611
614
|
<pre>
|
612
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
615
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 130</span>
|
616
|
+
130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_password</span>
|
617
|
+
131: <span class="ruby-identifier">print</span> <span class="ruby-value str">"Enter eBay password >> "</span>
|
618
|
+
132: <span class="ruby-identifier">system</span> <span class="ruby-value str">"stty -echo"</span>
|
619
|
+
133: <span class="ruby-identifier">pass</span> = <span class="ruby-identifier">get_user_input</span>
|
620
|
+
134: <span class="ruby-identifier">system</span> <span class="ruby-value str">"stty echo"</span>
|
621
|
+
135: <span class="ruby-identifier">puts</span>
|
622
|
+
136:
|
623
|
+
137: <span class="ruby-identifier">pass</span>.<span class="ruby-identifier">chomp</span>
|
624
|
+
138: <span class="ruby-keyword kw">end</span></pre>
|
622
625
|
</div>
|
623
626
|
|
624
627
|
</div>
|
@@ -649,15 +652,15 @@ auction
|
|
649
652
|
<div class="method-source-code"
|
650
653
|
id="prompt-url-source">
|
651
654
|
<pre>
|
652
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
655
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 171</span>
|
656
|
+
171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_url</span>
|
657
|
+
172: <span class="ruby-identifier">puts</span>
|
658
|
+
173: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Enter an ebay auction url (or 'exit' to exit): "</span>
|
659
|
+
174: <span class="ruby-identifier">print</span> <span class="ruby-value str">"\n>> "</span>
|
660
|
+
175: <span class="ruby-identifier">url</span> = <span class="ruby-identifier">get_user_input</span>
|
661
|
+
176:
|
662
|
+
177: <span class="ruby-identifier">url</span>.<span class="ruby-identifier">chomp</span>
|
663
|
+
178: <span class="ruby-keyword kw">end</span></pre>
|
661
664
|
</div>
|
662
665
|
|
663
666
|
</div>
|
@@ -688,11 +691,11 @@ auction
|
|
688
691
|
<div class="method-source-code"
|
689
692
|
id="prompt-username-source">
|
690
693
|
<pre>
|
691
|
-
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
694
|
+
<span class="ruby-comment cmt"># File lib/beway/cli_runner.rb, line 125</span>
|
695
|
+
125: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prompt_username</span>
|
696
|
+
126: <span class="ruby-identifier">print</span> <span class="ruby-value str">"Enter eBay username >> "</span>
|
697
|
+
127: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_user_input</span>.<span class="ruby-identifier">chomp</span>
|
698
|
+
128: <span class="ruby-keyword kw">end</span></pre>
|
696
699
|
</div>
|
697
700
|
|
698
701
|
</div>
|
data/doc/created.rid
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
Thu, 27 Jan 2011 19:25:48 -0800
|
2
2
|
README Tue, 04 Jan 2011 18:26:07 -0800
|
3
3
|
lib/beway/ebay_data.rb Mon, 27 Dec 2010 00:14:52 -0800
|
4
4
|
lib/beway/auction.rb Wed, 05 Jan 2011 10:18:33 -0800
|
5
|
-
lib/beway/cli_runner.rb
|
5
|
+
lib/beway/cli_runner.rb Thu, 27 Jan 2011 19:23:41 -0800
|
6
6
|
lib/beway/bidder.rb Tue, 04 Jan 2011 16:07:37 -0800
|
data/lib/beway/cli_runner.rb
CHANGED
@@ -95,6 +95,9 @@ module Beway
|
|
95
95
|
puts "That auction is done already! Try another, or 'exit' to quit."
|
96
96
|
next
|
97
97
|
end
|
98
|
+
rescue InvalidUrlError
|
99
|
+
puts "Sorry, we can't snipe that url."
|
100
|
+
next
|
98
101
|
rescue AuctionParseError
|
99
102
|
puts "Sorry, we can't parse that url as an auction"
|
100
103
|
next
|
metadata
CHANGED
@@ -3,10 +3,10 @@ name: beway
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
+
- 1
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.2
|
9
|
+
version: 1.0.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Dibson T Hoffweiler
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-27 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
- beway
|
20
20
|
dependencies:
|