Class Gem::RemoteFetcher
In: lib/rubygems/remote_fetcher.rb
Parent: Object

RemoteFetcher handles the details of fetching gems and gem information from a remote source.

Methods

Included Modules

Gem::UserInteraction

Classes and Modules

Class Gem::RemoteFetcher::FetchError

Public Class methods

Cached RemoteFetcher instance.

Initialize a remote fetcher using the source URI and possible proxy information.

proxy

  • [String]: explicit specification of proxy; overrides any environment
              variable setting
    
  • nil: respect environment variables (HTTP_PROXY, HTTP_PROXY_USER,
         HTTP_PROXY_PASS)
    
  • :no_proxy: ignore environment variables and _don‘t_ use a proxy

Public Instance methods

Creates or an HTTP connection based on uri, or retrieves an existing connection, using a proxy if needed.

Moves the gem spec from source_uri to the cache dir unless it is already there. If the source_uri is local the gem cache dir copy is always replaced.

Downloads uri and returns it as a String.

Returns the size of uri in bytes.

Returns an HTTP proxy URI if one is set in the environment variables.

Normalize the URI by adding "http://" if it is missing.

Read the data from the (source based) URI, but if it is a file:// URI, read from the filesystem instead.

Performs a Net::HTTP request of type request_class on uri returning a Net::HTTP response object. request maintains a table of persistent connections to reduce connect overhead.

Resets HTTP connection connection.

[Validate]