Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment