Skip to content

Commit

Permalink
Define absolute_path? by myself for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 7, 2021
1 parent c870b23 commit d9c0dc0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/irb/completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ def defined? do

BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("

def self.absolute_path?(p) # TODO Remove this method after 2.6 EOL.
if File.respond_to?(:absolute_path?)
File.absolute_path?(p)
else
if File.absolute_path(p) == p
true
else
false
end
end
end

def self.retrieve_gem_and_system_load_path
gem_paths = Gem::Specification.latest_specs(true).map { |s|
s.require_paths.map { |p|
if File.absolute_path?(p)
if absolute_path?(p)
p
else
File.join(s.full_gem_path, p)
Expand Down

0 comments on commit d9c0dc0

Please sign in to comment.