Feature #4222: Irb tab completion support for the valid (but rare) obj::m=
ethod invocation syntax
http://redmine.ruby-lang.org/issues/show/4222

Author: Abinoam P. Marques Jr.
Status: Open, Priority: Low

class MyC
  def my_method
    true
  end
end

a =3D MyC.new

# This is a valid method invocation syntax (rare, but valid)
a::my_method # =3D> true

But when you type in irb

a::<press tab> =


No tab-completion from irb.

a.<press tab> is working well.

So, I think the small patch bellow could implement this feature.

Index: lib/irb/completion.rb
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lib/irb/completion.rb	(revis=C3=A3o 30417)
+++ lib/irb/completion.rb	(c=C3=B3pia de trabalho)
@@ -131,7 +131,8 @@
 =

 #      when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
 #      when /^((\.?[^.]+)+)\.([^.]*)$/
-      when /^([^."].*)\.([^.]*)$/
+#      when /^([^."].*)\.([^.]*)$/
+      when /^([^."].*)(?:\.|::)([^.]*)$/
 	# variable
 	receiver =3D $1
 	message =3D Regexp.quote($2)

I'm at =

ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
Ubuntu 10.04 amd64


----------------------------------------
http://redmine.ruby-lang.org
SW5kZXg6IGxpYi9pcmIvY29tcGxldGlvbi5yYgo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09Ci0tLSBsaWIvaXJiL2NvbXBsZXRpb24ucmIJKHJldmlzw6NvIDMw
NDE3KQorKysgbGliL2lyYi9jb21wbGV0aW9uLnJiCShjw7NwaWEgZGUgdHJh
YmFsaG8pCkBAIC0xMzEsNyArMTMxLDggQEAKIAogIyAgICAgIHdoZW4gL14o
XCQ/KFwuP1teLl0rKSspXC4oW14uXSopJC8KICMgICAgICB3aGVuIC9eKChc
Lj9bXi5dKykrKVwuKFteLl0qKSQvCi0gICAgICB3aGVuIC9eKFteLiJdLiop
XC4oW14uXSopJC8KKyMgICAgICB3aGVuIC9eKFteLiJdLiopXC4oW14uXSop
JC8KKyAgICAgIHdoZW4gL14oW14uIl0uKikoPzpcLnw6OikoW14uXSopJC8K
IAkjIHZhcmlhYmxlCiAJcmVjZWl2ZXIgPSAkMQogCW1lc3NhZ2UgPSBSZWdl
eHAucXVvdGUoJDIpCg==