1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Extract logic to a local variable for later reuse

https://github.com/rubygems/rubygems/commit/dc715888d4
This commit is contained in:
David Rodríguez 2020-03-29 21:22:34 +02:00 committed by Hiroshi SHIBATA
parent 6e80cabb90
commit 8250000187
Notes: git 2020-05-08 14:14:15 +09:00

View file

@ -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