Sha256: b1b638e8704568b9046f847d89ef01f110b85327ceb52ed3d13292c574955834

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

# Define an abstract interface for external command runners.
#
# @api private
class R10K::Util::Subprocess::Runner

  # @!attribute [rw] cwd
  #   @return [String] The directory to be used as the cwd when executing
  #     the command.
  attr_accessor :cwd

  attr_reader :io

  attr_reader :pid

  # @!attribute [r] status
  #   @return [Process::Status]
  attr_reader :status

  # @!attribute [r] result
  #   @return [R10K::Util::Subprocess::Result]
  attr_reader :result

  def initialize(argv)
    raise NotImplementedError
  end

  def run
    raise NotImplementedError
  end

  # Start the process asynchronously and return. Not all runners will implement this.
  def start
    raise NotImplementedError
  end

  # Wait for the process to exit. Not all runners will implement this.
  def wait
    raise NotImplementedError
  end

  # Did the given process exit with a non-zero exit code?
  def crashed?
    raise NotImplementedError
  end

  # @return [Integer] The exit status of the given process.
  def exit_code
    raise NotImplementedError
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
r10k-1.4.2 lib/r10k/util/subprocess/runner.rb
r10k-1.4.1 lib/r10k/util/subprocess/runner.rb
r10k-1.4.0 lib/r10k/util/subprocess/runner.rb
r10k-1.3.5 lib/r10k/util/subprocess/runner.rb
r10k-1.3.4 lib/r10k/util/subprocess/runner.rb
r10k-1.2.4 lib/r10k/util/subprocess/runner.rb
r10k-1.3.3 lib/r10k/util/subprocess/runner.rb
r10k-1.3.2 lib/r10k/util/subprocess/runner.rb
r10k-1.2.3 lib/r10k/util/subprocess/runner.rb
r10k-1.3.1 lib/r10k/util/subprocess/runner.rb
r10k-1.2.2 lib/r10k/util/subprocess/runner.rb
r10k-1.3.0 lib/r10k/util/subprocess/runner.rb
r10k-1.3.0rc1 lib/r10k/util/subprocess/runner.rb
r10k-1.2.1 lib/r10k/util/subprocess/runner.rb