Guest User

Untitled

a guest
Feb 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class Cmd
  2. attr_reader :output, :pid, :status
  3.  
  4. def initialize(cmd_line)
  5. IO.popen(cmd_line) do |f|
  6. @output = f.readlines
  7. @pid, @status = Process.wait2
  8. end
  9. end
  10.  
  11. def run?
  12. !!@status
  13. end
  14.  
  15. protected
  16.  
  17. def method_missing(sym, *args)
  18. @status.__send__(sym, *args)
  19. end
  20. end
Add Comment
Please, Sign In to add comment