Sha256: 11e7246bdbec9717b7266f2c6e6f4d6563f869f17713b5715c46e81b2a99a4fb

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

__OVERVIEW__


| Project         | shell\_command 
|:----------------|:--------------------------------------------------
| Homepage        | https://github.com/robgleeson/shell_command
| Wiki            | https://github.com/robgleeson/shell_command/wiki
| Documentation   | http://rubydoc.info/gems/shell_command/frames 
| Author          | Rob Gleeson   

__DESCRIPTION__

A library for spawning shell commands in Ruby. The library can be useful when 
you'd like to run a command and find out if it was successful(e.g: exited with a 
status code of 0) or if you'd like to access the standard output and standard 
error streams for a given shell command.

__EXAMPLES__

The first example lets you handle a failure of a command yourself, but the second
example assumes you want a exception raised on failure(e.g: command exits with 
a non-0 status code).

__1.__

    ShellCommand.run "ls" do |command|
      if command.success?
        puts command.stdout
      else
        puts "Looks like `ls` had problems executing."
      end
    end

__2.__

    begin
      ShellCommand.run! "ls"
    rescue ShellCommand::Exception => e 
      p e.message
    end

__SUPPORTED PLATFORMS__

  - Rubinius (1.9 mode)
  - CRuby 1.9+

__LICENSE__

See LICENSE.txt

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shell_command-0.2.4 README.md