lita-hello 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 266e03a13bca688a7de6f8e9c43702048a80078a
4
- data.tar.gz: b5f10d04d61446cd15f44e05347ff8266afb0d16
3
+ metadata.gz: e77426c96aa629d0a52c5200b2e9e6250c255ad4
4
+ data.tar.gz: 66165b8e6b92d243952dde7f04955d45a814d8f6
5
5
  SHA512:
6
- metadata.gz: f61d719c7032162ac47024c66eace3223bd79779b6c122e8ea6f5bff7911700cfdb88136219267d8968d35a4d599723616d9089f823c2b8f465e7b9ec8810da4
7
- data.tar.gz: 1c3264067c5b130e3641e04ac24ae9691c2db2230c6fa5b1c9b83733af74bcb03b0ac339523c97c6eae5ec1c21e0ea3b7c0891c85606b3e5de612bcbe41f689c
6
+ metadata.gz: 6f9d3136679b83f37eb256ce32636331714aa67d1182c4792c56d38dcc5a27674d841875accd6c9bedf1cf7a76a216e90fe3b043a948679e1cf00253fb79274a
7
+ data.tar.gz: b7cb942a01a60032630f47b1eefc9538ac0f583ff7f8a4cea8c073c5fdfdc07c12503ff9c16baae8f473d6cc532f39477117b5369f327362131378266f50bd88
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # lita-hello
2
2
 
3
- TODO: Add a description of the plugin.
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
- TODO: Describe any configuration attributes the plugin exposes.
15
+ None.
16
16
 
17
17
  ## Usage
18
18
 
19
- TODO: Describe the plugin's features and how to use them.
19
+ Include this gem in your lita Gemfile.
20
20
 
21
21
  ## License
22
22
 
@@ -3,7 +3,8 @@ require "lita"
3
3
  module Lita
4
4
  module Handlers
5
5
  class Hello < Handler
6
- route(/(hello|hi|good morning|howdy|yo|hey)\sChangeBot/i, :say_hello)
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,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-hello"
3
- spec.version = "0.0.5"
3
+ spec.version = "0.0.7"
4
4
  spec.authors = ["Vinh Tran"]
5
5
  spec.email = ["vinh_tran@brown.edu"]
6
6
  spec.license = "MIT"
@@ -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.5
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-30 00:00:00.000000000 Z
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita