diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 13:34:34 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 13:34:34 +0000 |
commit | 23c93b500743c784ae9f6b5d766afd1787e752a6 (patch) | |
tree | f141aa2a3a118484ba770640ca38143edf84c085 /lib/irb | |
parent | c2693f8bd61757e32d2f92010c041a79b21d074a (diff) | |
download | ruby-23c93b500743c784ae9f6b5d766afd1787e752a6.tar.gz |
* lib/irb/output-method.rb: raise right exception when
IRB::OutputMethod#print don't defined [Bug #6657].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb')
-rw-r--r-- | lib/irb/output-method.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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. |