nmerouze (owner)

Revisions

gist: 7070 Download_button fork
public
Public Clone URL: git://gist.github.com/7070.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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