Class: Hatchet::BashResult
- Inherits:
-
Object
- Object
- Hatchet::BashResult
- Defined in:
- lib/hatchet/heroku_run.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#include?(value) ⇒ Boolean
Testing helper methods.
-
#initialize(stdout:, stderr:, status:, set_global_status: false) ⇒ BashResult
constructor
A new instance of BashResult.
- #match(value) ⇒ Object
- #match?(value) ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(stdout:, stderr:, status:, set_global_status: false) ⇒ BashResult
Returns a new instance of BashResult.
7 8 9 10 11 12 |
# File 'lib/hatchet/heroku_run.rb', line 7 def initialize(stdout:, stderr:, status:, set_global_status: false) @stdout = stdout @stderr = stderr @status = status.respond_to?(:exitstatus) ? status.exitstatus : status.to_i `exit #{@status}` if set_global_status end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/hatchet/heroku_run.rb', line 5 def status @status end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/hatchet/heroku_run.rb', line 5 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
5 6 7 |
# File 'lib/hatchet/heroku_run.rb', line 5 def stdout @stdout end |
Instance Method Details
#failed? ⇒ Boolean
19 20 21 |
# File 'lib/hatchet/heroku_run.rb', line 19 def failed? !success? end |
#include?(value) ⇒ Boolean
Testing helper methods
24 25 26 |
# File 'lib/hatchet/heroku_run.rb', line 24 def include?(value) stdout.include?(value) end |
#match(value) ⇒ Object
32 33 34 |
# File 'lib/hatchet/heroku_run.rb', line 32 def match(value) stdout.match(value) end |
#match?(value) ⇒ Boolean
28 29 30 |
# File 'lib/hatchet/heroku_run.rb', line 28 def match?(value) stdout.match?(value) end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/hatchet/heroku_run.rb', line 15 def success? @status == 0 end |