Class: Dependabot::CommandHelpers::ProcessStatus
- Inherits:
-
Object
- Object
- Dependabot::CommandHelpers::ProcessStatus
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/command_helpers.rb
Instance Method Summary collapse
- #exitstatus ⇒ Object
-
#initialize(process_status, custom_exitstatus = nil) ⇒ ProcessStatus
constructor
A new instance of ProcessStatus.
- #pid ⇒ Object
- #success? ⇒ Boolean
- #termsig ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(process_status, custom_exitstatus = nil) ⇒ ProcessStatus
Returns a new instance of ProcessStatus.
30 31 32 33 |
# File 'lib/dependabot/command_helpers.rb', line 30 def initialize(process_status, custom_exitstatus = nil) @process_status = process_status @custom_exitstatus = custom_exitstatus end |
Instance Method Details
#exitstatus ⇒ Object
37 38 39 |
# File 'lib/dependabot/command_helpers.rb', line 37 def exitstatus @custom_exitstatus || @process_status.exitstatus || 0 end |
#pid ⇒ Object
49 50 51 |
# File 'lib/dependabot/command_helpers.rb', line 49 def pid @process_status.pid end |
#success? ⇒ Boolean
43 44 45 |
# File 'lib/dependabot/command_helpers.rb', line 43 def success? @custom_exitstatus.nil? ? @process_status.success? || false : @custom_exitstatus.zero? end |
#termsig ⇒ Object
54 55 56 |
# File 'lib/dependabot/command_helpers.rb', line 54 def termsig @process_status.termsig end |
#to_s ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/dependabot/command_helpers.rb', line 60 def to_s if @custom_exitstatus "pid #{pid || 'unknown'}: exit #{@custom_exitstatus} (custom status)" else @process_status.to_s end end |