mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
added find_command() to base_helpers to allow commands to look up a command by :listing name
This commit is contained in:
parent
6270b60e0c
commit
dd3aaf7132
1 changed files with 5 additions and 0 deletions
|
@ -18,7 +18,12 @@ class Pry
|
|||
text.split.drop(1).join(' ')
|
||||
end
|
||||
|
||||
def find_command(name)
|
||||
command_match = commands.find { |_, command| command.options[:listing] == name }
|
||||
|
||||
return command_match.last if command_match
|
||||
nil
|
||||
end
|
||||
|
||||
def gem_installed?(gem_name)
|
||||
require 'rubygems'
|
||||
|
|
Loading…
Reference in a new issue