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:
parent
a34168f2ac
commit
41dd9f7e67
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,7 @@ require 'rubygems/s3_uri_signer'
|
|||
require 'rubygems/uri_formatter'
|
||||
require 'rubygems/user_interaction'
|
||||
require 'resolv'
|
||||
require 'rubygems/deprecate'
|
||||
|
||||
##
|
||||
# RemoteFetcher handles the details of fetching gems and gem information from
|
||||
|
@ -14,6 +15,7 @@ require 'resolv'
|
|||
class Gem::RemoteFetcher
|
||||
|
||||
include Gem::UserInteraction
|
||||
extend Gem::Deprecate
|
||||
|
||||
##
|
||||
# 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.
|
||||
|
||||
def fetch_size(uri) # TODO: phase this out
|
||||
def fetch_size(uri)
|
||||
response = fetch_path(uri, nil, true)
|
||||
|
||||
response['content-length'].to_i
|
||||
end
|
||||
|
||||
deprecate :fetch_size, :none, 2019, 12
|
||||
|
||||
##
|
||||
# Performs a Net::HTTP request of type +request_class+ on +uri+ returning
|
||||
# a Net::HTTP response object. request maintains a table of persistent
|
||||
|
|
Loading…
Add table
Reference in a new issue