hobos 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -8
- data/bin/hobos +1 -14
- data/lib/hobos/version.rb +1 -1
- data/lib/hobos.rb +14 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f29bddcb4e06fe7a1dce9845922a1351fbce5a5
|
4
|
+
data.tar.gz: 12d4b6c91ca247757a387a91de5789537fa503a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d88e662ebb5ed1ea5775b794efdc574ba620e24fa818695836de739bedbccf6b6187e51275c89306c779da804eca25a42438bae2079a165dc42d56aba0fe7844
|
7
|
+
data.tar.gz: 355f66aa5912a00caf2aa5d1a6c25d5c4979906ad746a21536ccc3bf14b200418ef7ddc2545a4c61aeff7fd3715a0db746cd9c9fd16701331fb085918c890a08
|
data/README.md
CHANGED
@@ -9,18 +9,12 @@ Fuck off and read a hobo name.
|
|
9
9
|
## Installation:
|
10
10
|
|
11
11
|
```BASH
|
12
|
-
|
13
|
-
cd hobos
|
14
|
-
gem build hobos.gemspec
|
15
|
-
gem install hobos-0.0.2.gem
|
16
|
-
cd ..
|
12
|
+
gem install hobos -v 0.0.5
|
17
13
|
```
|
18
14
|
|
19
|
-
And now
|
15
|
+
And now...
|
20
16
|
|
21
17
|
```bash
|
22
18
|
$ hobos
|
23
19
|
#=> Big-Tipper Silas Fake-Nickel
|
24
|
-
$ hobos 1
|
25
|
-
# => 'Stewbuilder Dennis'
|
26
20
|
```
|
data/bin/hobos
CHANGED
@@ -4,21 +4,8 @@ require 'hobos'
|
|
4
4
|
|
5
5
|
$api = Hobos::Api.new
|
6
6
|
|
7
|
-
|
8
|
-
def try_hobo found_hobo
|
9
|
-
resp = $api.hobo rand(0..700)
|
10
|
-
while !found_hobo
|
11
|
-
if resp != "{ 'error': { 'message': 'bad UID' } }"
|
12
|
-
found_hobo = true
|
13
|
-
else
|
14
|
-
try_hobo(found_hobo)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
puts resp
|
18
|
-
end
|
19
|
-
|
20
7
|
if ARGV[0]
|
21
8
|
puts $api.hobo ARGV[0]
|
22
9
|
else
|
23
|
-
|
10
|
+
puts $api.hobo
|
24
11
|
end
|
data/lib/hobos/version.rb
CHANGED
data/lib/hobos.rb
CHANGED
@@ -6,15 +6,23 @@ module Hobos
|
|
6
6
|
@browser = Browser.new.browser
|
7
7
|
end
|
8
8
|
|
9
|
-
def hobo
|
10
|
-
|
11
|
-
clean_name(@browser.get("http://www.e-hobo.com/hoboes/#{uid}").at('span').children.last.to_s)
|
12
|
-
rescue
|
13
|
-
"{ 'error': { 'message': 'bad UID' } }"
|
14
|
-
end
|
9
|
+
def hobo
|
10
|
+
clean_name(try_hobo(false))
|
15
11
|
end
|
16
12
|
|
17
13
|
private
|
14
|
+
def try_hobo found_hobo
|
15
|
+
while !found_hobo
|
16
|
+
resp = @browser.get("http://www.e-hobo.com/hoboes/#{rand(1..700)}").at('span').children.last.to_s
|
17
|
+
if resp == "{ 'error': { 'message': 'bad UID' } }"
|
18
|
+
try_hobo false
|
19
|
+
else
|
20
|
+
found_hobo = true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
resp
|
24
|
+
end
|
25
|
+
|
18
26
|
def clean_name hobo_name
|
19
27
|
hobo_name.gsub!(/\d/, '')
|
20
28
|
hobo_name.gsub!('#', '')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert H Grayson II
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|