Class: Harbor::KamalAdapter::Result
- Inherits:
-
Object
- Object
- Harbor::KamalAdapter::Result
- Defined in:
- lib/harbor/kamal_adapter.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(stdout:, stderr:, success:, exit_code:, timed_out:) ⇒ Result
constructor
A new instance of Result.
- #output ⇒ Object
- #success? ⇒ Boolean
- #timed_out? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(stdout:, stderr:, success:, exit_code:, timed_out:) ⇒ Result
Returns a new instance of Result.
135 136 137 138 139 140 141 |
# File 'lib/harbor/kamal_adapter.rb', line 135 def initialize(stdout:, stderr:, success:, exit_code:, timed_out:) @stdout = stdout @stderr = stderr @success = success @exit_code = exit_code @timed_out = timed_out end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
133 134 135 |
# File 'lib/harbor/kamal_adapter.rb', line 133 def exit_code @exit_code end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
133 134 135 |
# File 'lib/harbor/kamal_adapter.rb', line 133 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
133 134 135 |
# File 'lib/harbor/kamal_adapter.rb', line 133 def stdout @stdout end |
Instance Method Details
#error_message ⇒ Object
155 156 157 |
# File 'lib/harbor/kamal_adapter.rb', line 155 def @stderr.strip.empty? ? @stdout.strip : @stderr.strip end |
#output ⇒ Object
151 152 153 |
# File 'lib/harbor/kamal_adapter.rb', line 151 def output @stdout.strip end |
#success? ⇒ Boolean
143 144 145 |
# File 'lib/harbor/kamal_adapter.rb', line 143 def success? @success end |
#timed_out? ⇒ Boolean
147 148 149 |
# File 'lib/harbor/kamal_adapter.rb', line 147 def timed_out? @timed_out end |
#to_h ⇒ Object
159 160 161 162 163 164 165 166 167 |
# File 'lib/harbor/kamal_adapter.rb', line 159 def to_h { success: @success, exit_code: @exit_code, output: output, error: @success ? nil : , timed_out: @timed_out } end |