1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Deprecate Gem::RemoteFetcher#fetch_size

https://github.com/rubygems/rubygems/commit/c2049c3276
This commit is contained in:
bronzdoc 2019-07-16 18:39:40 -06:00 committed by Hiroshi SHIBATA
parent a34168f2ac
commit 41dd9f7e67
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -6,6 +6,7 @@ require 'rubygems/s3_uri_signer'
require 'rubygems/uri_formatter' require 'rubygems/uri_formatter'
require 'rubygems/user_interaction' require 'rubygems/user_interaction'
require 'resolv' require 'resolv'
require 'rubygems/deprecate'
## ##
# RemoteFetcher handles the details of fetching gems and gem information from # RemoteFetcher handles the details of fetching gems and gem information from
@ -14,6 +15,7 @@ require 'resolv'
class Gem::RemoteFetcher class Gem::RemoteFetcher
include Gem::UserInteraction include Gem::UserInteraction
extend Gem::Deprecate
## ##
# A FetchError exception wraps up the various possible IO and HTTP failures # A FetchError exception wraps up the various possible IO and HTTP failures
@ -321,12 +323,14 @@ class Gem::RemoteFetcher
## ##
# Returns the size of +uri+ in bytes. # Returns the size of +uri+ in bytes.
def fetch_size(uri) # TODO: phase this out def fetch_size(uri)
response = fetch_path(uri, nil, true) response = fetch_path(uri, nil, true)
response['content-length'].to_i response['content-length'].to_i
end end
deprecate :fetch_size, :none, 2019, 12
## ##
# Performs a Net::HTTP request of type +request_class+ on +uri+ returning # Performs a Net::HTTP request of type +request_class+ on +uri+ returning
# a Net::HTTP response object. request maintains a table of persistent # a Net::HTTP response object. request maintains a table of persistent