lita-manners 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/lib/lita/handlers/manners.rb +2 -2
- data/lita-manners.gemspec +1 -1
- data/spec/lita/handlers/manners_spec.rb +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bd9b2b524b45a76df57cb415bf3ee8ec26d2f95
|
4
|
+
data.tar.gz: 7f5a036679c270207ff524377ce3fc3e6fb6136a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef6b5afad1921bc80009ae52e2671f5953d6296219624f77b21e2e645e72118edf178130910b12ee2b4ee2ac724a6a3814dc6134cb21fccb4812ae3ac8362d7
|
7
|
+
data.tar.gz: 4f9cf11248a1d902b8714a4e8330696ae21c5b3640303be9fcc82729334f5fe444a2c09fd590df48973ebc808ca6b22e4cbb379b00812dda3eeef9dc86224f17
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Lita
|
2
2
|
module Handlers
|
3
3
|
class Manners < Handler
|
4
|
-
route(/^(hi|hello|hey|howdy|bye|goodbye)!*$/i, :echo_command, command: true)
|
5
|
-
route(/^(hi|hello|hey|howdy|bye|goodbye)\s+@?(.+)$/i, :echo_message, command: false)
|
4
|
+
route(/^(hi|hello|hey|howdy|bye|goodbye|morning|good morning|good afternoon|good evening|good night)!*$/i, :echo_command, command: true)
|
5
|
+
route(/^(hi|hello|hey|howdy|bye|goodbye|morning|good morning|good afternoon|good evening|good night)\s+@?(.+)$/i, :echo_message, command: false)
|
6
6
|
route(/^(thanks|thank\s?you|cheers)!*$/i, :thank_you_command, command: true)
|
7
7
|
route(/^(thanks|thank\s?you|cheers)\s+@?(.+)$/i, :thank_you_message, command: false)
|
8
8
|
route(/^(i'm |i am )?sorry!*$/i, :sorry_command, command: true)
|
data/lita-manners.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-manners"
|
3
|
-
spec.version = "0.1.
|
3
|
+
spec.version = "0.1.1"
|
4
4
|
spec.authors = ["neilang"]
|
5
5
|
spec.email = ["neilang@gmail.com"]
|
6
6
|
spec.description = "Makes Lita politely respond to simple hello/goodbye/thank you commands and mentions"
|
@@ -10,6 +10,12 @@ describe Lita::Handlers::Manners, lita_handler: true do
|
|
10
10
|
it { is_expected.to route_command('howdy').to(:echo_command) }
|
11
11
|
it { is_expected.to route_command('goodbye').to(:echo_command) }
|
12
12
|
it { is_expected.to route_command('bye').to(:echo_command) }
|
13
|
+
it { is_expected.to route_command('morning').to(:echo_command) }
|
14
|
+
it { is_expected.to route_command('good morning').to(:echo_command) }
|
15
|
+
it { is_expected.to route_command('good night').to(:echo_command) }
|
16
|
+
it { is_expected.to route_command('good afternoon').to(:echo_command) }
|
17
|
+
it { is_expected.to route_command('good evening').to(:echo_command) }
|
18
|
+
it { is_expected.to route_command('good night').to(:echo_command) }
|
13
19
|
|
14
20
|
it { is_expected.to route_command('hello!').to(:echo_command) }
|
15
21
|
it { is_expected.to route_command('hi!').to(:echo_command) }
|
@@ -17,6 +23,12 @@ describe Lita::Handlers::Manners, lita_handler: true do
|
|
17
23
|
it { is_expected.to route_command('howdy!').to(:echo_command) }
|
18
24
|
it { is_expected.to route_command('goodbye!').to(:echo_command) }
|
19
25
|
it { is_expected.to route_command('bye!').to(:echo_command) }
|
26
|
+
it { is_expected.to route_command('morning!').to(:echo_command) }
|
27
|
+
it { is_expected.to route_command('good morning!').to(:echo_command) }
|
28
|
+
it { is_expected.to route_command('good night!').to(:echo_command) }
|
29
|
+
it { is_expected.to route_command('good afternoon!').to(:echo_command) }
|
30
|
+
it { is_expected.to route_command('good evening!').to(:echo_command) }
|
31
|
+
it { is_expected.to route_command('good night!').to(:echo_command) }
|
20
32
|
|
21
33
|
it 'replies with the user name' do
|
22
34
|
send_command('Hello', as: user)
|
@@ -36,6 +48,12 @@ describe Lita::Handlers::Manners, lita_handler: true do
|
|
36
48
|
it { is_expected.to route('howdy lita').to(:echo_message) }
|
37
49
|
it { is_expected.to route('goodbye lita').to(:echo_message) }
|
38
50
|
it { is_expected.to route('bye lita').to(:echo_message) }
|
51
|
+
it { is_expected.to route('morning lita').to(:echo_message) }
|
52
|
+
it { is_expected.to route('good morning lita').to(:echo_message) }
|
53
|
+
it { is_expected.to route('good night lita').to(:echo_message) }
|
54
|
+
it { is_expected.to route('good afternoon lita').to(:echo_message) }
|
55
|
+
it { is_expected.to route('good evening lita').to(:echo_message) }
|
56
|
+
it { is_expected.to route('good night lita').to(:echo_message) }
|
39
57
|
|
40
58
|
it { is_expected.to route('hello @lita').to(:echo_message) }
|
41
59
|
it { is_expected.to route('hi @lita').to(:echo_message) }
|
@@ -43,6 +61,12 @@ describe Lita::Handlers::Manners, lita_handler: true do
|
|
43
61
|
it { is_expected.to route('howdy @lita').to(:echo_message) }
|
44
62
|
it { is_expected.to route('goodbye @lita').to(:echo_message) }
|
45
63
|
it { is_expected.to route('bye @lita').to(:echo_message) }
|
64
|
+
it { is_expected.to route('morning @lita').to(:echo_message) }
|
65
|
+
it { is_expected.to route('good morning @lita').to(:echo_message) }
|
66
|
+
it { is_expected.to route('good night @lita').to(:echo_message) }
|
67
|
+
it { is_expected.to route('good afternoon @lita').to(:echo_message) }
|
68
|
+
it { is_expected.to route('good evening @lita').to(:echo_message) }
|
69
|
+
it { is_expected.to route('good night @lita').to(:echo_message) }
|
46
70
|
|
47
71
|
it 'replies to Hello lita' do
|
48
72
|
send_message('Hello lita', as: user)
|