mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
added not_a_real_file? helper to BaseHelpers
* Useful for 'whereami' command and other commands that need to check whether file name was actually "<main>" or "(eval)" and so on
This commit is contained in:
parent
e83241e41e
commit
f501090282
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,10 @@ class Pry
|
|||
Gem::Specification.respond_to?(:find_all_by_name) ? !Gem::Specification.find_all_by_name(gem_name).empty? : Gem.source_index.find_name(gem_name).first
|
||||
end
|
||||
|
||||
def not_a_real_file?(file)
|
||||
file =~ /(\(.*\))|<.*>/ || file =~ /__unknown__/ || file == "" || file == "-e"
|
||||
end
|
||||
|
||||
def command_dependencies_met?(options)
|
||||
return true if !options[:requires_gem]
|
||||
Array(options[:requires_gem]).all? do |g|
|
||||
|
|
Loading…
Reference in a new issue