def installed_specs
@installed_specs ||= begin
idx = Index.new
have_bundler = false
Bundler.rubygems.all_specs.reverse_each do |spec|
next if spec.name == "bundler" && spec.version.to_s != VERSION
have_bundler = true if spec.name == "bundler"
spec.source = self
idx << spec
end
unless have_bundler
bundler = Gem::Specification.new do |s|
s.name = "bundler"
s.version = VERSION
s.platform = Gem::Platform::RUBY
s.source = self
s.authors = ["bundler team"]
s.loaded_from = File.expand_path("..", __FILE__)
end
idx << bundler
end
idx
end
end