Footprintless::CommandRunner

- NAME
- VERSION
- DESCRIPTION
- CONSTRUCTORS
  - new(@args)
- ATTRIBUTES
  - get_command()
  - get_exception()
  - get_exit_code()
  - get_stderr()
  - get_stdout()
- METHODS
  - run($command, %runner_options)
  - run_or_die($command, %runner_options)
- AUTHOR
- COPYRIGHT AND LICENSE
- SEE ALSO

# NAME

Footprintless::CommandRunner - A contract for an command runner

# VERSION

version 1.01

# DESCRIPTION

The abstract base class for all command runners. This class defines the contract that all command runners must adhere to. Implementation classes should implement `_run($command, %runner_options)`.

# CONSTRUCTORS

## new(@args)

See implementation classes.

# ATTRIBUTES

## get_command()

Returns the last command run by this command runner.

## get_exception()

Returns the message from `die`, if the command runner died unexpectedly.

## get_exit_code()

Returns the exit code from running the command.

## get_stderr()

Returns the text written to `STDERR`. This will only be available if the command was run without any `err_???` options. See run for more details.

## get_stdout()

Returns the text written to `STDOUT`. This will only be available if the command was run without any `out_???` options. See run for more details.

# METHODS

## run($command, %runner_options)

Runs `$command`. The supported runner options are:

err_callback

  A sub that will be called once for each line written to `STDERR`. The only argument to the sub will be `$line`.

err_handle

  A handle to use as `STDERR` for the command.

in_handle

  A handle to use as `STDIN` for the command.

out_callback

  A sub that will be called once for each line written to `STDOUT`. The only argument to the sub will be `$line`.

out_handle

  A handle to use as `STDOUT` for the command.

## run_or_die($command, %runner_options)

Calls run and will die with an Footprintless::CommandRunner::Exception if the exit code is non-zero.

# AUTHOR

Lucas Theisen <lucastheisen@pastdev.com>

# COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Lucas Theisen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

# SEE ALSO

Please see those modules/websites for more information related to this module.

- Footprintless
- Footprintless::Command
- Footprintless::CommandOptionsFactory
- Footprintless::CommandRunner::Exception
- Footprintless