autonomousfoundry/carpenter — Issue #7: Add "shell" helper for running commands
Author: abriening
Created: 2011-11-26 03:29:49+00:00
State: open

Add a helper method to Plan definitions for shelling out commands similar to backquote, Open3, IO pipes or Kernel.system.

A simple helper that returns stdout, stderr and exit code is difficult to achieve compatibility across multiple platforms and ruby versions.

I'm thinking an "easy" solution that may work with multiple ruby versions would be to shell out to bash then read out of some tmp logs:

```bash
bash /tmp/tmp_script > /tmp/stdout.log 2> /tmp/stderr.log
```

```ruby
stdout = File.read("/tmp/stdout.log")
stderr = File.read("/tmp/stderr.log")
```