From: Yusuke Endoh Date: 2010-04-08T23:42:22+09:00 Subject: [ruby-core:29335] [Bug #2823] IRB Crashes When Completing Method Names of BasicObjects Issue #2823 has been updated by Yusuke Endoh. Assigned to set to Keiju Ishitsuka Hi, Keiju May I commit the following patch? diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 459f856..6ba168e 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -138,10 +138,7 @@ module IRB lv = eval("local_variables", bind).collect{|m| m.to_s} cv = eval("self.class.constants", bind).collect{|m| m.to_s} - if (gv | lv | cv).include?(receiver) - # foo.func and foo is local var. - candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s} - elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver + if (gv | lv | cv).include?(receiver) || /^[A-Z]/ =~ receiver and /\./ !~ receiver # Foo::Bar.func begin candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s} -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2823 ---------------------------------------- http://redmine.ruby-lang.org