1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
By putting the check for [] first, we don't need to handle the
case where that's part of the method.
This commit is contained in:
Conrad Irwin 2013-12-11 08:44:22 -08:00
parent 5717ff487b
commit 4cf1d05034

View file

@ -47,17 +47,12 @@ class Pry
elsif name.to_s =~ /(.+)\#(\S+)\Z/
context, meth_name = $1, $2
from_module(target.eval(context), meth_name, target)
elsif name.to_s =~ /(.+)(\.|::)(\S+)\Z/
if($3 == "new[]")
name.to_s =~ /(.+)(\[\])\Z/
context, meth_name = $1, $2
else
context, meth_name = $1, $3
end
from_obj(target.eval(context), meth_name, target)
elsif name.to_s =~ /(.+)(\[\])\Z/
context, meth_name = $1, $2
from_obj(target.eval(context), meth_name, target)
elsif name.to_s =~ /(.+)(\.|::)(\S+)\Z/
context, meth_name = $1, $3
from_obj(target.eval(context), meth_name, target)
elsif options[:instance]
from_module(target.eval("self"), name, target)
elsif options[:methods]