mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
fixed up code_object.rb to retrieve commands by listing name
This commit is contained in:
parent
405aacf76d
commit
e23ec5ed33
1 changed files with 4 additions and 2 deletions
|
@ -28,7 +28,9 @@ class Pry
|
||||||
end
|
end
|
||||||
|
|
||||||
def command_lookup
|
def command_lookup
|
||||||
pry.commands[str]
|
# TODO: just make it so find_command_by_match_or_listing doesn't
|
||||||
|
# raise?
|
||||||
|
pry.commands.find_command_by_match_or_listing(str) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# extract the object from the binding
|
# extract the object from the binding
|
||||||
|
@ -76,7 +78,7 @@ class Pry
|
||||||
|
|
||||||
sup = obj.super(super_level) if obj
|
sup = obj.super(super_level) if obj
|
||||||
if obj && !sup
|
if obj && !sup
|
||||||
raise ArgumentError, "No superclass found for #{obj.wrapped}"
|
raise Pry::CommandError, "No superclass found for #{obj.wrapped}"
|
||||||
else
|
else
|
||||||
sup
|
sup
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue