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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83b5bd2229ec27a54548aacdd882293cebf68ae0
4
- data.tar.gz: 3773dcf606bfc1f06f8d69f986650c397e1b1288
3
+ metadata.gz: 7b32a08663e492bf16e24f68a2d636229d6c09b3
4
+ data.tar.gz: b4d2da9b9d08e2bedf6098f8fa0df2cec1e347ec
5
5
  SHA512:
6
- metadata.gz: baf99b1bef3db8182e5a195485fe31b12686f9ea71e0d5f084d178c20cac2508a082584d607599d806efde62ec0361aaa786462627f22286e8dd65f118455637
7
- data.tar.gz: 85fcb8ae2060bab1468a8c59ea1ad03a8aa21f79742b02904cd226485c514ea8ec801c7c6c46df19aea2f78010555ba77250c1f49aaef19f3a4a22a846cdfe4e
6
+ metadata.gz: 14be43df872b5a0f4c8e359f0b3b4a5f53a99fd488ef413b6285f81d096111dadc24574f4c298a78751e87029da4b187ff4de406f5b9798f46c3d45c859b159d
7
+ data.tar.gz: 045e62af02d6f9e0729bf530593f383a54472824e1a50c648ff93994fe8e4be1fb23d651258fda93b00512f36673f093c0572654d32d8e305e94e3401b8ac1a8
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
- # lita-nope-badger
1
+ # lita-claydavis
2
2
 
3
- [![Build Status](https://travis-ci.org/jjasghar/lita-nope-badger.png?branch=master)](https://travis-ci.org/jjasghar/lita-nope-badger)
4
- [![Coverage Status](https://coveralls.io/repos/jjasghar/lita-nope-badger/badge.png)](https://coveralls.io/r/jjasghar/lita-nope-badger)
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 [nope badger](http://www.reactiongifs.com/nope-badger/) and here's a quick way to get it linked.
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-nope-badger to your Lita instance's Gemfile:
10
+ Add lita-claydavis to your Lita instance's Gemfile:
11
11
 
12
12
  ``` ruby
13
- gem "lita-nope-badger"
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> nope badger
26
- bot> http://www.reactiongifs.com/r/oh-shi.gif
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 youtube/, :claydavis_youtube, command: false, help: { "claydavis youtube" => "Posts the Clay Davis youtube video."} )
6
- route(/^claydavis gif/, :claydavis_gif, command: false, help: { "claydavis gif" => "Posts the Clay Davis gif."} )
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")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-claydavis"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.2.0"
4
4
  spec.authors = ["JJ Asghar"]
5
5
  spec.email = ["jjasghar@gmail.com"]
6
6
  spec.description = "Everyone loves Clay Davis"
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-claydavis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JJ Asghar