From 1c425c1e6f54c8d3aac2480c2657e1d2264c9291 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:25:57 +0000 Subject: [PATCH] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../data/unicode.data | Bin .../lib/addressable.rb | 0 .../lib/addressable/idna.rb | 0 .../lib/addressable/idna/native.rb | 4 - .../lib/addressable/idna/pure.rb | 186 +--------------- .../lib/addressable/template.rb | 12 +- .../lib/addressable/uri.rb | 208 ++++++++++-------- .../lib/addressable/version.rb | 2 +- 9 files changed, 123 insertions(+), 291 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/data/unicode.data (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/idna.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/idna/native.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/idna/pure.rb (72%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/template.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/uri.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{addressable-2.8.1 => addressable-2.8.2}/lib/addressable/version.rb (98%) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index b8c63acbd9..22309585cd 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -30,7 +30,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/activesupport-6.1.7.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-5.0.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ast-2.4.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.4.15/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/msgpack-1.7.0") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/data/unicode.data b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/data/unicode.data similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/data/unicode.data rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/data/unicode.data diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/native.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/native.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/native.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/native.rb index 302e1b0cb5..b225e1c3c1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/native.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/native.rb @@ -29,10 +29,6 @@ module Addressable IDN::Punycode.decode(value.to_s) end - def self.unicode_normalize_kc(value) - IDN::Stringprep.nfkc_normalize(value.to_s) - end - def self.to_ascii(value) value.to_s.split('.', -1).map do |segment| if segment.size > 0 && segment.size < 64 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/pure.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/pure.rb similarity index 72% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/pure.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/pure.rb index a7c796e3d7..ae09ec66f3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/idna/pure.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/idna/pure.rb @@ -66,7 +66,7 @@ module Addressable # domain name as described in RFC 3490. def self.to_ascii(input) input = input.to_s unless input.is_a?(String) - input = input.dup + input = input.dup.force_encoding(Encoding::UTF_8).unicode_normalize(:nfkc) if input.respond_to?(:force_encoding) input.force_encoding(Encoding::ASCII_8BIT) end @@ -77,7 +77,7 @@ module Addressable part.force_encoding(Encoding::ASCII_8BIT) end if part =~ UTF8_REGEX && part =~ UTF8_REGEX_MULTIBYTE - ACE_PREFIX + punycode_encode(unicode_normalize_kc(part)) + ACE_PREFIX + punycode_encode(part) else part end @@ -112,15 +112,6 @@ module Addressable output end - # Unicode normalization form KC. - def self.unicode_normalize_kc(input) - input = input.to_s unless input.is_a?(String) - unpacked = input.unpack("U*") - unpacked = - unicode_compose(unicode_sort_canonical(unicode_decompose(unpacked))) - return unpacked.pack("U*") - end - ## # Unicode aware downcase method. # @@ -136,164 +127,6 @@ module Addressable end private_class_method :unicode_downcase - def self.unicode_compose(unpacked) - unpacked_result = [] - length = unpacked.length - - return unpacked if length == 0 - - starter = unpacked[0] - starter_cc = lookup_unicode_combining_class(starter) - starter_cc = 256 if starter_cc != 0 - for i in 1...length - ch = unpacked[i] - - if (starter_cc == 0 && - (composite = unicode_compose_pair(starter, ch)) != nil) - starter = composite - else - unpacked_result << starter - starter = ch - end - end - unpacked_result << starter - return unpacked_result - end - private_class_method :unicode_compose - - def self.unicode_compose_pair(ch_one, ch_two) - if ch_one >= HANGUL_LBASE && ch_one < HANGUL_LBASE + HANGUL_LCOUNT && - ch_two >= HANGUL_VBASE && ch_two < HANGUL_VBASE + HANGUL_VCOUNT - # Hangul L + V - return HANGUL_SBASE + ( - (ch_one - HANGUL_LBASE) * HANGUL_VCOUNT + (ch_two - HANGUL_VBASE) - ) * HANGUL_TCOUNT - elsif ch_one >= HANGUL_SBASE && - ch_one < HANGUL_SBASE + HANGUL_SCOUNT && - (ch_one - HANGUL_SBASE) % HANGUL_TCOUNT == 0 && - ch_two >= HANGUL_TBASE && ch_two < HANGUL_TBASE + HANGUL_TCOUNT - # Hangul LV + T - return ch_one + (ch_two - HANGUL_TBASE) - end - - p = [] - - ucs4_to_utf8(ch_one, p) - ucs4_to_utf8(ch_two, p) - - return lookup_unicode_composition(p) - end - private_class_method :unicode_compose_pair - - def self.ucs4_to_utf8(char, buffer) - if char < 128 - buffer << char - elsif char < 2048 - buffer << (char >> 6 | 192) - buffer << (char & 63 | 128) - elsif char < 0x10000 - buffer << (char >> 12 | 224) - buffer << (char >> 6 & 63 | 128) - buffer << (char & 63 | 128) - elsif char < 0x200000 - buffer << (char >> 18 | 240) - buffer << (char >> 12 & 63 | 128) - buffer << (char >> 6 & 63 | 128) - buffer << (char & 63 | 128) - elsif char < 0x4000000 - buffer << (char >> 24 | 248) - buffer << (char >> 18 & 63 | 128) - buffer << (char >> 12 & 63 | 128) - buffer << (char >> 6 & 63 | 128) - buffer << (char & 63 | 128) - elsif char < 0x80000000 - buffer << (char >> 30 | 252) - buffer << (char >> 24 & 63 | 128) - buffer << (char >> 18 & 63 | 128) - buffer << (char >> 12 & 63 | 128) - buffer << (char >> 6 & 63 | 128) - buffer << (char & 63 | 128) - end - end - private_class_method :ucs4_to_utf8 - - def self.unicode_sort_canonical(unpacked) - unpacked = unpacked.dup - i = 1 - length = unpacked.length - - return unpacked if length < 2 - - while i < length - last = unpacked[i-1] - ch = unpacked[i] - last_cc = lookup_unicode_combining_class(last) - cc = lookup_unicode_combining_class(ch) - if cc != 0 && last_cc != 0 && last_cc > cc - unpacked[i] = last - unpacked[i-1] = ch - i -= 1 if i > 1 - else - i += 1 - end - end - return unpacked - end - private_class_method :unicode_sort_canonical - - def self.unicode_decompose(unpacked) - unpacked_result = [] - for cp in unpacked - if cp >= HANGUL_SBASE && cp < HANGUL_SBASE + HANGUL_SCOUNT - l, v, t = unicode_decompose_hangul(cp) - unpacked_result << l - unpacked_result << v if v - unpacked_result << t if t - else - dc = lookup_unicode_compatibility(cp) - unless dc - unpacked_result << cp - else - unpacked_result.concat(unicode_decompose(dc.unpack("U*"))) - end - end - end - return unpacked_result - end - private_class_method :unicode_decompose - - def self.unicode_decompose_hangul(codepoint) - sindex = codepoint - HANGUL_SBASE; - if sindex < 0 || sindex >= HANGUL_SCOUNT - l = codepoint - v = t = nil - return l, v, t - end - l = HANGUL_LBASE + sindex / HANGUL_NCOUNT - v = HANGUL_VBASE + (sindex % HANGUL_NCOUNT) / HANGUL_TCOUNT - t = HANGUL_TBASE + sindex % HANGUL_TCOUNT - if t == HANGUL_TBASE - t = nil - end - return l, v, t - end - private_class_method :unicode_decompose_hangul - - def self.lookup_unicode_combining_class(codepoint) - codepoint_data = UNICODE_DATA[codepoint] - (codepoint_data ? - (codepoint_data[UNICODE_DATA_COMBINING_CLASS] || 0) : - 0) - end - private_class_method :lookup_unicode_combining_class - - def self.lookup_unicode_compatibility(codepoint) - codepoint_data = UNICODE_DATA[codepoint] - (codepoint_data ? - codepoint_data[UNICODE_DATA_COMPATIBILITY] : nil) - end - private_class_method :lookup_unicode_compatibility - def self.lookup_unicode_lowercase(codepoint) codepoint_data = UNICODE_DATA[codepoint] (codepoint_data ? @@ -302,21 +135,6 @@ module Addressable end private_class_method :lookup_unicode_lowercase - def self.lookup_unicode_composition(unpacked) - return COMPOSITION_TABLE[unpacked] - end - private_class_method :lookup_unicode_composition - - HANGUL_SBASE = 0xac00 - HANGUL_LBASE = 0x1100 - HANGUL_LCOUNT = 19 - HANGUL_VBASE = 0x1161 - HANGUL_VCOUNT = 21 - HANGUL_TBASE = 0x11a7 - HANGUL_TCOUNT = 28 - HANGUL_NCOUNT = HANGUL_VCOUNT * HANGUL_TCOUNT # 588 - HANGUL_SCOUNT = HANGUL_LCOUNT * HANGUL_NCOUNT # 11172 - UNICODE_DATA_COMBINING_CLASS = 0 UNICODE_DATA_EXCLUSION = 1 UNICODE_DATA_CANONICAL = 2 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/template.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/template.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/template.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/template.rb index 9e8174bf88..42cbf7cc56 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/template.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/template.rb @@ -892,7 +892,7 @@ module Addressable # operator. # # @param [Hash, Array, String] value - # Normalizes keys and values with IDNA#unicode_normalize_kc + # Normalizes unicode keys and values with String#unicode_normalize (NFC) # # @return [Hash, Array, String] The normalized values def normalize_value(value) @@ -902,15 +902,17 @@ module Addressable # Handle unicode normalization if value.kind_of?(Array) - value.map! { |val| Addressable::IDNA.unicode_normalize_kc(val) } + value.map! { |val| normalize_value(val) } elsif value.kind_of?(Hash) value = value.inject({}) { |acc, (k, v)| - acc[Addressable::IDNA.unicode_normalize_kc(k)] = - Addressable::IDNA.unicode_normalize_kc(v) + acc[normalize_value(k)] = normalize_value(v) acc } else - value = Addressable::IDNA.unicode_normalize_kc(value) + if value.encoding != Encoding::UTF_8 + value = value.dup.force_encoding(Encoding::UTF_8) + end + value = value.unicode_normalize(:nfc) end value end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/uri.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/uri.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/uri.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/uri.rb index 14b92530ce..50ccdaf517 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/uri.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/uri.rb @@ -53,7 +53,7 @@ module Addressable PCHAR = (UNRESERVED + SUB_DELIMS + "\\:\\@").freeze SCHEME = (ALPHA + DIGIT + "\\-\\+\\.").freeze HOST = (UNRESERVED + SUB_DELIMS + "\\[\\:\\]").freeze - AUTHORITY = (PCHAR + "\\[\\:\\]").freeze + AUTHORITY = (PCHAR + "\\[\\]").freeze PATH = (PCHAR + "\\/").freeze QUERY = (PCHAR + "\\/\\?").freeze FRAGMENT = (PCHAR + "\\/\\?").freeze @@ -117,7 +117,7 @@ module Addressable uri = uri.to_str rescue TypeError, NoMethodError raise TypeError, "Can't convert #{uri.class} into String." - end if not uri.is_a? String + end unless uri.is_a?(String) # This Regexp supplied as an example in RFC 3986, and it works great. scan = uri.scan(URIREGEX) @@ -138,15 +138,15 @@ module Addressable user = userinfo.strip[/^([^:]*):?/, 1] password = userinfo.strip[/:(.*)$/, 1] end + host = authority.sub( /^([^\[\]]*)@/, EMPTY_STR ).sub( /:([^:@\[\]]*?)$/, EMPTY_STR ) + port = authority[/:([^:@\[\]]*?)$/, 1] - end - if port == EMPTY_STR - port = nil + port = nil if port == EMPTY_STR end return new( @@ -189,7 +189,7 @@ module Addressable uri = uri.to_s end - if !uri.respond_to?(:to_str) + unless uri.respond_to?(:to_str) raise TypeError, "Can't convert #{uri.class} into String." end # Otherwise, convert to a String @@ -281,7 +281,7 @@ module Addressable return nil unless path # If a URI object is passed, just return itself. return path if path.kind_of?(self) - if !path.respond_to?(:to_str) + unless path.respond_to?(:to_str) raise TypeError, "Can't convert #{path.class} into String." end # Otherwise, convert to a String @@ -329,13 +329,13 @@ module Addressable # #=> # def self.join(*uris) uri_objects = uris.collect do |uri| - if !uri.respond_to?(:to_str) + unless uri.respond_to?(:to_str) raise TypeError, "Can't convert #{uri.class} into String." end uri.kind_of?(self) ? uri : self.parse(uri.to_str) end result = uri_objects.shift.dup - for uri in uri_objects + uri_objects.each do |uri| result.join!(uri) end return result @@ -481,7 +481,7 @@ module Addressable leave_encoded.include?(c) ? sequence : c end - result.force_encoding("utf-8") + result.force_encoding(Encoding::UTF_8) if return_type == String return result elsif return_type == ::Addressable::URI @@ -579,7 +579,7 @@ module Addressable unencoded = self.unencode_component(component, String, leave_encoded) begin encoded = self.encode_component( - Addressable::IDNA.unicode_normalize_kc(unencoded), + unencoded.unicode_normalize(:nfc), character_class, leave_encoded ) @@ -687,8 +687,7 @@ module Addressable components.each do |key, value| if value != nil begin - components[key] = - Addressable::IDNA.unicode_normalize_kc(value.to_str) + components[key] = value.to_str.unicode_normalize(:nfc) rescue ArgumentError # Likely a malformed UTF-8 character, skip unicode normalization components[key] = value.to_str @@ -836,7 +835,9 @@ module Addressable end end - self.defer_validation do + reset_ivs + + defer_validation do # Bunch of crazy logic required because of the composite components # like userinfo and authority. self.scheme = options[:scheme] if options[:scheme] @@ -851,7 +852,8 @@ module Addressable self.query_values = options[:query_values] if options[:query_values] self.fragment = options[:fragment] if options[:fragment] end - self.to_s + + to_s # force path validation end ## @@ -878,9 +880,7 @@ module Addressable # The scheme component for this URI. # # @return [String] The scheme component. - def scheme - return defined?(@scheme) ? @scheme : nil - end + attr_reader :scheme ## # The scheme component for this URI, normalized. @@ -888,8 +888,8 @@ module Addressable # @return [String] The scheme component, normalized. def normalized_scheme return nil unless self.scheme - @normalized_scheme ||= begin - if self.scheme =~ /^\s*ssh\+svn\s*$/i + if @normalized_scheme == NONE + @normalized_scheme = if self.scheme =~ /^\s*ssh\+svn\s*$/i "svn+ssh".dup else Addressable::URI.normalize_component( @@ -920,7 +920,7 @@ module Addressable @scheme = nil if @scheme.to_s.strip.empty? # Reset dependent values - remove_instance_variable(:@normalized_scheme) if defined?(@normalized_scheme) + @normalized_scheme = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -931,9 +931,7 @@ module Addressable # The user component for this URI. # # @return [String] The user component. - def user - return defined?(@user) ? @user : nil - end + attr_reader :user ## # The user component for this URI, normalized. @@ -941,8 +939,8 @@ module Addressable # @return [String] The user component, normalized. def normalized_user return nil unless self.user - return @normalized_user if defined?(@normalized_user) - @normalized_user ||= begin + return @normalized_user unless @normalized_user == NONE + @normalized_user = begin if normalized_scheme =~ /https?/ && self.user.strip.empty? && (!self.password || self.password.strip.empty?) nil @@ -970,14 +968,14 @@ module Addressable # You can't have a nil user with a non-nil password if password != nil - @user = EMPTY_STR if @user.nil? + @user = EMPTY_STR unless user end # Reset dependent values - remove_instance_variable(:@userinfo) if defined?(@userinfo) - remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) - remove_instance_variable(:@authority) if defined?(@authority) - remove_instance_variable(:@normalized_user) if defined?(@normalized_user) + @userinfo = nil + @normalized_userinfo = NONE + @authority = nil + @normalized_user = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -988,9 +986,7 @@ module Addressable # The password component for this URI. # # @return [String] The password component. - def password - return defined?(@password) ? @password : nil - end + attr_reader :password ## # The password component for this URI, normalized. @@ -998,8 +994,8 @@ module Addressable # @return [String] The password component, normalized. def normalized_password return nil unless self.password - return @normalized_password if defined?(@normalized_password) - @normalized_password ||= begin + return @normalized_password unless @normalized_password == NONE + @normalized_password = begin if self.normalized_scheme =~ /https?/ && self.password.strip.empty? && (!self.user || self.user.strip.empty?) nil @@ -1026,17 +1022,15 @@ module Addressable @password = new_password ? new_password.to_str : nil # You can't have a nil user with a non-nil password - @password ||= nil - @user ||= nil if @password != nil - @user = EMPTY_STR if @user.nil? + self.user = EMPTY_STR if user.nil? end # Reset dependent values - remove_instance_variable(:@userinfo) if defined?(@userinfo) - remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) - remove_instance_variable(:@authority) if defined?(@authority) - remove_instance_variable(:@normalized_password) if defined?(@normalized_password) + @userinfo = nil + @normalized_userinfo = NONE + @authority = nil + @normalized_password = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -1066,8 +1060,8 @@ module Addressable # @return [String] The userinfo component, normalized. def normalized_userinfo return nil unless self.userinfo - return @normalized_userinfo if defined?(@normalized_userinfo) - @normalized_userinfo ||= begin + return @normalized_userinfo unless @normalized_userinfo == NONE + @normalized_userinfo = begin current_user = self.normalized_user current_password = self.normalized_password if !current_user && !current_password @@ -1105,7 +1099,7 @@ module Addressable self.user = new_user # Reset dependent values - remove_instance_variable(:@authority) if defined?(@authority) + @authority = nil remove_composite_values # Ensure we haven't created an invalid URI @@ -1116,9 +1110,7 @@ module Addressable # The host component for this URI. # # @return [String] The host component. - def host - return defined?(@host) ? @host : nil - end + attr_reader :host ## # The host component for this URI, normalized. @@ -1161,8 +1153,8 @@ module Addressable @host = new_host ? new_host.to_str : nil # Reset dependent values - remove_instance_variable(:@authority) if defined?(@authority) - remove_instance_variable(:@normalized_host) if defined?(@normalized_host) + @authority = nil + @normalized_host = nil remove_composite_values # Ensure we haven't created an invalid URI @@ -1293,14 +1285,14 @@ module Addressable end # Password assigned first to ensure validity in case of nil - self.password = defined?(new_password) ? new_password : nil - self.user = defined?(new_user) ? new_user : nil - self.host = defined?(new_host) ? new_host : nil - self.port = defined?(new_port) ? new_port : nil + self.password = new_password + self.user = new_user + self.host = new_host + self.port = new_port # Reset dependent values - remove_instance_variable(:@userinfo) if defined?(@userinfo) - remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) + @userinfo = nil + @normalized_userinfo = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -1348,16 +1340,16 @@ module Addressable new_port = new_origin[/:([^:@\[\]\/]*?)$/, 1] end - self.scheme = defined?(new_scheme) ? new_scheme : nil - self.host = defined?(new_host) ? new_host : nil - self.port = defined?(new_port) ? new_port : nil + self.scheme = new_scheme + self.host = new_host + self.port = new_port self.userinfo = nil # Reset dependent values - remove_instance_variable(:@userinfo) if defined?(@userinfo) - remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) - remove_instance_variable(:@authority) if defined?(@authority) - remove_instance_variable(:@normalized_authority) if defined?(@normalized_authority) + @userinfo = nil + @normalized_userinfo = NONE + @authority = nil + @normalized_authority = nil remove_composite_values # Ensure we haven't created an invalid URI @@ -1384,9 +1376,7 @@ module Addressable # infer port numbers from default values. # # @return [Integer] The port component. - def port - return defined?(@port) ? @port : nil - end + attr_reader :port ## # The port component for this URI, normalized. @@ -1394,8 +1384,8 @@ module Addressable # @return [Integer] The port component, normalized. def normalized_port return nil unless self.port - return @normalized_port if defined?(@normalized_port) - @normalized_port ||= begin + return @normalized_port unless @normalized_port == NONE + @normalized_port = begin if URI.port_mapping[self.normalized_scheme] == self.port nil else @@ -1426,8 +1416,8 @@ module Addressable @port = nil if @port == 0 # Reset dependent values - remove_instance_variable(:@authority) if defined?(@authority) - remove_instance_variable(:@normalized_port) if defined?(@normalized_port) + @authority = nil + @normalized_port = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -1528,9 +1518,7 @@ module Addressable # The path component for this URI. # # @return [String] The path component. - def path - return defined?(@path) ? @path : EMPTY_STR - end + attr_reader :path NORMPATH = /^(?!\/)[^\/:]*:.*$/ ## @@ -1579,7 +1567,7 @@ module Addressable end # Reset dependent values - remove_instance_variable(:@normalized_path) if defined?(@normalized_path) + @normalized_path = nil remove_composite_values # Ensure we haven't created an invalid URI @@ -1609,9 +1597,7 @@ module Addressable # The query component for this URI. # # @return [String] The query component. - def query - return defined?(@query) ? @query : nil - end + attr_reader :query ## # The query component for this URI, normalized. @@ -1619,8 +1605,8 @@ module Addressable # @return [String] The query component, normalized. def normalized_query(*flags) return nil unless self.query - return @normalized_query if defined?(@normalized_query) - @normalized_query ||= begin + return @normalized_query unless @normalized_query == NONE + @normalized_query = begin modified_query_class = Addressable::URI::CharacterClasses::QUERY.dup # Make sure possible key-value pair delimiters are escaped. modified_query_class.sub!("\\&", "").sub!("\\;", "") @@ -1652,7 +1638,7 @@ module Addressable @query = new_query ? new_query.to_str : nil # Reset dependent values - remove_instance_variable(:@normalized_query) if defined?(@normalized_query) + @normalized_query = NONE remove_composite_values end @@ -1814,9 +1800,7 @@ module Addressable # The fragment component for this URI. # # @return [String] The fragment component. - def fragment - return defined?(@fragment) ? @fragment : nil - end + attr_reader :fragment ## # The fragment component for this URI, normalized. @@ -1824,8 +1808,8 @@ module Addressable # @return [String] The fragment component, normalized. def normalized_fragment return nil unless self.fragment - return @normalized_fragment if defined?(@normalized_fragment) - @normalized_fragment ||= begin + return @normalized_fragment unless @normalized_fragment == NONE + @normalized_fragment = begin component = Addressable::URI.normalize_component( self.fragment, Addressable::URI::NormalizeCharacterClasses::FRAGMENT @@ -1848,7 +1832,7 @@ module Addressable @fragment = new_fragment ? new_fragment.to_str : nil # Reset dependent values - remove_instance_variable(:@normalized_fragment) if defined?(@normalized_fragment) + @normalized_fragment = NONE remove_composite_values # Ensure we haven't created an invalid URI @@ -2014,7 +1998,7 @@ module Addressable # # @see Hash#merge def merge(hash) - if !hash.respond_to?(:to_hash) + unless hash.respond_to?(:to_hash) raise TypeError, "Can't convert #{hash.class} into Hash." end hash = hash.to_hash @@ -2408,7 +2392,8 @@ module Addressable yield @validation_deferred = false validate - return nil + ensure + @validation_deferred = false end protected @@ -2507,11 +2492,7 @@ module Addressable # @return [Addressable::URI] self. def replace_self(uri) # Reset dependent values - instance_variables.each do |var| - if instance_variable_defined?(var) && var != :@validation_deferred - remove_instance_variable(var) - end - end + reset_ivs @scheme = uri.scheme @user = uri.user @@ -2543,8 +2524,8 @@ module Addressable # # @api private def remove_composite_values - remove_instance_variable(:@uri_string) if defined?(@uri_string) - remove_instance_variable(:@hash) if defined?(@hash) + @uri_string = nil + @hash = nil end ## @@ -2556,5 +2537,40 @@ module Addressable str.force_encoding(Encoding::UTF_8) end end + + private + + ## + # Resets instance variables + # + # @api private + def reset_ivs + @scheme = nil + @user = nil + @normalized_scheme = NONE + @normalized_user = NONE + @uri_string = nil + @hash = nil + @userinfo = nil + @normalized_userinfo = NONE + @authority = nil + @password = nil + @normalized_authority = nil + @port = nil + @normalized_password = NONE + @host = nil + @normalized_host = nil + @normalized_port = NONE + @path = EMPTY_STR + @normalized_path = nil + @normalized_query = NONE + @fragment = nil + @normalized_fragment = NONE + @query = nil + end + + NONE = Object.new.freeze + + private_constant :NONE end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/version.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/version.rb index d8e1644bb4..6e7fb78d9e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib/addressable/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.2/lib/addressable/version.rb @@ -23,7 +23,7 @@ if !defined?(Addressable::VERSION) module VERSION MAJOR = 2 MINOR = 8 - TINY = 1 + TINY = 2 STRING = [MAJOR, MINOR, TINY].join('.') end