ruby/lib/irb/lc/error.rb
tomoya ishida bda5b09937 [ruby/irb] Fix irb_history saved to current directory
(https://github.com/ruby/irb/pull/901)

* Always save irb_history in HOME or XDG_CONFIG_HOME

Also split irbrc search logic from irb_history search logic as a refactor

* Remove IRB.conf[:RC_NAME_GENERATOR] because it's not configurable

This conf is used to specify which irbrc to load. Need to configure before irbrc is loaded, so it's actually not configurable.
This conf is also used for history file search, but it is configurable by conf[:HISTORY_FILE].

* remove rc_file_test because it is tested with rc_files, remove useless test setup

* Make internal irbrc searching method private

11d03a6ff7
2024-03-16 15:20:03 +00:00

52 lines
1.1 KiB
Ruby

# frozen_string_literal: true
#
# irb/lc/error.rb -
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
module IRB
# :stopdoc:
class UnrecognizedSwitch < StandardError
def initialize(val)
super("Unrecognized switch: #{val}")
end
end
class CantReturnToNormalMode < StandardError
def initialize
super("Can't return to normal mode.")
end
end
class IllegalParameter < StandardError
def initialize(val)
super("Invalid parameter(#{val}).")
end
end
class IrbAlreadyDead < StandardError
def initialize
super("Irb is already dead.")
end
end
class IrbSwitchedToCurrentThread < StandardError
def initialize
super("Switched to current thread.")
end
end
class NoSuchJob < StandardError
def initialize(val)
super("No such job(#{val}).")
end
end
class CantChangeBinding < StandardError
def initialize(val)
super("Can't change binding to (#{val}).")
end
end
class UndefinedPromptMode < StandardError
def initialize(val)
super("Undefined prompt mode(#{val}).")
end
end
# :startdoc:
end