1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
keiju 2012-12-25 13:34:34 +00:00
parent c2693f8bd6
commit 23c93b5007
2 changed files with 9 additions and 2 deletions

View file

@ -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.