Class: Ruboty::Handlers::Evaluate

Inherits:
Base
  • Object
show all
Defined in:
lib/ruboty/handlers/evaluate.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(message) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/ruboty/handlers/evaluate.rb', line 6

def evaluate(message)
  thread = Thread.start do
    result = `#{message[:command]}`.chomp!
    message.reply(result)
  end
  Thread.start do
    sleep 10
    thread.kill
  end
end