RSystem
RSystem simply executes a system() call but it also echoes the command that it is about to execute to stdout, and will raise an exception if the command does not return successfully.
Installation
Add this line to your application's Gemfile:
gem 'rsystem'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rsystem
Usage
Right now this gem just contains one statuc method.
RSystem::Runner:Run(<command>, [options={}])
Simply using RSystem::Runner:Run(<command>) will execute the command and echo it, returning the return code of the command that is ran or raising an exception if it did not return successfully.
Options
There are two options specific to the run method that you can use, with the defaults listed here:
optionsraise_on_error: true
The other options that you can pass are the same as the ones listed for the spawn method in Ruby's Kernel module.
Todo
- more tests
- output logging to a file
- stdout/stderr configuration
Contributing
- Fork it ( https://github.com/[my-github-username]/rsystem/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request