diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/irb/init.rb | 7 | ||||
-rw-r--r-- | lib/irb/lc/error.rb | 1 | ||||
-rw-r--r-- | lib/irb/lc/ja/error.rb | 1 |
4 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Dec 25 21:08:53 2012 Keiju Ishitsuka <keiju@ishitsuka.com> + + * lib/irb/init.rb, lib/irb/lc/ja/error.rb, lib/irb/lc/error.rb: + raise exception when illegal RC_NAME_GENARATOR defined [Bug #6455]. + Tue Dec 25 19:22:17 2012 Keiju Ishitsuka <keiju@ishitsuka.com> * lib/irb/workspace.rb: define method to private on top-level irb diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 35fa752c2b..159066bbce 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -256,7 +256,12 @@ module IRB # :nodoc: end end end - @CONF[:RC_NAME_GENERATOR].call ext + case rc_file = @CONF[:RC_NAME_GENERATOR].call(ext) + when String + return rc_file + else + IRB.fail IllegalRCNameGenerator + end end # enumerate possible rc-file base name generators diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb index 57872ec65e..c0c6c30d79 100644 --- a/lib/irb/lc/error.rb +++ b/lib/irb/lc/error.rb @@ -25,6 +25,7 @@ module IRB 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.' end # :startdoc: diff --git a/lib/irb/lc/ja/error.rb b/lib/irb/lc/ja/error.rb index 16a9138938..4f09d781cb 100644 --- a/lib/irb/lc/ja/error.rb +++ b/lib/irb/lc/ja/error.rb @@ -24,6 +24,7 @@ module IRB def_exception :CantShiftToMultiIrbMode, 'multi-irb modeに移れません.' def_exception :CantChangeBinding, 'バインディング(%s)に変更できません.' def_exception :UndefinedPromptMode, 'プロンプトモード(%s)は定義されていません.' + def_exception :IllegalRCNameGenerator, 'RC_NAME_GENERATORが正しく定義されていません.' end # :startdoc: # vim:fileencoding=utf-8 |