Skip to content

Commit

Permalink
Bump vendored uri to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed Dec 13, 2024
1 parent 57f222c commit 71bebcf
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 23 deletions.
7 changes: 1 addition & 6 deletions lib/bundler/vendor/uri/lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ def self.parser=(parser = RFC3986_PARSER)
if Parser == RFC2396_Parser
const_set("REGEXP", Bundler::URI::RFC2396_REGEXP)
const_set("PATTERN", Bundler::URI::RFC2396_REGEXP::PATTERN)
Parser.new.pattern.each_pair do |sym, str|
unless REGEXP::PATTERN.const_defined?(sym)
REGEXP::PATTERN.const_set(sym, str)
end
end
end

Parser.new.regexp.each_pair do |sym, str|
remove_const(sym) if const_defined?(sym)
remove_const(sym) if const_defined?(sym, false)
const_set(sym, str)
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,11 @@ def convert_to_uri(uri)
end

end # class Parser

# Backward compatibility for Bundler::URI::REGEXP::PATTERN::*
RFC2396_Parser.new.pattern.each_pair do |sym, str|
unless RFC2396_REGEXP::PATTERN.const_defined?(sym, false)
RFC2396_REGEXP::PATTERN.const_set(sym, str)
end
end
end # module Bundler::URI
8 changes: 4 additions & 4 deletions lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,25 @@ def join(*uris) # :nodoc:

# Compatibility for RFC2396 parser
def extract(str, schemes = nil, &block) # :nodoc:
warn "Bundler::URI::RFC3986_PARSER.extract is obsoleted. Use Bundler::URI::RFC2396_PARSER.extract explicitly.", uplevel: 1 if $VERBOSE
warn "Bundler::URI::RFC3986_PARSER.extract is obsolete. Use Bundler::URI::RFC2396_PARSER.extract explicitly.", uplevel: 1 if $VERBOSE
RFC2396_PARSER.extract(str, schemes, &block)
end

# Compatibility for RFC2396 parser
def make_regexp(schemes = nil) # :nodoc:
warn "Bundler::URI::RFC3986_PARSER.make_regexp is obsoleted. Use Bundler::URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
warn "Bundler::URI::RFC3986_PARSER.make_regexp is obsolete. Use Bundler::URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
RFC2396_PARSER.make_regexp(schemes)
end

# Compatibility for RFC2396 parser
def escape(str, unsafe = nil) # :nodoc:
warn "Bundler::URI::RFC3986_PARSER.escape is obsoleted. Use Bundler::URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
warn "Bundler::URI::RFC3986_PARSER.escape is obsolete. Use Bundler::URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
unsafe ? RFC2396_PARSER.escape(str, unsafe) : RFC2396_PARSER.escape(str)
end

# Compatibility for RFC2396 parser
def unescape(str, escaped = nil) # :nodoc:
warn "Bundler::URI::RFC3986_PARSER.unescape is obsoleted. Use Bundler::URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
warn "Bundler::URI::RFC3986_PARSER.unescape is obsolete. Use Bundler::URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
escaped ? RFC2396_PARSER.unescape(str, escaped) : RFC2396_PARSER.unescape(str)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/vendor/uri/lib/uri/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Bundler::URI
# :stopdoc:
VERSION_CODE = '010001'.freeze
VERSION_CODE = '010002'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
# :startdoc:
end
7 changes: 1 addition & 6 deletions lib/rubygems/vendor/uri/lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ def self.parser=(parser = RFC3986_PARSER)
if Parser == RFC2396_Parser
const_set("REGEXP", Gem::URI::RFC2396_REGEXP)
const_set("PATTERN", Gem::URI::RFC2396_REGEXP::PATTERN)
Parser.new.pattern.each_pair do |sym, str|
unless REGEXP::PATTERN.const_defined?(sym)
REGEXP::PATTERN.const_set(sym, str)
end
end
end

Parser.new.regexp.each_pair do |sym, str|
remove_const(sym) if const_defined?(sym)
remove_const(sym) if const_defined?(sym, false)
const_set(sym, str)
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,11 @@ def convert_to_uri(uri)
end

end # class Parser

# Backward compatibility for Gem::URI::REGEXP::PATTERN::*
RFC2396_Parser.new.pattern.each_pair do |sym, str|
unless RFC2396_REGEXP::PATTERN.const_defined?(sym, false)
RFC2396_REGEXP::PATTERN.const_set(sym, str)
end
end
end # module Gem::URI
8 changes: 4 additions & 4 deletions lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,25 @@ def join(*uris) # :nodoc:

# Compatibility for RFC2396 parser
def extract(str, schemes = nil, &block) # :nodoc:
warn "Gem::URI::RFC3986_PARSER.extract is obsoleted. Use Gem::URI::RFC2396_PARSER.extract explicitly.", uplevel: 1 if $VERBOSE
warn "Gem::URI::RFC3986_PARSER.extract is obsolete. Use Gem::URI::RFC2396_PARSER.extract explicitly.", uplevel: 1 if $VERBOSE
RFC2396_PARSER.extract(str, schemes, &block)
end

# Compatibility for RFC2396 parser
def make_regexp(schemes = nil) # :nodoc:
warn "Gem::URI::RFC3986_PARSER.make_regexp is obsoleted. Use Gem::URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
warn "Gem::URI::RFC3986_PARSER.make_regexp is obsolete. Use Gem::URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
RFC2396_PARSER.make_regexp(schemes)
end

# Compatibility for RFC2396 parser
def escape(str, unsafe = nil) # :nodoc:
warn "Gem::URI::RFC3986_PARSER.escape is obsoleted. Use Gem::URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
warn "Gem::URI::RFC3986_PARSER.escape is obsolete. Use Gem::URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
unsafe ? RFC2396_PARSER.escape(str, unsafe) : RFC2396_PARSER.escape(str)
end

# Compatibility for RFC2396 parser
def unescape(str, escaped = nil) # :nodoc:
warn "Gem::URI::RFC3986_PARSER.unescape is obsoleted. Use Gem::URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
warn "Gem::URI::RFC3986_PARSER.unescape is obsolete. Use Gem::URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
escaped ? RFC2396_PARSER.unescape(str, escaped) : RFC2396_PARSER.unescape(str)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/vendor/uri/lib/uri/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Gem::URI
# :stopdoc:
VERSION_CODE = '010001'.freeze
VERSION_CODE = '010002'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
# :startdoc:
end
2 changes: 1 addition & 1 deletion tool/bundler/vendor_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
gem "timeout", "0.4.2"
gem "thor", "1.3.2"
gem "tsort", "0.2.0"
gem "uri", "1.0.1"
gem "uri", "1.0.2"

0 comments on commit 71bebcf

Please sign in to comment.