module Patriot::Command::ExitCode

exit code of a command

Constants

FAILED

failed

SKIPPED

skip (e.g., updated elsewhere)

SUCCEEDED

successfully finished

Public Class Methods

name_of(exit_code) click to toggle source

@param exit_code [Patriot::Command::ExitCode] @return [String] string expression of the exit code

# File lib/patriot/command.rb, line 48
def name_of(exit_code)
  exit_code = exit_code.to_i
  return case exit_code
    when SUCCEEDED  then "SUCCEEDED"
    when FAILED     then "FAILED"
    else exit_code.to_s # not nil for backward compatibility
  end
end
value_of(code_name) click to toggle source

@param code_name [Patriot::Command::ExitCode] @return [Fixnum] exit code of the code name

# File lib/patriot/command.rb, line 60
def value_of(code_name)
  return code_name if code_name.is_a?(Fixnum)
  return case code_name
  when /SUCCEEDED/i then SUCCEEDED
  when /FAILED/i    then FAILED
  else raise "unknown exit code name: #{code_name}"
  end
end

Private Instance Methods

name_of(exit_code) click to toggle source

@param exit_code [Patriot::Command::ExitCode] @return [String] string expression of the exit code

# File lib/patriot/command.rb, line 48
def name_of(exit_code)
  exit_code = exit_code.to_i
  return case exit_code
    when SUCCEEDED  then "SUCCEEDED"
    when FAILED     then "FAILED"
    else exit_code.to_s # not nil for backward compatibility
  end
end
value_of(code_name) click to toggle source

@param code_name [Patriot::Command::ExitCode] @return [Fixnum] exit code of the code name

# File lib/patriot/command.rb, line 60
def value_of(code_name)
  return code_name if code_name.is_a?(Fixnum)
  return case code_name
  when /SUCCEEDED/i then SUCCEEDED
  when /FAILED/i    then FAILED
  else raise "unknown exit code name: #{code_name}"
  end
end