class Bundler::Source::Rubygems

def cached_specs

def cached_specs
  @cached_specs ||= begin
    idx = @allow_local ? installed_specs.dup : Index.new
    Dir["#{cache_path}/*.gem"].each do |gemfile|
      next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
      s ||= Bundler.rubygems.spec_from_gem(gemfile)
      s.source = self
      idx << s
    end
    idx
  end
end