Class: JetBlack::ExecutedCommand
- Inherits:
-
Object
- Object
- JetBlack::ExecutedCommand
- Defined in:
- lib/jet_black/executed_command.rb
Instance Attribute Summary collapse
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#raw_command ⇒ Object
readonly
Returns the value of attribute raw_command.
-
#raw_stderr ⇒ Object
readonly
Returns the value of attribute raw_stderr.
-
#raw_stdout ⇒ Object
readonly
Returns the value of attribute raw_stdout.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(raw_command:, stdout:, stderr:, exit_status:) ⇒ ExecutedCommand
constructor
A new instance of ExecutedCommand.
- #success? ⇒ Boolean
Constructor Details
#initialize(raw_command:, stdout:, stderr:, exit_status:) ⇒ ExecutedCommand
Returns a new instance of ExecutedCommand.
10 11 12 13 14 15 16 17 |
# File 'lib/jet_black/executed_command.rb', line 10 def initialize(raw_command:, stdout:, stderr:, exit_status:) @raw_command = raw_command @raw_stdout = stdout @raw_stderr = stderr @stdout = scrub(stdout) @stderr = scrub(stderr) @exit_status = exit_status.to_i end |
Instance Attribute Details
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def exit_status @exit_status end |
#raw_command ⇒ Object (readonly)
Returns the value of attribute raw_command.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def raw_command @raw_command end |
#raw_stderr ⇒ Object (readonly)
Returns the value of attribute raw_stderr.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def raw_stderr @raw_stderr end |
#raw_stdout ⇒ Object (readonly)
Returns the value of attribute raw_stdout.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def raw_stdout @raw_stdout end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
7 8 9 |
# File 'lib/jet_black/executed_command.rb', line 7 def stdout @stdout end |
Instance Method Details
#failure? ⇒ Boolean
23 24 25 |
# File 'lib/jet_black/executed_command.rb', line 23 def failure? !success? end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/jet_black/executed_command.rb', line 19 def success? exit_status.zero? end |