summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-08-05 12:07:26 +0900
committerNobuyoshi Nakada <[email protected]>2023-08-05 18:56:37 +0900
commit4e6861d3376eb7857d2b0a947c97b6fec8e5bf37 (patch)
tree1c4aa411e92caf2ea49ef77dd67835d5f617de05
parente176f84138ff4fc5f7442cc969a281aeb714e7bd (diff)
Fix `Gem::BUNDLED_GEMS.find_gem` return value
If the required name is different from the found gem name, return the gem name, instead of true that means the required name is an exact gem name.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8178
-rw-r--r--lib/bundled_gems.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb
index 2623e1e96f..7b8c907041 100644
--- a/lib/bundled_gems.rb
+++ b/lib/bundled_gems.rb
@@ -59,7 +59,7 @@ module Gem::BUNDLED_GEMS
else
return
end
- EXACT[n] or PREFIXED[n[%r[\A[^/]+(?=/)]]]
+ EXACT[n] or PREFIXED[n = n[%r[\A[^/]+(?=/)]]] && n
end
def self.warning?(name)