class Bundler::Definition

def index

def index
  @index ||= Index.build do |idx|
    dependency_names = @dependencies.map { |d| d.name }
    sources.all_sources.each do |source|
      source.dependency_names = dependency_names.dup
      idx.add_source source.specs
      dependency_names -= pinned_spec_names(source.specs)
      dependency_names.push(*source.unmet_deps).uniq!
    end
  end
end