Class: AngryShell::Shell::ShellResult
- Inherits:
-
Struct
- Object
- Struct
- AngryShell::Shell::ShellResult
- Defined in:
- lib/angry_shell.rb
Overview
We encapsulate the shell’s result, including the Process::Status, stdout and stderr.
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#process_result ⇒ Object
Returns the value of attribute process_result.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
90 91 92 |
# File 'lib/angry_shell.rb', line 90 def @options end |
#process_result ⇒ Object
Returns the value of attribute process_result
90 91 92 |
# File 'lib/angry_shell.rb', line 90 def process_result @process_result end |
#stderr ⇒ Object
Returns the value of attribute stderr
90 91 92 |
# File 'lib/angry_shell.rb', line 90 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout
90 91 92 |
# File 'lib/angry_shell.rb', line 90 def stdout @stdout end |
Instance Method Details
#ensure_ok! ⇒ Object
95 96 97 98 99 |
# File 'lib/angry_shell.rb', line 95 def ensure_ok! unless ok? raise ShellError.new("unable to run command\ncommand=#{[:cmd]}\noptions=#{.pretty_inspect}\noutput=#{stdout}\nerror=#{stderr}",self) end end |
#ok? ⇒ Boolean
91 92 93 |
# File 'lib/angry_shell.rb', line 91 def ok? process_result.success? end |