aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-16 16:53:13 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-16 18:14:48 +0900
commitc65bb5a0f8a083e9a3fd7cec542ef7e494edfc48 (patch)
treebf9a3310724b8256d12b9d703109c59a9d49f8cd /lib
parent7415901ac29279fe27bea73d1415a617b42b3a65 (diff)
downloadruby-c65bb5a0f8a083e9a3fd7cec542ef7e494edfc48.tar.gz
Warn bundled gems before Ruby 3.4.0
Diffstat (limited to 'lib')
-rw-r--r--lib/bundled_gems.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb
index ceb546f580..391cf3d3a0 100644
--- a/lib/bundled_gems.rb
+++ b/lib/bundled_gems.rb
@@ -74,10 +74,15 @@ module Gem::BUNDLED_GEMS
return if specs.to_a.map(&:name).include?(name.sub(LIBEXT, ""))
name = name.tr("/", "-")
_t, path = $:.resolve_feature_path(name)
- return unless gem = find_gem(path)
- caller = caller_locations(3, 3).find {|c| c&.absolute_path}
- return if find_gem(caller&.absolute_path)
- name = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
+ if gem = find_gem(path)
+ caller = caller_locations(3, 3).find {|c| c&.absolute_path}
+ return if find_gem(caller&.absolute_path)
+ name = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
+ elsif SINCE[name]
+ gem = true
+ else
+ return
+ end
return if WARNED[name]
WARNED[name] = true
if gem == true