brew vendor-gems: commit updates.
This commit is contained in:
parent
783d30855b
commit
b281f51c25
@ -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.10/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/activesupport-6.1.7.4/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-5.0.3/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.4/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.5/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-22/#{Gem.extension_api_version}/msgpack-1.7.2")
|
||||
|
||||
@ -344,17 +344,13 @@ module Addressable
|
||||
##
|
||||
# Tables used to optimize encoding operations in `self.encode_component`
|
||||
# and `self.normalize_component`
|
||||
SEQUENCE_ENCODING_TABLE = Hash.new do |hash, sequence|
|
||||
hash[sequence] = sequence.unpack("C*").map do |c|
|
||||
format("%02x", c)
|
||||
end.join
|
||||
end
|
||||
SEQUENCE_ENCODING_TABLE = (0..255).map do |byte|
|
||||
format("%02x", byte).freeze
|
||||
end.freeze
|
||||
|
||||
SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = Hash.new do |hash, sequence|
|
||||
hash[sequence] = sequence.unpack("C*").map do |c|
|
||||
format("%%%02X", c)
|
||||
end.join
|
||||
end
|
||||
SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = (0..255).map do |byte|
|
||||
format("%%%02X", byte).freeze
|
||||
end.freeze
|
||||
|
||||
##
|
||||
# Percent encodes a URI component.
|
||||
@ -421,16 +417,17 @@ module Addressable
|
||||
component = component.dup
|
||||
component.force_encoding(Encoding::ASCII_8BIT)
|
||||
# Avoiding gsub! because there are edge cases with frozen strings
|
||||
component = component.gsub(character_class) do |sequence|
|
||||
SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE[sequence]
|
||||
component = component.gsub(character_class) do |char|
|
||||
SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE[char.ord]
|
||||
end
|
||||
if upcase_encoded.length > 0
|
||||
upcase_encoded_chars = upcase_encoded.chars.map do |char|
|
||||
SEQUENCE_ENCODING_TABLE[char]
|
||||
upcase_encoded_chars = upcase_encoded.bytes.map do |byte|
|
||||
SEQUENCE_ENCODING_TABLE[byte]
|
||||
end
|
||||
component = component.gsub(/%(#{upcase_encoded_chars.join('|')})/,
|
||||
&:upcase)
|
||||
end
|
||||
|
||||
return component
|
||||
end
|
||||
|
||||
@ -560,10 +557,9 @@ module Addressable
|
||||
leave_re = if leave_encoded.length > 0
|
||||
character_class = "#{character_class}%" unless character_class.include?('%')
|
||||
|
||||
"|%(?!#{leave_encoded.chars.flat_map do |char|
|
||||
seq = SEQUENCE_ENCODING_TABLE[char]
|
||||
[seq.upcase, seq.downcase]
|
||||
end.join('|')})"
|
||||
bytes = leave_encoded.bytes
|
||||
leave_encoded_pattern = bytes.map { |b| SEQUENCE_ENCODING_TABLE[b] }.join('|')
|
||||
"|%(?!#{leave_encoded_pattern}|#{leave_encoded_pattern.upcase})"
|
||||
end
|
||||
|
||||
character_class = if leave_re
|
||||
@ -2396,6 +2392,25 @@ module Addressable
|
||||
@validation_deferred = false
|
||||
end
|
||||
|
||||
def encode_with(coder)
|
||||
instance_variables.each do |ivar|
|
||||
value = instance_variable_get(ivar)
|
||||
if value != NONE
|
||||
key = ivar.to_s.slice(1..-1)
|
||||
coder[key] = value
|
||||
end
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
def init_with(coder)
|
||||
reset_ivs
|
||||
coder.map.each do |key, value|
|
||||
instance_variable_set("@#{key}", value)
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
protected
|
||||
SELF_REF = '.'
|
||||
PARENT = '..'
|
||||
@ -2569,7 +2584,7 @@ module Addressable
|
||||
@query = nil
|
||||
end
|
||||
|
||||
NONE = Object.new.freeze
|
||||
NONE = Module.new.freeze
|
||||
|
||||
private_constant :NONE
|
||||
end
|
||||
@ -23,7 +23,7 @@ if !defined?(Addressable::VERSION)
|
||||
module VERSION
|
||||
MAJOR = 2
|
||||
MINOR = 8
|
||||
TINY = 4
|
||||
TINY = 5
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY].join('.')
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user