class Bundler::GemSource

def ==(other)

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

def build_gem_index(index)

def build_gem_index(index)
  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
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 = bundle.gem_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_main_specs

def fetch_main_specs
  Marshal.load(Gem::RemoteFetcher.fetcher.fetch_path("#{uri}/specs.4.8.gz"))
rescue Gem::RemoteFetcher::FetchError => e
  raise ArgumentError, "#{to_s} is not a valid source: #{e.message}"
end

def fetch_prerelease_specs

def fetch_prerelease_specs
  Marshal.load(Gem::RemoteFetcher.fetcher.fetch_path("#{uri}/prerelease_specs.4.8.gz"))
rescue Gem::RemoteFetcher::FetchError
  Bundler.logger.warn "Source '#{uri}' does not support prerelease gems"
  []
end

def fetch_specs

def fetch_specs
  Bundler.logger.info "Updating source: #{to_s}"
  build_gem_index(fetch_main_specs + fetch_prerelease_specs)
end

def gems

def gems
  @specs ||= fetch_specs
end

def initialize(bundle, options)

def initialize(bundle, options)
  super
  @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