class Mixlib::ShellOut::Helper::FakeShellOut
Attributes
Public Class Methods
Source
# File lib/mixlib/shellout/helper.rb, line 212 def initialize(args, options, result) @args = args @options = options @stdout = result.stdout @stderr = result.stderr @exitstatus = result.exit_status @valid_exit_codes = Array(options[:returns] || 0) @status = OpenStruct.new(success?: (@valid_exit_codes.include? exitstatus)) end
Public Instance Methods
Source
# File lib/mixlib/shellout/helper.rb, line 226 def error! raise Mixlib::ShellOut::ShellCommandFailed, "Unexpected exit status of #{exitstatus} running #{@args}: #{stderr}" if error? end
Source
# File lib/mixlib/shellout/helper.rb, line 222 def error? @valid_exit_codes.none?(exitstatus) end