teaminsight/addbuild — pull request #4 by kellyredding (2012-07-17 22:30:16+00:00)
Title: Action mixin, some basic command helpers

## Purpose

This implements the basic `Addbuild::Action` mixin for creating action objects. The mixin provides the basic api, some helpers for use in command methods, and some basic command methods.

### API

The action mixin provides the action API:

* `host`: a writer for defining a host for the action to run its commands against
* `run?`, `undo?`: determines if the respective call is needed, both are true by default
* `run`, `undo`: calls respective `!` commands if needed
* `run!`: the logic executed if a run is needed, raises `NotImplementedError` by default
* `undo!`: the logic executed if an undo is needed, nothing by default

### Helpers

* `cmd`: the basic command runner, ensures a host is available, honors a `:cmd_su` option for running commands as other users, and runs the given command on the host returning the result
* `test_cmd`: runs a test command with some given options, for example testing whether files exist on the host
* `file_exists?`
* `is_directory?`
* `dir_glob`
* `is_symlink`
* `readlink`
* `readfile`

### Basic commands

* `exec`: the most basic of all commands - runs the given command string on the host with any given options
*