[rubygems/rubygems] Update vendored uri to 1.0.3

https://github.com/rubygems/rubygems/commit/176dc7421c
This commit is contained in:
Hiroshi SHIBATA 2025-02-27 18:18:25 +09:00
parent f52a2e4b12
commit e4c5531b4c
Notes: git 2025-03-03 06:52:55 +00:00
10 changed files with 59 additions and 49 deletions

View File

@ -13,15 +13,19 @@ require_relative "rfc2396_parser"
require_relative "rfc3986_parser"
module Bundler::URI
# The default parser instance for RFC 2396.
RFC2396_PARSER = RFC2396_Parser.new
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
# The default parser instance for RFC 3986.
RFC3986_PARSER = RFC3986_Parser.new
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
# The default parser instance.
DEFAULT_PARSER = RFC3986_PARSER
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
# Set the default parser instance.
def self.parser=(parser = RFC3986_PARSER)
remove_const(:Parser) if defined?(::Bundler::URI::Parser)
const_set("Parser", parser.class)
@ -40,7 +44,7 @@ module Bundler::URI
end
self.parser = RFC3986_PARSER
def self.const_missing(const)
def self.const_missing(const) # :nodoc:
if const == :REGEXP
warn "Bundler::URI::REGEXP is obsolete. Use Bundler::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
Bundler::URI::RFC2396_REGEXP
@ -87,7 +91,7 @@ module Bundler::URI
module_function :make_components_hash
end
module Schemes
module Schemes # :nodoc:
end
private_constant :Schemes
@ -305,7 +309,7 @@ module Bundler::URI
256.times do |i|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
end
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
TBLDECWWWCOMP_ = {} # :nodoc:

View File

@ -737,12 +737,12 @@ module Bundler::URI
end
private :check_registry
def set_registry(v) #:nodoc:
def set_registry(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end
protected :set_registry
def registry=(v)
def registry=(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end
@ -1133,17 +1133,16 @@ module Bundler::URI
base.fragment=(nil)
# RFC2396, Section 5.2, 4)
if !authority
base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
else
# RFC2396, Section 5.2, 4)
base.set_path(rel.path) if rel.path
if authority
base.set_userinfo(rel.userinfo)
base.set_host(rel.host)
base.set_port(rel.port || base.default_port)
base.set_path(rel.path)
elsif base.path && rel.path
base.set_path(merge_path(base.path, rel.path))
end
# RFC2396, Section 5.2, 7)
base.set_userinfo(rel.userinfo) if rel.userinfo
base.set_host(rel.host) if rel.host
base.set_port(rel.port) if rel.port
base.query = rel.query if rel.query
base.fragment=(rel.fragment) if rel.fragment
@ -1392,10 +1391,12 @@ module Bundler::URI
end
end
# Returns the hash value.
def hash
self.component_ary.hash
end
# Compares with _oth_ for Hash.
def eql?(oth)
self.class == oth.class &&
parser == oth.parser &&
@ -1438,7 +1439,7 @@ module Bundler::URI
end
end
def inspect
def inspect # :nodoc:
"#<#{self.class} #{self}>"
end

View File

@ -321,14 +321,14 @@ module Bundler::URI
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
end
@@to_s = Kernel.instance_method(:to_s)
if @@to_s.respond_to?(:bind_call)
def inspect
@@to_s.bind_call(self)
TO_S = Kernel.instance_method(:to_s) # :nodoc:
if TO_S.respond_to?(:bind_call)
def inspect # :nodoc:
TO_S.bind_call(self)
end
else
def inspect
@@to_s.bind(self).call
def inspect # :nodoc:
TO_S.bind(self).call
end
end

View File

@ -1,6 +1,6 @@
module Bundler::URI
# :stopdoc:
VERSION_CODE = '010002'.freeze
VERSION_CODE = '010003'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
# :startdoc:
end

View File

@ -13,15 +13,19 @@ require_relative "rfc2396_parser"
require_relative "rfc3986_parser"
module Gem::URI
# The default parser instance for RFC 2396.
RFC2396_PARSER = RFC2396_Parser.new
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
# The default parser instance for RFC 3986.
RFC3986_PARSER = RFC3986_Parser.new
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
# The default parser instance.
DEFAULT_PARSER = RFC3986_PARSER
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
# Set the default parser instance.
def self.parser=(parser = RFC3986_PARSER)
remove_const(:Parser) if defined?(::Gem::URI::Parser)
const_set("Parser", parser.class)
@ -40,7 +44,7 @@ module Gem::URI
end
self.parser = RFC3986_PARSER
def self.const_missing(const)
def self.const_missing(const) # :nodoc:
if const == :REGEXP
warn "Gem::URI::REGEXP is obsolete. Use Gem::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
Gem::URI::RFC2396_REGEXP
@ -87,7 +91,7 @@ module Gem::URI
module_function :make_components_hash
end
module Schemes
module Schemes # :nodoc:
end
private_constant :Schemes
@ -305,7 +309,7 @@ module Gem::URI
256.times do |i|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
end
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
TBLDECWWWCOMP_ = {} # :nodoc:
@ -424,7 +428,7 @@ module Gem::URI
private_class_method :_decode_uri_component
# Returns a URL-encoded string derived from the given
# {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes]
# {Enumerable}[rdoc-ref:Enumerable@Enumerable+in+Ruby+Classes]
# +enum+.
#
# The result is suitable for use as form data
@ -493,7 +497,7 @@ module Gem::URI
# each +key+/+value+ pair is converted to one or more fields:
#
# - If +value+ is
# {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects],
# {Array-convertible}[rdoc-ref:implicit_conversion.rdoc@Array-Convertible+Objects],
# each element +ele+ in +value+ is paired with +key+ to form a field:
#
# name = Gem::URI.encode_www_form_component(key, enc)
@ -551,7 +555,7 @@ module Gem::URI
# each subarray is a name/value pair (both are strings).
# Each returned string has encoding +enc+,
# and has had invalid characters removed via
# {String#scrub}[https://docs.ruby-lang.org/en/master/String.html#method-i-scrub].
# {String#scrub}[rdoc-ref:String#scrub].
#
# A simple example:
#

View File

@ -737,12 +737,12 @@ module Gem::URI
end
private :check_registry
def set_registry(v) #:nodoc:
def set_registry(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end
protected :set_registry
def registry=(v)
def registry=(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end
@ -1133,17 +1133,16 @@ module Gem::URI
base.fragment=(nil)
# RFC2396, Section 5.2, 4)
if !authority
base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
else
# RFC2396, Section 5.2, 4)
base.set_path(rel.path) if rel.path
if authority
base.set_userinfo(rel.userinfo)
base.set_host(rel.host)
base.set_port(rel.port || base.default_port)
base.set_path(rel.path)
elsif base.path && rel.path
base.set_path(merge_path(base.path, rel.path))
end
# RFC2396, Section 5.2, 7)
base.set_userinfo(rel.userinfo) if rel.userinfo
base.set_host(rel.host) if rel.host
base.set_port(rel.port) if rel.port
base.query = rel.query if rel.query
base.fragment=(rel.fragment) if rel.fragment
@ -1392,10 +1391,12 @@ module Gem::URI
end
end
# Returns the hash value.
def hash
self.component_ary.hash
end
# Compares with _oth_ for Hash.
def eql?(oth)
self.class == oth.class &&
parser == oth.parser &&
@ -1438,7 +1439,7 @@ module Gem::URI
end
end
def inspect
def inspect # :nodoc:
"#<#{self.class} #{self}>"
end

View File

@ -321,14 +321,14 @@ module Gem::URI
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
end
@@to_s = Kernel.instance_method(:to_s)
if @@to_s.respond_to?(:bind_call)
def inspect
@@to_s.bind_call(self)
TO_S = Kernel.instance_method(:to_s) # :nodoc:
if TO_S.respond_to?(:bind_call)
def inspect # :nodoc:
TO_S.bind_call(self)
end
else
def inspect
@@to_s.bind(self).call
def inspect # :nodoc:
TO_S.bind(self).call
end
end

View File

@ -1,6 +1,6 @@
module Gem::URI
# :stopdoc:
VERSION_CODE = '010002'.freeze
VERSION_CODE = '010003'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
# :startdoc:
end

View File

@ -14,4 +14,4 @@ gem "securerandom", "0.4.1"
gem "timeout", "0.4.3"
gem "thor", "1.3.2"
gem "tsort", "0.2.0"
gem "uri", "1.0.2"
gem "uri", "1.0.3"

View File

@ -27,7 +27,7 @@ GEM
thor (1.3.2)
timeout (0.4.3)
tsort (0.2.0)
uri (1.0.2)
uri (1.0.3)
PLATFORMS
java
@ -50,7 +50,7 @@ DEPENDENCIES
thor (= 1.3.2)
timeout (= 0.4.3)
tsort (= 0.2.0)
uri (= 1.0.2)
uri (= 1.0.3)
CHECKSUMS
connection_pool (2.4.1) sha256=0f40cf997091f1f04ff66da67eabd61a9fe0d4928b9a3645228532512fab62f4
@ -66,7 +66,7 @@ CHECKSUMS
thor (1.3.2) sha256=eef0293b9e24158ccad7ab383ae83534b7ad4ed99c09f96f1a6b036550abbeda
timeout (0.4.3) sha256=9509f079b2b55fe4236d79633bd75e34c1c1e7e3fb4b56cb5fda61f80a0fe30e
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
uri (1.0.2) sha256=b303504ceb7e5905771fa7fa14b649652fa949df18b5880d69cfb12494791e27
uri (1.0.3) sha256=e9f2244608eea2f7bc357d954c65c910ce0399ca5e18a7a29207ac22d8767011
BUNDLED WITH
2.7.0.dev