diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 674d2b49f1..f9db920c32 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -44,7 +44,7 @@ module Bundler @bundle_worker = nil # reset it. Not sure if necessary serial_compact_index_client.dependencies(remaining_gems) end - next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq + next_gems = deps.flat_map {|d| d[3].flat_map(&:first) }.uniq deps.each {|dep| gem_info << dep } complete_gems.concat(deps.map(&:first)).uniq! remaining_gems = next_gems - complete_gems diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index d8b7886af7..1bcfdf56ff 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -91,9 +91,9 @@ module Bundler def spec_matches_for_glob(spec, glob) return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob) - spec.load_paths.map do |lp| + spec.load_paths.flat_map do |lp| Dir["#{lp}/#{glob}#{suffix_pattern}"] - end.flatten(1) + end end def stub_set_spec(stub, spec)