[SVN] Proposed change to scriptmate.
Luke Daley
ld at ldaley.com
Sun May 18 01:55:36 UTC 2008
Take 2…
http://pastie.textmate.org/198959
Usage would become…
# Return the fds and pid, and echo any input to output
stdout, stderr, pid = TextMate::Process.async(cmd, :echo => true)
# Pass output to block, use TextMate::IO.sync = true, and don't echo
input to output
TextMate::Process.async(cmd, :sync = true) do |str, fd|
case fd
when :out
STDOUT << str
when :err
STDERR << str
end
end
#Same as above but don't differentiate output
TextMate::Process.async(cmd, :sync = true) do |str|
STDOUT << str
end
# Execute synchronously
out, err = TextMate::Process.sync(cmd, :echo = true)
STDOUT << outs
STDERR << err
Have to have a think about how to support returning stdout and stderr
combined for sync().
LD.
More information about the textmate-dev
mailing list