cinch-deploy 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cinch/plugins/deploy.rb +3 -7
- 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: 89e43b3e1b6af44ee759fb4f7a00d8acacfcc76e
|
4
|
+
data.tar.gz: fef8d6ad1c086299cce99912579aaa15e9b05925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0f54c9fc28c0dafc9ba2e98e0ee467ad78dc75f247a759ddb671db22ca3268db65f105c333c674f57f9167e2906ee0ed32ce476a8062d672217900762d74b5
|
7
|
+
data.tar.gz: 526f96fa1947cf765a0c39b186ba67b6601a02517ee1aaed1a9af853db0a2d61e55f6d7822626b3e13deb2b105087df76ae25d83f73d165dd3fba4de32856af1
|
data/lib/cinch/plugins/deploy.rb
CHANGED
@@ -12,7 +12,7 @@ module Cinch
|
|
12
12
|
|
13
13
|
def listen(m)
|
14
14
|
config[:configurations].each do |config|
|
15
|
-
deploy(m) if can_deploy?(m)
|
15
|
+
deploy(config[:command], m) if can_deploy?(config, m)
|
16
16
|
end
|
17
17
|
rescue StandardError => e
|
18
18
|
m.reply "exception - #{e.message}", true
|
@@ -21,13 +21,13 @@ module Cinch
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def can_deploy?(m)
|
24
|
+
def can_deploy?(config, m)
|
25
25
|
config[:channels].include?(m.channel.to_s) &&
|
26
26
|
config[:users].include?(m.user.nick) &&
|
27
27
|
m.message =~ Regexp.new(config[:trigger])
|
28
28
|
end
|
29
29
|
|
30
|
-
def deploy(m)
|
30
|
+
def deploy(command, m)
|
31
31
|
return if @running[command]
|
32
32
|
@running[command] = true
|
33
33
|
IO.popen("#{command} 2>&1") do |handle|
|
@@ -39,10 +39,6 @@ module Cinch
|
|
39
39
|
@running.delete(command)
|
40
40
|
end
|
41
41
|
|
42
|
-
def command
|
43
|
-
config[:command]
|
44
|
-
end
|
45
|
-
|
46
42
|
end
|
47
43
|
end
|
48
44
|
end
|