lita-isolita 0.1.9 → 0.1.10

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: c2da74b5f3891ab0f493a57216ecbd443a3a7d66
4
- data.tar.gz: fa043f40d119f4879985dbfaffff69cc41f730e6
3
+ metadata.gz: f2eaa07e258f1b9081008278de82aabd44218ce4
4
+ data.tar.gz: 553ae82481aba26e1ed707b5ed5a1e869e218954
5
5
  SHA512:
6
- metadata.gz: 7b160916cae3beb893ab61d775f51fdfce2f3c9dc23e8d29ee76d2d2fbb740650a881ae465e29d46db59c78506ba7f42a23f73088ebcd260168d6b572c26b344
7
- data.tar.gz: 09a65ad5485faf68d48487b12bd0ed7da26044fbe51a9a0d7c0e1d3a6ee583d6eac3afb22f5f782d5f095c6317c4863c0f14896406a979e478a6f4e8692d6b60
6
+ metadata.gz: 9b30d18d0018d56cc6fb0593c49ebe0ba15a441a31800bb83dfeac18cbb8b752214252fe87131dfc8cf04bb498335a6908ed56ff09bf51214e01ddbc7b013c15
7
+ data.tar.gz: 88b1596de67c7f790476eef4bc18cbba4389fa3a2aec604ddf8a98e324c4637d2796c04433c464a01de2e63c2132dbbe4599c30518ecdc770d756e125ffd3849
data/README.md CHANGED
@@ -12,6 +12,10 @@ gem "lita-isolita"
12
12
 
13
13
  ## Usage
14
14
 
15
- # Mind Manners
16
- Chris: Lita, do some fucking work
17
- Lita: Mind your manners Chris..
15
+ *# Mind Manners*
16
+ Chris: Lita, do some fucking work
17
+ Lita: Mind your manners Chris..
18
+
19
+ *# Echo*
20
+ Chris: Lita echo Bacon ipsum dolor amet
21
+ Lita: Bacon ipsum dolor amet
@@ -2,14 +2,6 @@ module Lita
2
2
  module Handlers
3
3
  class Isolita < Handler
4
4
 
5
- ## Get the username for who's talking to Lita.
6
- def get_reply_to_name(response)
7
- reply_to_name = response.user.metadata['mention_name'].nil? ?
8
- "#{response.user.name}" :
9
- "#{response.user.metadata['mention_name']}"
10
- end
11
-
12
-
13
5
  ## Mind your manners will just focus on "Fuck"
14
6
  ## for now until others become a problem.
15
7
  route(/fuck/i, :mind_your_manners, help: {
@@ -17,16 +9,18 @@ module Lita
17
9
  })
18
10
 
19
11
  def mind_your_manners(response)
20
- get_reply_to_name(response)
12
+ username = response.user.metadata['name'].nil? ?
13
+ "#{response.user.name}" :
14
+ "#{response.user.metadata['name']}"
21
15
 
22
16
  mind_manners = [
23
- "Mind your manners #{reply_to_name}..",
24
- "You better wash out that dirty mouth #{reply_to_name}!",
25
- "That is just unprofessional, #{reply_to_name}.",
26
- "Your mother wouldn't like to hear you say that, #{reply_to_name}.",
27
- "Quite the potty mouth on you, #{reply_to_name}..",
28
- "Good manners are made up of petty sacrifices, #{reply_to_name}.",
29
- "Does saying that make you more mature, #{reply_to_name}?",
17
+ "Mind your manners #{username}..",
18
+ "You better wash out that dirty mouth #{username}!",
19
+ "That is just unprofessional, #{username}.",
20
+ "Your mother wouldn't like to hear you say that, #{username}.",
21
+ "Quite the potty mouth on you, #{username}..",
22
+ "Good manners are made up of petty sacrifices, #{username}.",
23
+ "Does saying that make you more mature, #{username}?",
30
24
  "Rude."
31
25
  ]
32
26
  response.reply mind_manners.sample
@@ -34,12 +28,12 @@ module Lita
34
28
 
35
29
 
36
30
 
37
- route(/^(show request).*/i, :print_response, help: {
38
- "lita: show request" => "Prints out user's request"
31
+ route(/^echo\s+(.+)/, :echo, command: true, help: {
32
+ "lita: echo TEXT" => "Echoes back TEXT"
39
33
  })
40
34
 
41
- def print_response(response)
42
- response.reply_privately "#{response.message.inspect}\n#{response.user.inspect}"
35
+ def echo(response)
36
+ response.reply "#{response.matches}"
43
37
  end
44
38
 
45
39
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-isolita"
3
- spec.version = "0.1.9"
3
+ spec.version = "0.1.10"
4
4
  spec.authors = ["Chris Mikelson"]
5
5
  spec.email = ["chrismikelson@gmail.com"]
6
6
  spec.description = "Make Lita do more work"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-isolita
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mikelson