class Bundler::Fetcher

def fetch_spec(spec)

fetch a gem specification
def fetch_spec(spec)
  spec -= [nil, "ruby", ""]
  spec_file_name = "#{spec.join "-"}.gemspec"
  uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
  if uri.scheme == "file"
    Bundler.load_marshal Gem.inflate(Gem.read_binary(uri.path))
  elsif cached_spec_path = gemspec_cached_path(spec_file_name)
    Bundler.load_gemspec(cached_spec_path)
  else
    Bundler.load_marshal Gem.inflate(downloader.fetch(uri).body)
  end
rescue MarshalError
  raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
    "Your network or your gem server is probably having issues right now."
end