Skip to content

Commit c65bb5a

Browse files
committed
Warn bundled gems before Ruby 3.4.0
1 parent 7415901 commit c65bb5a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/bundled_gems.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@ def self.warning?(name, specs: nil)
7474
return if specs.to_a.map(&:name).include?(name.sub(LIBEXT, ""))
7575
name = name.tr("/", "-")
7676
_t, path = $:.resolve_feature_path(name)
77-
return unless gem = find_gem(path)
78-
caller = caller_locations(3, 3).find {|c| c&.absolute_path}
79-
return if find_gem(caller&.absolute_path)
80-
name = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
77+
if gem = find_gem(path)
78+
caller = caller_locations(3, 3).find {|c| c&.absolute_path}
79+
return if find_gem(caller&.absolute_path)
80+
name = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
81+
elsif SINCE[name]
82+
gem = true
83+
else
84+
return
85+
end
8186
return if WARNED[name]
8287
WARNED[name] = true
8388
if gem == true

0 commit comments

Comments
 (0)