class Bundler::Source::Git

def specs

def specs
  @specs ||= begin
    index = Index.new
    # Start by making sure the git cache is up to date
    cache
    # Find all gemspecs in the repo
    in_cache do
      out   = %x(git ls-tree -r #{revision}).strip
      lines = out.split("\n").select { |l| l =~ /\.gemspec$/ }
      # Loop over the lines and extract the relative path and the
      # git hash
      lines.each do |line|
        next unless line =~ %r{^(\d+) (blob|tree) ([a-zf0-9]+)\t(.*)$}
        hash, file = $3, $4
        # Read the gemspec
        if spec = eval(%x(git cat-file blob #{$3}))
          spec = Specification.from_gemspec(spec)
          spec.relative_loaded_from = file
          spec.source = self
          index << spec
        end
      end
    end
    index << default_spec if default_spec && index.empty?
    index.freeze
  end
end