Actions
Bug #3126
closedirb/completionでTypeError
Description
=begin
irb/completion を読み込んでいると「a.」や「C::」などの後にタブキーを押すと
.../irb/completion.rb:137:in quote': can't convert NilClass to String (TypeError) や .../irb/completion.rb:87:in
quote': can't convert NilClass to String (TypeError)
で終了してしまいます。
以下の修正で直るようです。
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}
=end
Actions
Like0
Like0Like0Like0