From c94718e39fdeca4ae2079b7be64e42023e846aa3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 17 Sep 2021 20:01:15 +0900 Subject: [PATCH] [ruby/irb] Check if Gem::Specification is defined https://github.com/ruby/irb/commit/005ade74dd --- lib/irb/completion.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index fe2962e780..57521025f0 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -59,8 +59,8 @@ module IRB File.join(s.full_gem_path, p) end } - }.flatten - (gem_paths + $LOAD_PATH).uniq.sort + }.flatten if defined?(Gem::Specification) + (gem_paths.to_a | $LOAD_PATH).sort end def self.retrieve_files_to_require_from_load_path