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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 925d58d11636e9748a003fb35addee6fb982ece2
4
- data.tar.gz: 8b01a79bcd49e9d844897b9daf0bf8b0b62ab682
3
+ metadata.gz: 7876a4856b3c1e691a3c18c18a94d7ee4f19ab1d
4
+ data.tar.gz: fbc1f49b5ace7ab4ab712f15d55c21d4eb1b4108
5
5
  SHA512:
6
- metadata.gz: a06bd5edd895e9cef8cda36055adbc4ee371bc2342793d34eedbce441528da645c7ee16677092605dbe6e15c0ea8693178ff088f21f765a5fc520f414e711480
7
- data.tar.gz: a9df16b8a37b7ff64565ce6cc52eac3cf8819bb40423c3c64e0a62957517fe7904c34870d04c7da66220f92b7fff0ba58b02139376677a34e955df1a1e03afb4
6
+ metadata.gz: 4fa1e3ea940bd4c3aefaec242e2634113a694f75e3f050b7bf38dc3f5646847639c5ebf625676f03fd5340f92d412f09ba599eb5003c6a349793f1ab70598f13
7
+ data.tar.gz: 675d0448b28027d9113739faaa6ec2d1a671db32646ac86d41aea9e56bc91a482e5e20e672f10c27f4a21278807326e78c8ebc1e14f252760d24834efc97ea2d
data/CHANGELOG.txt ADDED
@@ -0,0 +1,10 @@
1
+ 0.1.1
2
+ =====
3
+
4
+ - Fix in the regex how we match someone saying Hi
5
+
6
+
7
+ 0.1.0
8
+ =====
9
+
10
+ - Initial Release
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-greet"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.1.1"
4
4
  spec.authors = ["epinault"]
5
5
  spec.email = ["emmanuel.pinault@zumobi.com"]
6
6
  spec.description = "Make your bot more welcoming and greeting"
@@ -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.0
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-07-02 00:00:00.000000000 Z
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