Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenglund committed Feb 17, 2012
1 parent 27d8230 commit c505edf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.textile
@@ -1,15 +1,18 @@
h1. Dotanuki "!https://secure.travis-ci.org/pmenglund/dotanuki.png?branch=master!":http://travis-ci.org/pmenglund/dotanuki

Simple but effective executioner of commands, which will deal correctly with failed commands. There are two versions of the Dotanuki gem
"dotanuki":rubygems.org/gems/dotanuki which uses "posix-spawn":rubygems.org/gems/posix-spawn and a pure ruby version "dotanuki-ruby":rubygems.org/gems/dotanuki-ruby
Simple but effective executioner of commands, which will deal correctly with failed commands.

Note that if the pure ruby version can load "posix-spawn":rubygems.org/gems/posix-spawn it will use it.
There are two versions of the Dotanuki gem "dotanuki":http://rubygems.org/gems/dotanuki which uses "posix-spawn":http://rubygems.org/gems/posix-spawn and a pure ruby version "dotanuki-ruby":http://rubygems.org/gems/dotanuki-ruby which uses "open4":http://rubygems.org/gems/open4 instead.

Note that if the pure ruby version can load "posix-spawn":http://rubygems.org/gems/posix-spawn it will use it.

h1. Examples

In the following example, if the <code>mkdir</code> fails, none of the other commands will be executed.

<pre>
require "dotanuki"

class Example
include Dotanuki

Expand All @@ -31,6 +34,8 @@ In the following example, if the <code>mkdir</code> fails, none of the other com
It can also be used with a <code>guard</code> block, which will raise an <code>ExecError</code> if a command fails.

<pre>
require "dotanuki"

class Example
include Dotanuki

Expand All @@ -47,8 +52,9 @@ It can also be used with a <code>guard</code> block, which will raise an <code>E
If you want to use dotanuki in a class method, you have to use the module method

<pre>
class Example
require "dotanuki"

class Example
def self.test?
Dotanuki.execute("mkdir /tmp/foo").ok?
end
Expand Down

0 comments on commit c505edf

Please sign in to comment.