aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/lc
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-25 05:38:09 +0900
committeraycabta <aycabta@gmail.com>2019-11-25 05:38:09 +0900
commit51ea1abb5f2ed70387dda28a5d0d9ee817367d61 (patch)
treef7eb2f57a21436682212399ecc34dcacbb5b91c2 /lib/irb/lc
parentefbca15116d4aea1588c6ba4ef0eb72c3c55c1db (diff)
downloadruby-51ea1abb5f2ed70387dda28a5d0d9ee817367d61.tar.gz
Remove e2mmap dependency
Diffstat (limited to 'lib/irb/lc')
-rw-r--r--lib/irb/lc/error.rb71
-rw-r--r--lib/irb/lc/ja/error.rb69
2 files changed, 110 insertions, 30 deletions
diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb
index 6623f82d84..798994e92c 100644
--- a/lib/irb/lc/error.rb
+++ b/lib/irb/lc/error.rb
@@ -9,24 +9,63 @@
#
#
#
-require "e2mmap"
# :stopdoc:
module IRB
-
- # exceptions
- extend Exception2MessageMapper
- def_exception :UnrecognizedSwitch, "Unrecognized switch: %s"
- def_exception :NotImplementedError, "Need to define `%s'"
- def_exception :CantReturnToNormalMode, "Can't return to normal mode."
- def_exception :IllegalParameter, "Invalid parameter(%s)."
- def_exception :IrbAlreadyDead, "Irb is already dead."
- def_exception :IrbSwitchedToCurrentThread, "Switched to current thread."
- def_exception :NoSuchJob, "No such job(%s)."
- def_exception :CantShiftToMultiIrbMode, "Can't shift to multi irb mode."
- def_exception :CantChangeBinding, "Can't change binding to (%s)."
- def_exception :UndefinedPromptMode, "Undefined prompt mode(%s)."
- def_exception :IllegalRCGenerator, 'Define illegal RC_NAME_GENERATOR.'
-
+ class UnrecognizedSwitch < StandardError
+ def initialize(val)
+ super("Unrecognized switch: #{val}")
+ end
+ end
+ class NotImplementedError < StandardError
+ def initialize(val)
+ super("Need to define `#{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 CantShiftToMultiIrbMode < StandardError
+ def initialize
+ super("Can't shift to multi irb mode.")
+ 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
+ class IllegalRCGenerator < StandardError
+ def initialize
+ super("Define illegal RC_NAME_GENERATOR.")
+ end
+ end
end
# :startdoc:
diff --git a/lib/irb/lc/ja/error.rb b/lib/irb/lc/ja/error.rb
index 919363154c..31ebb3b5f0 100644
--- a/lib/irb/lc/ja/error.rb
+++ b/lib/irb/lc/ja/error.rb
@@ -9,23 +9,64 @@
#
#
#
-require "e2mmap"
# :stopdoc:
module IRB
- # exceptions
- extend Exception2MessageMapper
- def_exception :UnrecognizedSwitch, 'スイッチ(%s)が分りません'
- def_exception :NotImplementedError, '`%s\'の定義が必要です'
- def_exception :CantReturnToNormalMode, 'Normalモードに戻れません.'
- def_exception :IllegalParameter, 'パラメータ(%s)が間違っています.'
- def_exception :IrbAlreadyDead, 'Irbは既に死んでいます.'
- def_exception :IrbSwitchedToCurrentThread, 'カレントスレッドに切り替わりました.'
- def_exception :NoSuchJob, 'そのようなジョブ(%s)はありません.'
- def_exception :CantShiftToMultiIrbMode, 'multi-irb modeに移れません.'
- def_exception :CantChangeBinding, 'バインディング(%s)に変更できません.'
- def_exception :UndefinedPromptMode, 'プロンプトモード(%s)は定義されていません.'
- def_exception :IllegalRCNameGenerator, 'RC_NAME_GENERATORが正しく定義されていません.'
+ class UnrecognizedSwitch < StandardError
+ def initialize(val)
+ super("スイッチ(#{val})が分りません")
+ end
+ end
+ class NotImplementedError < StandardError
+ def initialize(val)
+ super("`#{val}'の定義が必要です")
+ end
+ end
+ class CantReturnToNormalMode < StandardError
+ def initialize
+ super("Normalモードに戻れません.")
+ end
+ end
+ class IllegalParameter < StandardError
+ def initialize(val)
+ super("パラメータ(#{val})が間違っています.")
+ end
+ end
+ class IrbAlreadyDead < StandardError
+ def initialize
+ super("Irbは既に死んでいます.")
+ end
+ end
+ class IrbSwitchedToCurrentThread < StandardError
+ def initialize
+ super("カレントスレッドに切り替わりました.")
+ end
+ end
+ class NoSuchJob < StandardError
+ def initialize(val)
+ super("そのようなジョブ(#{val})はありません.")
+ end
+ end
+ class CantShiftToMultiIrbMode < StandardError
+ def initialize
+ super("multi-irb modeに移れません.")
+ end
+ end
+ class CantChangeBinding < StandardError
+ def initialize(val)
+ super("バインディング(#{val})に変更できません.")
+ end
+ end
+ class UndefinedPromptMode < StandardError
+ def initialize(val)
+ super("プロンプトモード(#{val})は定義されていません.")
+ end
+ end
+ class IllegalRCGenerator < StandardError
+ def initialize
+ super("RC_NAME_GENERATORが正しく定義されていません.")
+ end
+ end
end
# :startdoc:
# vim:fileencoding=utf-8