A simple wrapper to execute system commands, which provides stdout, stderr and exit code.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
features
lib
spec
tasks
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION.yml
syscmd.gemspec

README.rdoc

syscmd

A simple wrapper to execute system commands, which provides stdout, stderr and exit code.

Usage

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.

Heritage/Acknoledgement

The Syscmd::popen code is mostly taken from the original Ruby 1.8 implementation of Open3::open3 (author: Yukihiro Matsumoto: documentation: Konrad Meyer).

Copyright

Copyright © 2009 Till Salzer. See LICENSE for details.