class Bundler::Source::Rubygems

def cached_specs

def cached_specs
  @cached_specs ||= begin
    idx = installed_specs.dup
    path = Bundler.app_cache
    Dir["#{path}/*.gem"].each do |gemfile|
      next if gemfile =~ /bundler\-[\d\.]+?\.gem/
      begin
        s ||= Gem::Format.from_file_by_path(gemfile).spec
      rescue Gem::Package::FormatError
        raise GemspecError, "Could not read gem at #{gemfile}. It may be corrupted."
      end
      s.source = self
      idx << s
    end
  end
  idx
end