Skip to content

Commit

Permalink
[rubygems/rubygems] Extract logic to a local variable for later reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed May 8, 2020
1 parent 6e80cab commit 8250000
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rubygems.rb
Expand Up @@ -1216,10 +1216,11 @@ class << self
#

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

Expand Down

0 comments on commit 8250000

Please sign in to comment.