summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-03-25 13:29:22 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-03-25 14:33:03 +0900
commit6b1691ebe8d8134c963f99b059beb449a8ec450b (patch)
treeea489d0341f4cd37bcc55e6983dc436192c1c1eb
parentd6e9367edb940ea26a51e56b2be1032a97eea4c2 (diff)
Remove rubylibdir from bootsnap
-rw-r--r--lib/bundled_gems.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb
index 1578b48040..e756af61ea 100644
--- a/lib/bundled_gems.rb
+++ b/lib/bundled_gems.rb
@@ -95,8 +95,10 @@ module Gem::BUNDLED_GEMS
end
def self.warning?(name, specs: nil)
- feature = File.path(name) # name can be a feature name or a file path with String or Pathname
- name = feature.tr("/", "-")
+ # name can be a feature name or a file path with String or Pathname
+ feature = File.path(name)
+ # bootsnap expand `require "csv"` to `require "#{LIBDIR}/csv.rb"`
+ name = feature.delete_prefix(LIBDIR).chomp(".rb").tr("/", "-")
name.sub!(LIBEXT, "")
return if specs.include?(name)
_t, path = $:.resolve_feature_path(feature)