lita-hello 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/lita/handlers/hello.rb +2 -1
- data/lita-hello.gemspec +1 -1
- data/spec/lita/handlers/hello_spec.rb +34 -0
- 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: e77426c96aa629d0a52c5200b2e9e6250c255ad4
|
4
|
+
data.tar.gz: 66165b8e6b92d243952dde7f04955d45a814d8f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9d3136679b83f37eb256ce32636331714aa67d1182c4792c56d38dcc5a27674d841875accd6c9bedf1cf7a76a216e90fe3b043a948679e1cf00253fb79274a
|
7
|
+
data.tar.gz: b7cb942a01a60032630f47b1eefc9538ac0f583ff7f8a4cea8c073c5fdfdc07c12503ff9c16baae8f473d6cc532f39477117b5369f327362131378266f50bd88
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# lita-hello
|
2
2
|
|
3
|
-
|
3
|
+
A simple Lita Handler that just says Hello to anyone who says Hi, Hello, Good Morning, or Howdy to ChangeBot.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,11 +12,11 @@ gem "lita-hello"
|
|
12
12
|
|
13
13
|
## Configuration
|
14
14
|
|
15
|
-
|
15
|
+
None.
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
Include this gem in your lita Gemfile.
|
20
20
|
|
21
21
|
## License
|
22
22
|
|
data/lib/lita/handlers/hello.rb
CHANGED
@@ -3,7 +3,8 @@ require "lita"
|
|
3
3
|
module Lita
|
4
4
|
module Handlers
|
5
5
|
class Hello < Handler
|
6
|
-
|
6
|
+
|
7
|
+
route(/(hello|hi|good morning|howdy|yo|hey)\s#{robot.name}/i, :say_hello)
|
7
8
|
|
8
9
|
def say_hello(response)
|
9
10
|
reply_to_name = response.user.metadata['mention_name'].nil? ?
|
data/lita-hello.gemspec
CHANGED
@@ -1,4 +1,38 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita::Handlers::Hello, lita_handler: true do
|
4
|
+
|
5
|
+
describe "#Hello" do
|
6
|
+
it {doesnt_route("some message").to(:say_hello)}
|
7
|
+
it {routes("Hi #{robot.name}").to(:say_hello)}
|
8
|
+
it {routes("hello #{robot.name}").to(:say_hello)}
|
9
|
+
it {routes("HOWDY #{robot.name}").to(:say_hello)}
|
10
|
+
it {routes("good MORNING #{robot.name}").to(:say_hello)}
|
11
|
+
|
12
|
+
it "says hello to anyone who says Hello ChangeBot" do
|
13
|
+
send_message("Hello #{robot.name}")
|
14
|
+
expect(replies.last).to eq("Hello #{user.name}!")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "says hello to anyone who says Hi ChangeBot" do
|
18
|
+
send_message("Hi #{robot.name}")
|
19
|
+
expect(replies.last).to eq("Hello #{user.name}!")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "says hello to anyone who says Good Morning ChangeBot" do
|
23
|
+
send_message("Good Morning #{robot.name}")
|
24
|
+
expect(replies.last).to eq("Hello #{user.name}!")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "says hello to anyone who says Howdy ChangeBot" do
|
28
|
+
send_message("Howdy #{robot.name}")
|
29
|
+
expect(replies.last).to eq("Hello #{user.name}!")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "ignores case" do
|
33
|
+
send_message("gOoD MORNING #{robot.name}")
|
34
|
+
expect(replies.last).to eq("Hello #{user.name}!")
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
4
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-hello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinh Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|