class Bundler::Fetcher::CompactIndex

def specs_for_names(gem_names)

def specs_for_names(gem_names)
  gem_info = []
  complete_gems = []
  remaining_gems = gem_names.dup
  until remaining_gems.empty?
    Bundler.ui.debug "Looking up gems #{remaining_gems.inspect}"
    deps = compact_index_client.dependencies(remaining_gems)
    next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq
    deps.each {|dep| gem_info << dep }
    complete_gems.push(*deps.map(&:first)).uniq!
    remaining_gems = next_gems - complete_gems
  end
  gem_info
end