class Bundler::GemSource

def ==(other)

def ==(other)
  uri == other.uri
end

def can_be_local?

def can_be_local?
  false
end

def download(spec)

def download(spec)
  Bundler.logger.info "Downloading #{spec.full_name}.gem"
  destination = repository.path
  unless destination.writable?
    raise RubygemsRetardation, "destination: #{destination} is not writable"
  end
  # Download the gem
  Gem::RemoteFetcher.fetcher.download(spec, uri, destination)
  # Re-read the gemspec from the downloaded gem to correct
  # any errors that were present in the Rubyforge specification.
  new_spec = Gem::Format.from_file_by_path(destination.join('cache', "#{spec.full_name}.gem")).spec
  spec.__swap__(new_spec)
end

def fetch_specs

def fetch_specs
  Bundler.logger.info "Updating source: #{to_s}"
  fetcher = Gem::RemoteFetcher.fetcher
  main_index = fetcher.fetch_path("#{uri}/specs.4.8.gz")
  begin
    prerelease_index = fetcher.fetch_path("#{uri}/prerelease_specs.4.8.gz")
    index = Marshal.load(main_index) + Marshal.load(prerelease_index)
  rescue Gem::RemoteFetcher::FetchError
    Bundler.logger.warn "Source '#{uri}' does not support prerelease gems"
    index = Marshal.load(main_index)
  end
  gems = Hash.new { |h,k| h[k] = [] }
  index.each do |name, version, platform|
    spec = RemoteSpecification.new(name, version, platform, @uri)
    spec.source = self
    gems[spec.name] << spec if Gem::Platform.match(spec.platform)
  end
  gems
rescue Gem::RemoteFetcher::FetchError => e
  raise ArgumentError, "#{to_s} is not a valid source: #{e.message}"
end

def gems

def gems
  @specs ||= fetch_specs
end

def initialize(options)

def initialize(options)
  @uri = options[:uri]
  @uri = URI.parse(@uri) unless @uri.is_a?(URI)
  raise ArgumentError, "The source must be an absolute URI" unless @uri.absolute?
end

def to_s

def to_s
  @uri.to_s
end