diff --git a/ChangeLog b/ChangeLog index ae07f5b4fd..89a8200cf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 25 22:21:06 2012 Keiju Ishitsuka + + * lib/irb/output-method.rb: raise right exception when + IRB::OutputMethod#print don't defined [Bug #6657]. + Tue Dec 25 22:06:33 2012 Koichi Sasada * vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame): diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb index 541c83f24d..aae9e2294d 100644 --- a/lib/irb/output-method.rb +++ b/lib/irb/output-method.rb @@ -16,12 +16,14 @@ module IRB # IRB::Notifier. You can define your own output method to use with Irb.new, # or Context.new class OutputMethod - @RCS_ID='-$Id$-' + extend Exception2MessageMapper + def_exception :NotImplementedError, "Need to define `%s'" + # Open this method to implement your own output method, raises a # NotImplementedError if you don't define #print in your own class. def print(*opts) - IRB.fail NotImplementedError, "print" + OutputMethod.Raise NotImplementedError, "print" end # Prints the given +opts+, with a newline delimiter.