Bug #2018: [irb] BasicObject.new doesn't have an inspect
http://redmine.ruby-lang.org/issues/show/2018

Author: Daniel Bovensiepen
Status: Open, Priority: Low
Category: lib
ruby -v: ruby 1.9.2dev (2009-08-30 trunk 24718) [i386-darwin9.8.0]

Using BasicObject.new in irb:

   daniel@boviAir# ruby19 --version
   ruby 1.9.2dev (2009-08-30 trunk 24718) [i386-darwin9.8.0]
   daniel@boviAir# irb19 --version
   irb 0.9.6(09/06/30)
   daniel@boviAir# irb19
   irb(main):001:0> BasicObject.new

Produce an Exception due to the fact that inspect doesn't exist in the BasicObject:

NoMethodError: undefined method `inspect' for #<BasicObject:0x4b2738>
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:84:in `block in <module:IRB>'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:30:in `call'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:30:in `inspect_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/context.rb:259:in `inspect_last_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:309:in `output_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:158:in `block (2 levels) in eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:271:in `signal_status'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:154:in `block in eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:244:in `block (2 levels) in each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:230:in `loop'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:230:in `block in each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `catch'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:153:in `eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:70:in `block in start'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:69:in `catch'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:69:in `start'
        from /Users/danielbovensiepen/Programs/ruby19/bin/irb19:12:in `<main>'Maybe IRB bug!!

In the attachment is a patch for catching this exception.


----------------------------------------
http://redmine.ruby-lang.org