Skip to content

Instantly share code, notes, and snippets.

@nmerouze
Created August 25, 2008 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmerouze/7070 to your computer and use it in GitHub Desktop.
Save nmerouze/7070 to your computer and use it in GitHub Desktop.
class Cmd
attr_reader :output, :pid, :status
def initialize(cmd_line)
IO.popen(cmd_line) do |f|
@output = f.readlines
@pid, @status = Process.wait2
end
end
def run?
!!@status
end
protected
def method_missing(sym, *args)
@status.__send__(sym, *args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment