lita-catme 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -1
- data/README.md +1 -0
- data/lib/lita/handlers/cat.rb +1 -1
- data/lib/lita/handlers/catme.rb +1 -1
- data/lita-catme.gemspec +3 -2
- data/spec/fixtures/vcr_cassettes/fetch_cat.yml +51 -52
- data/spec/fixtures/vcr_cassettes/fetch_multiple_cats.yml +96 -97
- data/spec/fixtures/vcr_cassettes/fetch_with_category.yml +51 -52
- data/spec/fixtures/vcr_cassettes/fetch_with_invalid_category.yml +45 -46
- data/spec/spec_helper.rb +2 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2307b654950c7b78e5f047f75a35800cb5ff427fab514548b04abcba6159c7ca
|
4
|
+
data.tar.gz: ead0ffc9872beeb1d97ed6943d2452214c2965f7129561a0788e50464663a079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92da9fced694aff5ba92e1e991fa90c603f36509f3581164528c9d5e049335edf01b55a29fc57dd8926220e91da2dd69d597b16ef7d6c96a509c8736bbce7f5d
|
7
|
+
data.tar.gz: 49350be21724da47bdc2b48c2225de8f96c0c62fc96e163f192d57c7ce1ce02e5a08071f330e9176a4ef80208d332619455054d334d8a35d266c48fa22b9b863
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# lita-catme
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/Emile-Filteau/lita-catme.png?branch=master)](https://travis-ci.org/Emile-Filteau/lita-catme)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/github/Emile-Filteau/lita-catme/badge.svg?branch=master)](https://coveralls.io/github/Emile-Filteau/lita-catme?branch=master)
|
4
5
|
|
5
6
|
Lita handler that provides several commands to fetch random cat images from the cat api.
|
6
7
|
|
data/lib/lita/handlers/cat.rb
CHANGED
data/lib/lita/handlers/catme.rb
CHANGED
@@ -6,7 +6,7 @@ module Lita
|
|
6
6
|
route(/^cat( me)?$/i, :cat_me, command: true, help: { 'cat me' => t('help.cat_me') })
|
7
7
|
route(/^cat bomb( (\d+))?$/i, :cat_bomb, command: true, help: { 'cat bomb N' => t('help.cat_bomb') })
|
8
8
|
route(/^cat categories$/i, :cat_categories, command: true, help: { 'cat categories' => t('help.cat_categories') })
|
9
|
-
route(/^cat( me)? (with|in)( (\w+))?$/i, :cat_with_category, command: true, help: { 'cat (with|in) category' => t('help.
|
9
|
+
route(/^cat( me)? (with|in)( (\w+))?$/i, :cat_with_category, command: true, help: { 'cat (with|in) category' => t('help.cat_with_category') })
|
10
10
|
|
11
11
|
def cat_me(response)
|
12
12
|
response.reply(Cat.fetch.first.url)
|
data/lita-catme.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-catme"
|
3
|
-
spec.version = "0.
|
3
|
+
spec.version = "0.2.0"
|
4
4
|
spec.authors = ["Emile Filteau"]
|
5
5
|
spec.email = ["emile.filteau@gmail.com"]
|
6
6
|
spec.description = %q(A lita handler that fetch random cat images)
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
|
17
17
|
spec.add_runtime_dependency "lita", "~> 4.7"
|
18
|
-
spec.add_dependency "nokogiri", "~> 1.
|
18
|
+
spec.add_dependency "nokogiri", "~> 1.8.4"
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
21
|
spec.add_development_dependency "pry-byebug"
|
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rspec", ">= 3.0.0"
|
25
25
|
spec.add_development_dependency "vcr"
|
26
26
|
spec.add_development_dependency "webmock"
|
27
|
+
spec.add_development_dependency "coveralls"
|
27
28
|
end
|
@@ -1,54 +1,53 @@
|
|
1
|
-
---
|
2
1
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
|
5
|
-
|
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
|
-
|
2
|
+
- request:
|
3
|
+
method: get
|
4
|
+
uri: http://api.thecatapi.com/api/images/get?format=xml
|
5
|
+
body:
|
6
|
+
encoding: US-ASCII
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
Accept-Encoding:
|
10
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
User-Agent:
|
14
|
+
- Ruby
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Tue, 12 Apr 2016 16:01:53 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Powered-By:
|
25
|
+
- PHP/5.4.45
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- GET, POST
|
30
|
+
Access-Control-Allow-Headers:
|
31
|
+
- X-Requested-With
|
32
|
+
Transfer-Encoding:
|
33
|
+
- chunked
|
34
|
+
Content-Type:
|
35
|
+
- text/xml
|
36
|
+
body:
|
37
|
+
encoding: UTF-8
|
38
|
+
string: |
|
39
|
+
<?xml version="1.0"?>
|
40
|
+
<response>
|
41
|
+
<data>
|
42
|
+
<images>
|
43
|
+
<image>
|
44
|
+
<url>http://24.media.tumblr.com/tumblr_low6n5JHJF1qbhms5o1_500.jpg</url>
|
45
|
+
<id>6kf</id>
|
46
|
+
<source_url>http://thecatapi.com/?id=6kf</source_url>
|
47
|
+
</image>
|
48
|
+
</images>
|
49
|
+
</data>
|
50
|
+
</response>
|
51
|
+
? http_version
|
52
|
+
recorded_at: Tue, 12 Apr 2016 16:01:53 GMT
|
54
53
|
recorded_with: VCR 3.0.1
|
@@ -1,99 +1,98 @@
|
|
1
|
-
---
|
2
1
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
|
5
|
-
|
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
|
-
|
2
|
+
- request:
|
3
|
+
method: get
|
4
|
+
uri: http://api.thecatapi.com/api/images/get?format=xml&results_per_page=10
|
5
|
+
body:
|
6
|
+
encoding: US-ASCII
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
Accept-Encoding:
|
10
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
User-Agent:
|
14
|
+
- Ruby
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Tue, 12 Apr 2016 16:06:10 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Powered-By:
|
25
|
+
- PHP/5.4.45
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- GET, POST
|
30
|
+
Access-Control-Allow-Headers:
|
31
|
+
- X-Requested-With
|
32
|
+
Transfer-Encoding:
|
33
|
+
- chunked
|
34
|
+
Content-Type:
|
35
|
+
- text/xml
|
36
|
+
body:
|
37
|
+
encoding: UTF-8
|
38
|
+
string: |
|
39
|
+
<?xml version="1.0"?>
|
40
|
+
<response>
|
41
|
+
<data>
|
42
|
+
<images>
|
43
|
+
<image>
|
44
|
+
<url>http://25.media.tumblr.com/tumblr_lzv0qmw51M1qlyuwso1_1280.jpg</url>
|
45
|
+
<id>8ve</id>
|
46
|
+
<source_url>http://thecatapi.com/?id=8ve</source_url>
|
47
|
+
</image>
|
48
|
+
<image>
|
49
|
+
<url>http://25.media.tumblr.com/tumblr_mat8o75KS01rptlauo1_1280.jpg</url>
|
50
|
+
<id>MTY5Njc5Mg</id>
|
51
|
+
<source_url>http://thecatapi.com/?id=MTY5Njc5Mg</source_url>
|
52
|
+
</image>
|
53
|
+
<image>
|
54
|
+
<url>http://25.media.tumblr.com/tumblr_lmmuhbqBII1qd477zo1_1280.jpg</url>
|
55
|
+
<id>cn9</id>
|
56
|
+
<source_url>http://thecatapi.com/?id=cn9</source_url>
|
57
|
+
</image>
|
58
|
+
<image>
|
59
|
+
<url>http://24.media.tumblr.com/tumblr_lgqhdsGcgO1qfyzelo1_500.jpg</url>
|
60
|
+
<id>6s0</id>
|
61
|
+
<source_url>http://thecatapi.com/?id=6s0</source_url>
|
62
|
+
</image>
|
63
|
+
<image>
|
64
|
+
<url>http://25.media.tumblr.com/tumblr_m22h2qhwn61qcxyrro1_500.jpg</url>
|
65
|
+
<id>atp</id>
|
66
|
+
<source_url>http://thecatapi.com/?id=atp</source_url>
|
67
|
+
</image>
|
68
|
+
<image>
|
69
|
+
<url>http://24.media.tumblr.com/tumblr_lwidfjYoSI1qlyuwso1_1280.jpg</url>
|
70
|
+
<id>925</id>
|
71
|
+
<source_url>http://thecatapi.com/?id=925</source_url>
|
72
|
+
</image>
|
73
|
+
<image>
|
74
|
+
<url>http://25.media.tumblr.com/tumblr_luowluVKdx1qdth8zo1_1280.jpg</url>
|
75
|
+
<id>cev</id>
|
76
|
+
<source_url>http://thecatapi.com/?id=cev</source_url>
|
77
|
+
</image>
|
78
|
+
<image>
|
79
|
+
<url>http://24.media.tumblr.com/tumblr_m4pwtpa2Nw1r6jd7fo1_500.jpg</url>
|
80
|
+
<id>eb9</id>
|
81
|
+
<source_url>http://thecatapi.com/?id=eb9</source_url>
|
82
|
+
</image>
|
83
|
+
<image>
|
84
|
+
<url>http://24.media.tumblr.com/tumblr_lr8ng062t01qhwlspo1_500.jpg</url>
|
85
|
+
<id>53s</id>
|
86
|
+
<source_url>http://thecatapi.com/?id=53s</source_url>
|
87
|
+
</image>
|
88
|
+
<image>
|
89
|
+
<url>http://25.media.tumblr.com/tumblr_m33ib9ERyW1qflacro1_1280.jpg</url>
|
90
|
+
<id>9me</id>
|
91
|
+
<source_url>http://thecatapi.com/?id=9me</source_url>
|
92
|
+
</image>
|
93
|
+
</images>
|
94
|
+
</data>
|
95
|
+
</response>
|
96
|
+
? http_version
|
97
|
+
recorded_at: Tue, 12 Apr 2016 16:06:10 GMT
|
99
98
|
recorded_with: VCR 3.0.1
|
@@ -1,54 +1,53 @@
|
|
1
|
-
---
|
2
1
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
|
5
|
-
|
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
|
-
|
2
|
+
- request:
|
3
|
+
method: get
|
4
|
+
uri: http://api.thecatapi.com/api/images/get?category=boxes&format=xml
|
5
|
+
body:
|
6
|
+
encoding: US-ASCII
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
Accept-Encoding:
|
10
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
User-Agent:
|
14
|
+
- Ruby
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Tue, 12 Apr 2016 16:15:49 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Powered-By:
|
25
|
+
- PHP/5.4.45
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- GET, POST
|
30
|
+
Access-Control-Allow-Headers:
|
31
|
+
- X-Requested-With
|
32
|
+
Transfer-Encoding:
|
33
|
+
- chunked
|
34
|
+
Content-Type:
|
35
|
+
- text/xml
|
36
|
+
body:
|
37
|
+
encoding: UTF-8
|
38
|
+
string: |
|
39
|
+
<?xml version="1.0"?>
|
40
|
+
<response>
|
41
|
+
<data>
|
42
|
+
<images>
|
43
|
+
<image>
|
44
|
+
<url>http://25.media.tumblr.com/tumblr_lwwd01DBVo1r0mbi6o1_1280.jpg</url>
|
45
|
+
<id>f6</id>
|
46
|
+
<source_url>http://thecatapi.com/?id=f6</source_url>
|
47
|
+
</image>
|
48
|
+
</images>
|
49
|
+
</data>
|
50
|
+
</response>
|
51
|
+
? http_version
|
52
|
+
recorded_at: Tue, 12 Apr 2016 16:15:49 GMT
|
54
53
|
recorded_with: VCR 3.0.1
|
@@ -1,48 +1,47 @@
|
|
1
|
-
---
|
2
1
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
|
5
|
-
|
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
|
-
|
2
|
+
- request:
|
3
|
+
method: get
|
4
|
+
uri: http://api.thecatapi.com/api/images/get?category=foobar&format=xml
|
5
|
+
body:
|
6
|
+
encoding: US-ASCII
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
Accept-Encoding:
|
10
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
User-Agent:
|
14
|
+
- Ruby
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Tue, 12 Apr 2016 16:18:16 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Powered-By:
|
25
|
+
- PHP/5.4.45
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- GET, POST
|
30
|
+
Access-Control-Allow-Headers:
|
31
|
+
- X-Requested-With
|
32
|
+
Transfer-Encoding:
|
33
|
+
- chunked
|
34
|
+
Content-Type:
|
35
|
+
- text/xml
|
36
|
+
body:
|
37
|
+
encoding: UTF-8
|
38
|
+
string: |
|
39
|
+
<?xml version="1.0"?>
|
40
|
+
<response>
|
41
|
+
<data>
|
42
|
+
<images/>
|
43
|
+
</data>
|
44
|
+
</response>
|
45
|
+
? http_version
|
46
|
+
recorded_at: Tue, 12 Apr 2016 16:18:16 GMT
|
48
47
|
recorded_with: VCR 3.0.1
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-catme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emile Filteau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.8.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.8.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: coveralls
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: A lita handler that fetch random cat images
|
140
154
|
email:
|
141
155
|
- emile.filteau@gmail.com
|
@@ -183,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
197
|
version: '0'
|
184
198
|
requirements: []
|
185
199
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
200
|
+
rubygems_version: 2.7.6
|
187
201
|
signing_key:
|
188
202
|
specification_version: 4
|
189
203
|
summary: A lita handler that fetch random cat images
|