From d9c0dc043e0c3176cd90b919ed474622263f2d38 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 8 Sep 2021 04:51:09 +0900 Subject: [PATCH] Define absolute_path? by myself for backward compatibility --- lib/irb/completion.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 9a5d8580a..597dcdaa8 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -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)