A simple wrapper to execute system commands, which provides stdout, stderr and exit code.
require 'syscmd' cmd = Syscmd.exec!('command') # => Syscmd::Command object cmd.stdout # => String cmd.stderr # => String cmd.exitcode # => Integer
Note that Syscmd.exec! immediately executes the given command. You will get the Syscmd::Command object executed and can examine it.
The Syscmd::popen code is mostly taken from the original Ruby 1.8 implementation of Open3::open3 (author: Yukihiro Matsumoto: documentation: Konrad Meyer).
Copyright © 2009 Till Salzer. See LICENSE for details.