lib/shellshot.rb in shellshot-0.1.0 vs lib/shellshot.rb in shellshot-0.2.0
- old
+ new
@@ -1,14 +1,15 @@
-require 'english'
+require 'rubygems'
+require 'system_timer'
module Shellshot
class Command
alias_method :system_exec, :exec
- DEFAULT_TIMEOUT = 60 #minutes
+ DEFAULT_TIMEOUT = 60 * 60 # 1 hour
attr_accessor :pid, :status
def exec(command, options = {})
self.pid = fork do
@@ -25,12 +26,12 @@
end
private
def wait_for(seconds)
- Timeout.timeout(seconds) do
+ SystemTimer.timeout(seconds) do
Process.wait(pid)
- self.status = $CHILD_STATUS
+ self.status = $?
end
end
def terminate_child_process
if pid