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.
8 9 10 11 12 13 14 15 |
# File 'lib/jet_black/executed_command.rb', line 8 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.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def exit_status @exit_status end |
#raw_command ⇒ Object (readonly)
Returns the value of attribute raw_command.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def raw_command @raw_command end |
#raw_stderr ⇒ Object (readonly)
Returns the value of attribute raw_stderr.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def raw_stderr @raw_stderr end |
#raw_stdout ⇒ Object (readonly)
Returns the value of attribute raw_stdout.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def raw_stdout @raw_stdout end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
5 6 7 |
# File 'lib/jet_black/executed_command.rb', line 5 def stdout @stdout end |
Instance Method Details
#failure? ⇒ Boolean
21 22 23 |
# File 'lib/jet_black/executed_command.rb', line 21 def failure? !success? end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/jet_black/executed_command.rb', line 17 def success? exit_status.zero? end |