lib/tty/exit.rb
# Exit this process with a given status code
#
# @param [String,Integer] name_or_code
#   The name for an exit code or code itself
# @param [String] message
#   The message to print to io stream
# @param [IO] io
#   The io to print message to
#
# @return [nil]
#
# @api public
Exit this process with a given status code
Exit this process with a given status code
def exit_with(name_or_code = :ok, message = nil, io: $stderr)
      if message == :default
        message = "ERROR(#{exit_code(name_or_code)}): #{exit_message(name_or_code)}"
      end
      io.print(message) if message
      ::Kernel.exit(exit_code(name_or_code))
    end
def exit_with ( name_or_code = :ok , message = nil , io : $stderr ) if message == :default message = "ERROR(#{exit_code(name_or_code)}): #{exit_message(name_or_code)}" end io . print ( message ) if message :: Kernel . exit ( exit_code ( name_or_code ) ) end
Exit this process with a given status code
Exit this process with a given status code
None
nil
name_or_code
<not_specific>
message
<not_specific>
io
<not_specific>
<not_specific>
io The io to print message to
io The io to print message to
api
None