[Bug #3126] irb/completion$B$G(BTypeError

Bug #3126: irb/completione$B$Ge(BTypeError
http://redmine.ruby-lang.org/issues/show/3126

e$B5/I<<Te(B: Kazuhiro NISHIYAMA
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Keiju Ishitsuka, e$B%+%F%4%je(B: lib, Target version:
1.9.2
ruby -v: ruby 1.9.2dev (2010-04-10 trunk 27284) [x86_64-linux]

irb/completion
e$B$rFI$_9~$s$G$$$k$H!Ve(Ba.e$B!W$d!Ve(BC::e$B!W$J$I$N8e$K%?%V%-!<$r2!$9$He(B
…/irb/completion.rb:137:in quote': can't convert NilClass to String (TypeError) e$B$de(B .../irb/completion.rb:87:in quote’: can’t convert NilClass to String
(TypeError)
e$B$G=*N;$7$F$7$^$$$^$9!#e(B

e$B0J2<$N=$@5$GD>$k$h$&$G$9!#e(B

diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index a345c23…e059bc4 100644
— a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -81,10 +81,10 @@ module IRB
candidates.grep(/^#{receiver}/).collect{|e| “::” + e}

when /^(((::)?[A-Z][^:.(])+)::?([^:.])$/

  •  when /^([A-Z].*)::([^:.]+)*$/
    
  •  when /^([A-Z].*)::([^:.]*)$/
    

    Constant or class methods

    receiver = $1
  • message = Regexp.quote($4)
  • message = Regexp.quote($2)
    begin
    candidates = eval(“#{receiver}.constants.collect{|m| m.to_s}”,
    bind)
    candidates |= eval(“#{receiver}.methods.collect{|m| m.to_s}”, bind)
    @@ -134,7 +134,7 @@ module IRB
    when /^([^."].).([^.])$/

    variable

    receiver = $1
  • message = Regexp.quote($3)
  • message = Regexp.quote($2)

    gv = eval(“global_variables”, bind).collect{|m| m.to_s}
    lv = eval(“local_variables”, bind).collect{|m| m.to_s}

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In the message: “[Bug #3126] irb/completione$B$Ge(BTypeError”, on Apr/11
11:34(JST)
Kazuhiro NISHIYAMA writes:

Bug #3126: irb/completione$B$Ge(BTypeError
http://redmine.ruby-lang.org/issues/show/3126

irb/completion e$B$rFI$_9~$s$G$$$k$H!Ve(Ba.e$B!W$d!Ve(BC::e$B!W$J$I$N8e$K%?%V%-!<$r2!$9$He(B
…/irb/completion.rb:137:in quote': can't convert NilClass to String (TypeError) e$B$de(B .../irb/completion.rb:87:in quote’: can’t convert NilClass to String (TypeError)
e$B$G=*N;$7$F$7$^$$$^$9!#e(B

e$B?=$7Lu$J$$e(B. e$B%3%_%C%H$7$^$7$?e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B%A%1%C%He(B #3126 e$B$,99?7$5$l$^$7$?!#e(B (by Keiju Ishitsuka)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r27327.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


http://redmine.ruby-lang.org/issues/show/3126