lita-irkit 0.0.2 → 0.0.3
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/irkit.rb +6 -6
- data/lita-irkit.gemspec +1 -1
- 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: 3f221d9078fe102b8e77ebb58ca47ed42fb2aee9
|
4
|
+
data.tar.gz: 4d5923c767676e4736119861c8a3227f1069899a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee249aa826dacdaa9dc626278f682fd4f3fffcc3ee10ed23fe17db91e8bc1568febbb6fdc3b4e1a2ee5736994befe9cfb10caa97b4562dca0d4eb34ae20ecbb3
|
7
|
+
data.tar.gz: cd0d118f709621db1d31ec90143f81962d9b920999ff9da1e378d16f7617f9c50379efe56f37b0b615a1b15a73ba6d14db8cb89f15a6ff697000bf78f25d06b5
|
data/lib/lita/handlers/irkit.rb
CHANGED
@@ -9,16 +9,16 @@ module Lita
|
|
9
9
|
handler_config.clientkey = ENV['IRKIT_CLIENTKEY']
|
10
10
|
end
|
11
11
|
|
12
|
-
route /^ir list/,
|
13
|
-
route /^ir
|
14
|
-
route /^ir
|
15
|
-
route /^ir
|
12
|
+
route /^ir list/, :ir_list, command: false, help: { "ir list" => "list irkit command names" }
|
13
|
+
route /^ir send (.+)/, :ir_send, command: false, help: { "ir send [command_name]" => "send irkit command" }
|
14
|
+
route /^ir register (.+)/, :ir_register, command: true, help: { "ir register [command_name]" => "register irkit command" }
|
15
|
+
route /^ir unregister (.+)/, :ir_unregister, command: true, help: { "ir unregister [command_name]" => "unregister irkit command" }
|
16
16
|
|
17
17
|
def ir_list(response)
|
18
18
|
response.reply Lita.redis.keys('irkit:messages:*').map{|key| key.gsub(/^irkit:messages:/, '')}.join(', ')
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def ir_register(response)
|
22
22
|
cmd = response.matches[0][0]
|
23
23
|
ir_data = irkit_api.get('/1/messages', clientkey: config.clientkey).body
|
24
24
|
return response.reply "ir data not found" if ir_data.length == 0
|
@@ -36,7 +36,7 @@ module Lita
|
|
36
36
|
response.reply "ir data send: #{cmd}"
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def ir_unregister(response)
|
40
40
|
cmd = response.matches[0][0]
|
41
41
|
Lita.redis.del "irkit:messages:#{cmd}"
|
42
42
|
response.reply "ir data deleted: #{cmd}"
|
data/lita-irkit.gemspec
CHANGED