Created
February 29, 2012 22:00
-
-
Save acook/1944782 to your computer and use it in GitHub Desktop.
Wrapper for external processes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run(*args) | |
output = Struct.new(:pid, :stdout, :stderr) | |
status = Open4.popen4(*args) do |pid, stdin, stdout, stderr| | |
output = output.new pid, stdout.read, stderr.read | |
end | |
[status, output] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment