Class: CommonMob::Shell::ShellResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/common_mob/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



72
73
74
# File 'lib/common_mob/shell.rb', line 72

def options
  @options
end

#process_resultObject

Returns the value of attribute process_result

Returns:

  • (Object)

    the current value of process_result



72
73
74
# File 'lib/common_mob/shell.rb', line 72

def process_result
  @process_result
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



72
73
74
# File 'lib/common_mob/shell.rb', line 72

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



72
73
74
# File 'lib/common_mob/shell.rb', line 72

def stdout
  @stdout
end

Instance Method Details

#ensure_ok!Object



77
78
79
80
81
82
83
# File 'lib/common_mob/shell.rb', line 77

def ensure_ok!
  unless ok?
    ex = ShellError.new("unable to run options=#{options.inspect}\noutput=#{stdout}\nerror=#{stderr}")
    ex.result = self
    raise(ex)
  end
end

#ok?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/common_mob/shell.rb', line 73

def ok?
  process_result.success?
end