From: Run Paint Run Run Date: 2010-02-28T08:54:49+09:00 Subject: [ruby-core:28368] [Bug #2824] Backtrace from Singleton Classes is Unclear Bug #2824: Backtrace from Singleton Classes is Unclear http://redmine.ruby-lang.org/issues/show/2824 Author: Run Paint Run Run Status: Open, Priority: Low Category: core ruby -v: ruby 1.9.2dev (2010-02-19 trunk 26715) [i686-linux] The backtrace from singleton classes needs a space between 'singleton' and 'class'. $ ruby -e 'class << self; x; end' -e:1:in `singletonclass': undefined local variable or method `x' for #> (NameError) from -e:1:in `
' However, more useful would be to indicate _which_ object's singleton class raised the exception. This is particularly relevant for exceptions whose messages do not include the caller's #inspect output. For example, compare: $ ruby -e 'class H; 1/0; end' -e:1:in `/': divided by 0 (ZeroDivisionError) from -e:1:in `' from -e:1:in `
' $ ruby -e 'class << "c"; 1/0; end' -e:1:in `/': divided by 0 (ZeroDivisionError) from -e:1:in `singletonclass' from -e:1:in `
' ---------------------------------------- http://redmine.ruby-lang.org