Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Build and run system commands.

tag: v0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time


Wrapper to open4 for running system commands.


Add this line to your application's Gemfile:

gem 'scmd'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scmd


Create a command object:

cmd ="echo hi")

cmd.to_s    #=> "echo hi"
cmd.inspect #=> #<Scmd::Command:0x83220514 @cmd_str="echo hi" @exitcode=nil>      #=> nil
cmd.exitcode #=> nil
cmd.stdout   #=> ''
cmd.stderr   #=> ''

Run it:


# written to the cmd instance      #=> 12345
cmd.exitcode #=> 0
cmd.stdout   #=> 'hi'
cmd.stderr   #=> ''

# the cmd instance is returned by `run` for chaining as well #=> 'hi'

Some helpers:

puts cmd.stderr if !cmd.success?

Raise an exception if not successful with run!:"cd /path/that/does/not/exist").run! #=> Scmd::Command::Failure


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.