xkcd 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xkcd.rb +1 -1
- metadata +50 -29
data/lib/xkcd.rb
CHANGED
@@ -32,7 +32,7 @@ class XKCD
|
|
32
32
|
=end
|
33
33
|
def self.img
|
34
34
|
max = JSON.parse(open('http://xkcd.com/info.0.json').read)["num"]
|
35
|
-
comic_num =
|
35
|
+
comic_num = 1 + rand(max-1)
|
36
36
|
comic_num = 1 if comic_num == 404 # Avoid 404th comic ;)
|
37
37
|
comic = JSON.parse(open("http://xkcd.com/#{comic_num}/info.0.json").read)
|
38
38
|
"#{comic['alt']} : #{comic['img']}"
|
metadata
CHANGED
@@ -1,62 +1,83 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: xkcd
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Hemanth.HM
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-05-20 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: nokogiri
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 5
|
32
|
+
- 0
|
21
33
|
version: 1.5.0
|
22
34
|
type: :runtime
|
23
|
-
|
24
|
-
version_requirements: *72954180
|
35
|
+
version_requirements: *id001
|
25
36
|
description: A simple gem to get random img/comic url from xkcd
|
26
37
|
email: hemanth.hm@gmail.com
|
27
|
-
executables:
|
38
|
+
executables:
|
28
39
|
- xkcd
|
29
40
|
extensions: []
|
41
|
+
|
30
42
|
extra_rdoc_files: []
|
31
|
-
|
43
|
+
|
44
|
+
files:
|
32
45
|
- Rakefile
|
33
46
|
- lib/xkcd.rb
|
34
47
|
- bin/xkcd
|
35
48
|
- test/test_karam.rb
|
36
49
|
homepage: http://rubygems.org/gems/xkcd
|
37
50
|
licenses: []
|
51
|
+
|
38
52
|
post_install_message:
|
39
53
|
rdoc_options: []
|
40
|
-
|
54
|
+
|
55
|
+
require_paths:
|
41
56
|
- lib
|
42
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
58
|
none: false
|
44
|
-
requirements:
|
45
|
-
- -
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
|
48
|
-
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
67
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
54
75
|
requirements: []
|
76
|
+
|
55
77
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.24
|
57
79
|
signing_key:
|
58
80
|
specification_version: 3
|
59
81
|
summary: XCKD random img urls!
|
60
|
-
test_files:
|
82
|
+
test_files:
|
61
83
|
- test/test_karam.rb
|
62
|
-
has_rdoc:
|