Project

General

Profile

Bug #3126

irb/completionでTypeError

Added by znz (Kazuhiro NISHIYAMA) over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev (2010-04-10 trunk 27284) [x86_64-linux]
Backport:
[ruby-dev:40953]

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

Associated revisions

Revision 5ee43b0a
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

Revision 27327
Added by keiju (Keiju Ishitsuka) over 9 years ago

  • lib/irb/completion.rb (CompletionProc): fix [ruby-dev:40953] [Bug #3126]. Thanks Kazuhiro NISHIYAMA.

History

#1

Updated by keiju (Keiju Ishitsuka) over 9 years ago

=begin
けいじゅ@いしつかです.

In the message: "[Bug #3126] irb/completionでTypeError", on Apr/11 11:34(JST)
Kazuhiro NISHIYAMA writes:

Bug #3126: irb/completionでTypeError
http://redmine.ruby-lang.org/issues/show/3126

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)
で終了してしまいます。

申し訳ない. コミットしました.

__
---------------------------------------------------->> 石塚 圭樹 <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
=end

#2

Updated by keiju (Keiju Ishitsuka) over 9 years ago

=begin
けいじゅ@いしつかです.

In the message: "[Bug #3126] irb/completionでTypeError", on Apr/11 11:34(JST)
Kazuhiro NISHIYAMA writes:

Bug #3126: irb/completionでTypeError
http://redmine.ruby-lang.org/issues/show/3126

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)
で終了してしまいます。

申し訳ない. コミットしました.

__
---------------------------------------------------->> 石塚 圭樹 <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---

=end

#3

Updated by keiju (Keiju Ishitsuka) over 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
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.

=end

Also available in: Atom PDF