8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/cinch/plugins/deploy.rb', line 8
def listen(m)
return if @running
@running = true
config[:configurations].each do |config|
if config[:channels].include?(m.channel.to_s) and config[:users].include?(m.user.nick) and m.message =~ Regexp.new(config[:trigger])
IO.popen("#{config[:command]} 2>&1") do |handle|
while line = handle.gets
m.reply "#{m.user.nick}: #{config[:command]} > #{line}"
end
end
end
end
rescue Exception => e
m.reply "#{config[:command]} - exception: #{e.message}"
puts e.backtrace
ensure
@running = nil
end
|