Module: LoggerPipe

Defined in:
lib/logger_pipe.rb,
lib/logger_pipe/runner.rb,
lib/logger_pipe/version.rb

Defined Under Namespace

Classes: Failure, Runner

Constant Summary collapse

SOURCES =
[:none, :stdout, :stderr, :both].freeze
VERSION =
"0.3.1"

Class Method Summary collapse

Class Method Details

.run(logger, cmd, options = {}) ⇒ Object

run

Parameters:

  • logger (Logger)
  • cmd (String)

    Command to run on shell

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :timeout (Integer)

    Seconds, default is nil.

  • :dry_run (true|false)

    If true given, command is not run actually

  • :returns (Symbol)

    Which output is used as return, one of :none, :stdout, :stderr, :both

  • :logging (Symbol)

    Which output is written to logger, one of :none, :stdout, :stderr, :both



17
18
19
# File 'lib/logger_pipe.rb', line 17

def run(logger, cmd, options = {})
  Runner.new(logger, cmd, options).execute
end