lita-claydavis 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -8
- data/lib/lita/handlers/claydavis.rb +10 -2
- data/lita-claydavis.gemspec +1 -1
- data/spec/lita/handlers/claydavis_spec.rb +26 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b32a08663e492bf16e24f68a2d636229d6c09b3
|
4
|
+
data.tar.gz: b4d2da9b9d08e2bedf6098f8fa0df2cec1e347ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14be43df872b5a0f4c8e359f0b3b4a5f53a99fd488ef413b6285f81d096111dadc24574f4c298a78751e87029da4b187ff4de406f5b9798f46c3d45c859b159d
|
7
|
+
data.tar.gz: 045e62af02d6f9e0729bf530593f383a54472824e1a50c648ff93994fe8e4be1fb23d651258fda93b00512f36673f093c0572654d32d8e305e94e3401b8ac1a8
|
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
# lita-
|
1
|
+
# lita-claydavis
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/jjasghar/lita-
|
4
|
-
[![Coverage Status](https://coveralls.io/repos/jjasghar/lita-
|
3
|
+
[![Build Status](https://travis-ci.org/jjasghar/lita-claydavis.png?branch=master)](https://travis-ci.org/jjasghar/lita-claydavis)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/jjasghar/lita-claydavis/badge.png)](https://coveralls.io/r/jjasghar/lita-claydavis)
|
5
5
|
|
6
|
-
Everyone loves the [
|
6
|
+
Everyone loves the [Clay Davis](https://www.youtube.com/watch?v=1-ykugiRKyM) and here's a quick way to get it linked.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
-
Add lita-
|
10
|
+
Add lita-claydavis to your Lita instance's Gemfile:
|
11
11
|
|
12
12
|
``` ruby
|
13
|
-
gem "lita-
|
13
|
+
gem "lita-claydavis"
|
14
14
|
```
|
15
15
|
|
16
16
|
## Configuration
|
@@ -22,6 +22,14 @@ None!
|
|
22
22
|
Nice and simple:
|
23
23
|
|
24
24
|
```
|
25
|
-
user1>
|
26
|
-
bot>
|
25
|
+
user1> claydavis youtube
|
26
|
+
bot> https://youtu.be/1-ykugiRKyM
|
27
|
+
user1> claydavis gif
|
28
|
+
bot> http://i.imgur.com/nv9hR03.gif
|
29
|
+
user1> claydavis
|
30
|
+
bot> http://www.animoller.com/old-blog/images/2010/09/sheeeet.gif
|
31
|
+
user1> (claydavis)
|
32
|
+
bot> http://www.animoller.com/old-blog/images/2010/09/sheeeet.gif
|
33
|
+
user1> sheeeeeeeeeit
|
34
|
+
bot> http://i.imgur.com/nv9hR03.gif
|
27
35
|
```
|
@@ -2,8 +2,16 @@ module Lita
|
|
2
2
|
module Handlers
|
3
3
|
class ClayDavis < Handler
|
4
4
|
|
5
|
-
route(/^claydavis
|
6
|
-
route(
|
5
|
+
route(/^claydavis$/, :claydavis, command: false, help: { "claydavis" => "Posts the Clay Davis gif."} )
|
6
|
+
route(/^\(claydavis\)$/, :claydavis, command: false, help: { "claydavis" => "Posts the Clay Davis gif."} )
|
7
|
+
route(/^claydavis\syoutube$/, :claydavis_youtube, command: false, help: { "claydavis youtube" => "Posts the Clay Davis youtube video."} )
|
8
|
+
route(/^claydavis\sgif$/, :claydavis_gif, command: false, help: { "claydavis gif" => "Posts the Clay Davis gif."} )
|
9
|
+
route(/sheee+it/, :claydavis_gif, command: false, help: { "sheee+it" => "Posts the Clay Davis gif."} )
|
10
|
+
|
11
|
+
|
12
|
+
def claydavis(request)
|
13
|
+
request.reply("http://www.animoller.com/old-blog/images/2010/09/sheeeet.gif")
|
14
|
+
end
|
7
15
|
|
8
16
|
def claydavis_youtube(request)
|
9
17
|
request.reply("https://youtu.be/1-ykugiRKyM")
|
data/lita-claydavis.gemspec
CHANGED
@@ -2,8 +2,14 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Lita::Handlers::ClayDavis, lita_handler: true do
|
4
4
|
|
5
|
+
it { is_expected.to route("claydavis") }
|
6
|
+
it { is_expected.to route("(claydavis)") }
|
5
7
|
it { is_expected.to route("claydavis gif") }
|
6
8
|
it { is_expected.to route("claydavis youtube") }
|
9
|
+
it { is_expected.not_to route("sheet") }
|
10
|
+
it { is_expected.not_to route("sheeit") }
|
11
|
+
it { is_expected.to route("sheeeit") }
|
12
|
+
it { is_expected.to route("sheeeeeeeeit") }
|
7
13
|
|
8
14
|
it "should respond with the correct gif url" do
|
9
15
|
send_message("claydavis gif")
|
@@ -15,4 +21,24 @@ describe Lita::Handlers::ClayDavis, lita_handler: true do
|
|
15
21
|
expect(replies.last).to eq("https://youtu.be/1-ykugiRKyM")
|
16
22
|
end
|
17
23
|
|
24
|
+
it "should respond with the correct gif url" do
|
25
|
+
send_message("claydavis")
|
26
|
+
expect(replies.last).to eq("http://www.animoller.com/old-blog/images/2010/09/sheeeet.gif")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should respond with the correct gif url" do
|
30
|
+
send_message("(claydavis)")
|
31
|
+
expect(replies.last).to eq("http://www.animoller.com/old-blog/images/2010/09/sheeeet.gif")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should respond with the correct gif url" do
|
35
|
+
send_message("sheeeeeit")
|
36
|
+
expect(replies.last).to eq("http://i.imgur.com/nv9hR03.gif")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should not respond with the gif url" do
|
40
|
+
send_message("sheeit")
|
41
|
+
expect(replies.last).not_to eq("http://i.imgur.com/nv9hR03.gif")
|
42
|
+
end
|
43
|
+
|
18
44
|
end
|