lita-greet 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +10 -0
- data/lib/lita/handlers/greet.rb +3 -2
- data/lita-greet.gemspec +1 -1
- data/spec/lita/handlers/greet_spec.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7876a4856b3c1e691a3c18c18a94d7ee4f19ab1d
|
4
|
+
data.tar.gz: fbc1f49b5ace7ab4ab712f15d55c21d4eb1b4108
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa1e3ea940bd4c3aefaec242e2634113a694f75e3f050b7bf38dc3f5646847639c5ebf625676f03fd5340f92d412f09ba599eb5003c6a349793f1ab70598f13
|
7
|
+
data.tar.gz: 675d0448b28027d9113739faaa6ec2d1a671db32646ac86d41aea9e56bc91a482e5e20e672f10c27f4a21278807326e78c8ebc1e14f252760d24834efc97ea2d
|
data/CHANGELOG.txt
ADDED
data/lib/lita/handlers/greet.rb
CHANGED
@@ -2,10 +2,11 @@ module Lita
|
|
2
2
|
module Handlers
|
3
3
|
class Greet < Handler
|
4
4
|
|
5
|
-
route(/^(hello|hi|good morning|howdy|yo!?$|hey).*/i, :say_hello)
|
5
|
+
route(/^(hello|hi!?(| .*)$|good morning|howdy|yo!?$|hey).*/i, :say_hello)
|
6
6
|
route(/^welcome (.+)/i, :welcome)
|
7
|
-
|
7
|
+
|
8
8
|
def say_hello(response)
|
9
|
+
return if response.user.name.empty?
|
9
10
|
reply_to_name = response.user.metadata['mention_name'].nil? ?
|
10
11
|
"#{response.user.name}" :
|
11
12
|
"#{response.user.metadata['mention_name']}"
|
data/lita-greet.gemspec
CHANGED
@@ -13,4 +13,10 @@ describe Lita::Handlers::Greet, lita_handler: true do
|
|
13
13
|
send_message("Hi")
|
14
14
|
expect(replies.last).to match(/Hello/)
|
15
15
|
end
|
16
|
+
|
17
|
+
it "does not send a message when the user object is empty" do
|
18
|
+
user = Lita::User.create("1", name: "")
|
19
|
+
send_message("Hi", as: user)
|
20
|
+
expect(replies.last).not_to match(/Hello/)
|
21
|
+
end
|
16
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-greet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epinault
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -131,6 +131,7 @@ extra_rdoc_files: []
|
|
131
131
|
files:
|
132
132
|
- ".gitignore"
|
133
133
|
- ".travis.yml"
|
134
|
+
- CHANGELOG.txt
|
134
135
|
- Gemfile
|
135
136
|
- LICENSE
|
136
137
|
- README.md
|