class Chef::Mixin::ShellOut::FakeShellOut

Attributes

exitstatus[R]
status[R]
stderr[R]
stdout[R]

Public Class Methods

new(args, options, result) click to toggle source
# File lib/chef/mixin/shell_out.rb, line 194
def initialize(args, options, result)
  @args = args
  @options = options
  @stdout = result.stdout
  @stderr = result.stderr
  @exitstatus = result.exit_status
  @status = OpenStruct.new(success?: ( exitstatus == 0 ))
end

Public Instance Methods

error!() click to toggle source
# File lib/chef/mixin/shell_out.rb, line 207
def error!
  raise Mixlib::ShellOut::ShellCommandFailed, "Unexpected exit status of #{exitstatus} running #{@args}" if error?
end
error?() click to toggle source
# File lib/chef/mixin/shell_out.rb, line 203
def error?
  exitstatus != 0
end