Skip to content

Commit e4c5531

Browse files
committed
[rubygems/rubygems] Update vendored uri to 1.0.3
ruby/rubygems@176dc7421c
1 parent f52a2e4 commit e4c5531

File tree

10 files changed

+59
-49
lines changed

10 files changed

+59
-49
lines changed

lib/bundler/vendor/uri/lib/uri/common.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
require_relative "rfc3986_parser"
1414

1515
module Bundler::URI
16+
# The default parser instance for RFC 2396.
1617
RFC2396_PARSER = RFC2396_Parser.new
1718
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
1819

20+
# The default parser instance for RFC 3986.
1921
RFC3986_PARSER = RFC3986_Parser.new
2022
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
2123

24+
# The default parser instance.
2225
DEFAULT_PARSER = RFC3986_PARSER
2326
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
2427

28+
# Set the default parser instance.
2529
def self.parser=(parser = RFC3986_PARSER)
2630
remove_const(:Parser) if defined?(::Bundler::URI::Parser)
2731
const_set("Parser", parser.class)
@@ -40,7 +44,7 @@ def self.parser=(parser = RFC3986_PARSER)
4044
end
4145
self.parser = RFC3986_PARSER
4246

43-
def self.const_missing(const)
47+
def self.const_missing(const) # :nodoc:
4448
if const == :REGEXP
4549
warn "Bundler::URI::REGEXP is obsolete. Use Bundler::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
4650
Bundler::URI::RFC2396_REGEXP
@@ -87,7 +91,7 @@ def make_components_hash(klass, array_hash)
8791
module_function :make_components_hash
8892
end
8993

90-
module Schemes
94+
module Schemes # :nodoc:
9195
end
9296
private_constant :Schemes
9397

@@ -305,7 +309,7 @@ def self.regexp(schemes = nil)# :nodoc:
305309
256.times do |i|
306310
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
307311
end
308-
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
312+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
309313
TBLENCWWWCOMP_[' '] = '+'
310314
TBLENCWWWCOMP_.freeze
311315
TBLDECWWWCOMP_ = {} # :nodoc:

lib/bundler/vendor/uri/lib/uri/generic.rb

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,12 @@ def check_registry(v) # :nodoc:
737737
end
738738
private :check_registry
739739

740-
def set_registry(v) #:nodoc:
740+
def set_registry(v) # :nodoc:
741741
raise InvalidURIError, "cannot set registry"
742742
end
743743
protected :set_registry
744744

745-
def registry=(v)
745+
def registry=(v) # :nodoc:
746746
raise InvalidURIError, "cannot set registry"
747747
end
748748

@@ -1133,17 +1133,16 @@ def merge(oth)
11331133
base.fragment=(nil)
11341134

11351135
# RFC2396, Section 5.2, 4)
1136-
if !authority
1137-
base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
1138-
else
1139-
# RFC2396, Section 5.2, 4)
1140-
base.set_path(rel.path) if rel.path
1136+
if authority
1137+
base.set_userinfo(rel.userinfo)
1138+
base.set_host(rel.host)
1139+
base.set_port(rel.port || base.default_port)
1140+
base.set_path(rel.path)
1141+
elsif base.path && rel.path
1142+
base.set_path(merge_path(base.path, rel.path))
11411143
end
11421144

11431145
# RFC2396, Section 5.2, 7)
1144-
base.set_userinfo(rel.userinfo) if rel.userinfo
1145-
base.set_host(rel.host) if rel.host
1146-
base.set_port(rel.port) if rel.port
11471146
base.query = rel.query if rel.query
11481147
base.fragment=(rel.fragment) if rel.fragment
11491148

@@ -1392,10 +1391,12 @@ def ==(oth)
13921391
end
13931392
end
13941393

1394+
# Returns the hash value.
13951395
def hash
13961396
self.component_ary.hash
13971397
end
13981398

1399+
# Compares with _oth_ for Hash.
13991400
def eql?(oth)
14001401
self.class == oth.class &&
14011402
parser == oth.parser &&
@@ -1438,7 +1439,7 @@ def select(*components)
14381439
end
14391440
end
14401441

1441-
def inspect
1442+
def inspect # :nodoc:
14421443
"#<#{self.class} #{self}>"
14431444
end
14441445

lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ def unescape(str, escaped = @regexp[:ESCAPED])
321321
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
322322
end
323323

324-
@@to_s = Kernel.instance_method(:to_s)
325-
if @@to_s.respond_to?(:bind_call)
326-
def inspect
327-
@@to_s.bind_call(self)
324+
TO_S = Kernel.instance_method(:to_s) # :nodoc:
325+
if TO_S.respond_to?(:bind_call)
326+
def inspect # :nodoc:
327+
TO_S.bind_call(self)
328328
end
329329
else
330-
def inspect
331-
@@to_s.bind(self).call
330+
def inspect # :nodoc:
331+
TO_S.bind(self).call
332332
end
333333
end
334334

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Bundler::URI
22
# :stopdoc:
3-
VERSION_CODE = '010002'.freeze
3+
VERSION_CODE = '010003'.freeze
44
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
55
# :startdoc:
66
end

lib/rubygems/vendor/uri/lib/uri/common.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
require_relative "rfc3986_parser"
1414

1515
module Gem::URI
16+
# The default parser instance for RFC 2396.
1617
RFC2396_PARSER = RFC2396_Parser.new
1718
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
1819

20+
# The default parser instance for RFC 3986.
1921
RFC3986_PARSER = RFC3986_Parser.new
2022
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
2123

24+
# The default parser instance.
2225
DEFAULT_PARSER = RFC3986_PARSER
2326
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
2427

28+
# Set the default parser instance.
2529
def self.parser=(parser = RFC3986_PARSER)
2630
remove_const(:Parser) if defined?(::Gem::URI::Parser)
2731
const_set("Parser", parser.class)
@@ -40,7 +44,7 @@ def self.parser=(parser = RFC3986_PARSER)
4044
end
4145
self.parser = RFC3986_PARSER
4246

43-
def self.const_missing(const)
47+
def self.const_missing(const) # :nodoc:
4448
if const == :REGEXP
4549
warn "Gem::URI::REGEXP is obsolete. Use Gem::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
4650
Gem::URI::RFC2396_REGEXP
@@ -87,7 +91,7 @@ def make_components_hash(klass, array_hash)
8791
module_function :make_components_hash
8892
end
8993

90-
module Schemes
94+
module Schemes # :nodoc:
9195
end
9296
private_constant :Schemes
9397

@@ -305,7 +309,7 @@ def self.regexp(schemes = nil)# :nodoc:
305309
256.times do |i|
306310
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
307311
end
308-
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
312+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
309313
TBLENCWWWCOMP_[' '] = '+'
310314
TBLENCWWWCOMP_.freeze
311315
TBLDECWWWCOMP_ = {} # :nodoc:
@@ -424,7 +428,7 @@ def self._decode_uri_component(regexp, str, enc)
424428
private_class_method :_decode_uri_component
425429

426430
# Returns a URL-encoded string derived from the given
427-
# {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes]
431+
# {Enumerable}[rdoc-ref:Enumerable@Enumerable+in+Ruby+Classes]
428432
# +enum+.
429433
#
430434
# The result is suitable for use as form data
@@ -493,7 +497,7 @@ def self._decode_uri_component(regexp, str, enc)
493497
# each +key+/+value+ pair is converted to one or more fields:
494498
#
495499
# - If +value+ is
496-
# {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects],
500+
# {Array-convertible}[rdoc-ref:implicit_conversion.rdoc@Array-Convertible+Objects],
497501
# each element +ele+ in +value+ is paired with +key+ to form a field:
498502
#
499503
# name = Gem::URI.encode_www_form_component(key, enc)
@@ -551,7 +555,7 @@ def self.encode_www_form(enum, enc=nil)
551555
# each subarray is a name/value pair (both are strings).
552556
# Each returned string has encoding +enc+,
553557
# and has had invalid characters removed via
554-
# {String#scrub}[https://docs.ruby-lang.org/en/master/String.html#method-i-scrub].
558+
# {String#scrub}[rdoc-ref:String#scrub].
555559
#
556560
# A simple example:
557561
#

lib/rubygems/vendor/uri/lib/uri/generic.rb

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,12 @@ def check_registry(v) # :nodoc:
737737
end
738738
private :check_registry
739739

740-
def set_registry(v) #:nodoc:
740+
def set_registry(v) # :nodoc:
741741
raise InvalidURIError, "cannot set registry"
742742
end
743743
protected :set_registry
744744

745-
def registry=(v)
745+
def registry=(v) # :nodoc:
746746
raise InvalidURIError, "cannot set registry"
747747
end
748748

@@ -1133,17 +1133,16 @@ def merge(oth)
11331133
base.fragment=(nil)
11341134

11351135
# RFC2396, Section 5.2, 4)
1136-
if !authority
1137-
base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
1138-
else
1139-
# RFC2396, Section 5.2, 4)
1140-
base.set_path(rel.path) if rel.path
1136+
if authority
1137+
base.set_userinfo(rel.userinfo)
1138+
base.set_host(rel.host)
1139+
base.set_port(rel.port || base.default_port)
1140+
base.set_path(rel.path)
1141+
elsif base.path && rel.path
1142+
base.set_path(merge_path(base.path, rel.path))
11411143
end
11421144

11431145
# RFC2396, Section 5.2, 7)
1144-
base.set_userinfo(rel.userinfo) if rel.userinfo
1145-
base.set_host(rel.host) if rel.host
1146-
base.set_port(rel.port) if rel.port
11471146
base.query = rel.query if rel.query
11481147
base.fragment=(rel.fragment) if rel.fragment
11491148

@@ -1392,10 +1391,12 @@ def ==(oth)
13921391
end
13931392
end
13941393

1394+
# Returns the hash value.
13951395
def hash
13961396
self.component_ary.hash
13971397
end
13981398

1399+
# Compares with _oth_ for Hash.
13991400
def eql?(oth)
14001401
self.class == oth.class &&
14011402
parser == oth.parser &&
@@ -1438,7 +1439,7 @@ def select(*components)
14381439
end
14391440
end
14401441

1441-
def inspect
1442+
def inspect # :nodoc:
14421443
"#<#{self.class} #{self}>"
14431444
end
14441445

lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ def unescape(str, escaped = @regexp[:ESCAPED])
321321
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
322322
end
323323

324-
@@to_s = Kernel.instance_method(:to_s)
325-
if @@to_s.respond_to?(:bind_call)
326-
def inspect
327-
@@to_s.bind_call(self)
324+
TO_S = Kernel.instance_method(:to_s) # :nodoc:
325+
if TO_S.respond_to?(:bind_call)
326+
def inspect # :nodoc:
327+
TO_S.bind_call(self)
328328
end
329329
else
330-
def inspect
331-
@@to_s.bind(self).call
330+
def inspect # :nodoc:
331+
TO_S.bind(self).call
332332
end
333333
end
334334

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Gem::URI
22
# :stopdoc:
3-
VERSION_CODE = '010002'.freeze
3+
VERSION_CODE = '010003'.freeze
44
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
55
# :startdoc:
66
end

tool/bundler/vendor_gems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
gem "timeout", "0.4.3"
1515
gem "thor", "1.3.2"
1616
gem "tsort", "0.2.0"
17-
gem "uri", "1.0.2"
17+
gem "uri", "1.0.3"

tool/bundler/vendor_gems.rb.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ GEM
2727
thor (1.3.2)
2828
timeout (0.4.3)
2929
tsort (0.2.0)
30-
uri (1.0.2)
30+
uri (1.0.3)
3131

3232
PLATFORMS
3333
java
@@ -50,7 +50,7 @@ DEPENDENCIES
5050
thor (= 1.3.2)
5151
timeout (= 0.4.3)
5252
tsort (= 0.2.0)
53-
uri (= 1.0.2)
53+
uri (= 1.0.3)
5454

5555
CHECKSUMS
5656
connection_pool (2.4.1) sha256=0f40cf997091f1f04ff66da67eabd61a9fe0d4928b9a3645228532512fab62f4
@@ -66,7 +66,7 @@ CHECKSUMS
6666
thor (1.3.2) sha256=eef0293b9e24158ccad7ab383ae83534b7ad4ed99c09f96f1a6b036550abbeda
6767
timeout (0.4.3) sha256=9509f079b2b55fe4236d79633bd75e34c1c1e7e3fb4b56cb5fda61f80a0fe30e
6868
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
69-
uri (1.0.2) sha256=b303504ceb7e5905771fa7fa14b649652fa949df18b5880d69cfb12494791e27
69+
uri (1.0.3) sha256=e9f2244608eea2f7bc357d954c65c910ce0399ca5e18a7a29207ac22d8767011
7070

7171
BUNDLED WITH
7272
2.7.0.dev

0 commit comments

Comments
 (0)