module EventMachine
Public Class Methods
popen3(cmd, handler=nil, *args) { |c| ... }
click to toggle source
@see eventmachine.rubyforge.org/EventMachine.html#M000491 @see gist.github.com/535644/4d5b645b96764e07ccb53539529bea9270741e1a
# File lib/pry-remote-em.rb, line 45 def self.popen3(cmd, handler=nil, *args) klass = klass_from_handler(Connection, handler, *args) w = Shellwords::shellwords(cmd) w.unshift(w.first) if w.first new_stderr = $stderr.dup rd, wr = IO::pipe $stderr.reopen wr s = invoke_popen(w) $stderr.reopen new_stderr klass.new(s, *args).tap do |c| EM.attach(rd, Popen3StderrHandler, c) @conns[s] = c yield(c) if block_given? end end