Class R10K::Util::Subprocess
In: lib/r10k/util/subprocess.rb
Parent: Object

The subprocess namespace implements an interface similar to childprocess. The interface has been simplified to make it easier to use and does not depend on native code.

@api private

Methods

execute   new   runner  

Included Modules

R10K::Logging

Classes and Modules

Module R10K::Util::Subprocess::Runner
Class R10K::Util::Subprocess::Result
Class R10K::Util::Subprocess::Runner
Class R10K::Util::Subprocess::SubprocessError

Attributes

argv  [R]  @!attribute [r] argv
  @return [Array<String>] The command to be executed
cwd  [RW]  @!attribute [rw] cwd
  @return [String] The directory to be used as the cwd when executing
    the command.
logger  [W]  @!attribute [w] logger
  Allow calling processes to take ownership of execution logs by passing
  their own logger to the command being executed.
raise_on_fail  [RW]  @!attribute [rw] raise_on_fail
  Determine whether #execute raises an error when the command exits
  with a non-zero exit status.
  @return [true, false]

Public Class methods

Prepare the subprocess invocation.

@param argv [Array<String>] The argument vector to execute

Public Instance methods

Execute the given command and return the result of evaluation.

@api public @raise [R10K::Util::Subprocess::SubprocessError] if raise_on_fail is

  true and the command exited with a non-zero status.

@return [R10K::Util::Subprocess::Result]

[Validate]