lib/rubygems/remote_fetcher.rb
##
# Downloads +uri+ and returns it as a String.
Downloads +uri+ and returns it as a String.
Downloads + uri + and returns it as a String .
def fetch_path(uri, mtime = nil, head = false)
    uri = Gem::Uri.new uri
    unless uri.scheme
      raise ArgumentError, "uri scheme is invalid: #{uri.scheme.inspect}"
    end
    data = send "fetch_#{uri.scheme}", uri, mtime, head
    if data and !head and uri.to_s.end_with?(".gz")
      begin
        data = Gem::Util.gunzip data
      rescue Zlib::GzipFile::Error
        raise FetchError.new("server did not return a valid file", uri)
      end
    end
    data
  rescue Timeout::Error, IOError, SocketError, SystemCallError,
         *(OpenSSL::SSL::SSLError if Gem::HAVE_OPENSSL) => e
    raise FetchError.new("#{e.class}: #{e}", uri)
  end
def fetch_path ( uri , mtime = nil , head = false ) uri = Gem :: Uri . new uri unless uri . scheme raise ArgumentError , "uri scheme is invalid: #{uri.scheme.inspect}" end data = send "fetch_#{uri.scheme}" , uri , mtime , head if data and ! head and uri . to_s . end_with? ( ".gz" ) begin data = Gem :: Util . gunzip data rescue Zlib :: GzipFile :: Error raise FetchError . new ( "server did not return a valid file" , uri ) end end data rescue Timeout :: Error , IOError , SocketError , SystemCallError , * ( OpenSSL :: SSL :: SSLError if Gem :: HAVE_OPENSSL ) => e raise FetchError . new ( "#{e.class}: #{e}" , uri ) end
Downloads +uri+ and returns it as a String.
Downloads + uri + and returns it as a String .
uri
<not_specific>
mtime
<not_specific>
head
<not_specific>