summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-03-29 21:22:34 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit8250000187726b161e7491be6653dafeebad59b2 (patch)
tree2c1af9f9594df88afcb413b9bf038c57411e2d75 /lib/rubygems.rb
parent6e80cabb90cec19db24cf4e19fcd4e65cdf41e70 (diff)
[rubygems/rubygems] Extract logic to a local variable for later reuse
https://github.com/rubygems/rubygems/commit/dc715888d4
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index dc26ea8..2703525 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1216,10 +1216,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
#
def register_default_spec(spec)
+ extended_require_paths = spec.require_paths.map {|f| f + "/"}
new_format = spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
if new_format
- prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
+ prefix_group = extended_require_paths.join("|")
prefix_pattern = /^(#{prefix_group})/
end