brew vendor-gems: commit updates.
This commit is contained in:
parent
61af42d496
commit
d2776142c6
@ -160,6 +160,7 @@ GEM
|
|||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
aarch64-linux
|
aarch64-linux
|
||||||
|
arm-linux
|
||||||
arm64-darwin
|
arm64-darwin
|
||||||
x86_64-darwin
|
x86_64-darwin
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
|||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.0/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.0/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.1.9")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.1.9")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.1.9/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.1.9/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.5.0/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.5.1/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.1/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.1/lib")
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
module BinData
|
|
||||||
VERSION = '2.5.0'
|
|
||||||
end
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
# BinData -- Binary data manipulator.
|
# BinData -- Binary data manipulator.
|
||||||
# Copyright (c) 2007 - 2018 Dion Mendel.
|
# Copyright (c) 2007 - 2025 Dion Mendel.
|
||||||
|
|
||||||
require 'bindata/version'
|
require 'bindata/version'
|
||||||
require 'bindata/array'
|
require 'bindata/array'
|
||||||
@ -35,4 +35,4 @@ require 'bindata/warnings'
|
|||||||
#
|
#
|
||||||
# BinData is released under the same license as Ruby.
|
# BinData is released under the same license as Ruby.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2018 Dion Mendel.
|
# Copyright (c) 2007 - 2025 Dion Mendel.
|
||||||
@ -456,7 +456,7 @@ module BinData
|
|||||||
private
|
private
|
||||||
|
|
||||||
def create_empty_binary_string
|
def create_empty_binary_string
|
||||||
"".force_encoding(Encoding::BINARY)
|
String.new.force_encoding(Encoding::BINARY)
|
||||||
end
|
end
|
||||||
|
|
||||||
def chain_seekable?
|
def chain_seekable?
|
||||||
@ -36,14 +36,22 @@ module BinData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def lookup(name, hints = {})
|
def lookup(name, hints = {})
|
||||||
the_class = @registry[normalize_name(name, hints)]
|
search_names(name, hints).each do |search|
|
||||||
if the_class
|
register_dynamic_class(search)
|
||||||
the_class
|
if @registry.has_key?(search)
|
||||||
elsif @registry[normalize_name(name, hints.merge(endian: :big))]
|
return @registry[search]
|
||||||
raise(UnRegisteredTypeError, "#{name}, do you need to specify endian?")
|
end
|
||||||
else
|
|
||||||
raise(UnRegisteredTypeError, name)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# give the user a hint if the endian keyword is missing
|
||||||
|
search_names(name, hints.merge(endian: :big)).each do |search|
|
||||||
|
register_dynamic_class(search)
|
||||||
|
if @registry.has_key?(search)
|
||||||
|
raise(UnRegisteredTypeError, "#{name}, do you need to specify endian?")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
raise(UnRegisteredTypeError, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Convert CamelCase +name+ to underscore style.
|
# Convert CamelCase +name+ to underscore style.
|
||||||
@ -60,27 +68,20 @@ module BinData
|
|||||||
#---------------
|
#---------------
|
||||||
private
|
private
|
||||||
|
|
||||||
def normalize_name(name, hints)
|
def search_names(name, hints)
|
||||||
name = underscore_name(name)
|
base = underscore_name(name)
|
||||||
|
searches = []
|
||||||
|
|
||||||
if !registered?(name)
|
search_prefix = [""] + Array(hints[:search_prefix])
|
||||||
search_prefix = [""] + Array(hints[:search_prefix])
|
search_prefix.each do |prefix|
|
||||||
search_prefix.each do |prefix|
|
nwp = name_with_prefix(base, prefix)
|
||||||
nwp = name_with_prefix(name, prefix)
|
nwe = name_with_endian(nwp, hints[:endian])
|
||||||
if registered?(nwp)
|
|
||||||
name = nwp
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
nwe = name_with_endian(nwp, hints[:endian])
|
searches << nwp
|
||||||
if registered?(nwe)
|
searches << nwe if nwe
|
||||||
name = nwe
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
name
|
searches
|
||||||
end
|
end
|
||||||
|
|
||||||
def name_with_prefix(name, prefix)
|
def name_with_prefix(name, prefix)
|
||||||
@ -93,7 +94,7 @@ module BinData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def name_with_endian(name, endian)
|
def name_with_endian(name, endian)
|
||||||
return name if endian.nil?
|
return nil if endian.nil?
|
||||||
|
|
||||||
suffix = (endian == :little) ? 'le' : 'be'
|
suffix = (endian == :little) ? 'le' : 'be'
|
||||||
if /^u?int\d+$/.match?(name)
|
if /^u?int\d+$/.match?(name)
|
||||||
@ -103,17 +104,11 @@ module BinData
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def registered?(name)
|
|
||||||
register_dynamic_class(name) unless @registry.key?(name)
|
|
||||||
|
|
||||||
@registry.key?(name)
|
|
||||||
end
|
|
||||||
|
|
||||||
def register_dynamic_class(name)
|
def register_dynamic_class(name)
|
||||||
if /^u?int\d+(le|be)$/.match?(name) || /^s?bit\d+(le)?$/.match?(name)
|
if /^u?int\d+(le|be)$/.match?(name) || /^s?bit\d+(le)?$/.match?(name)
|
||||||
class_name = name.gsub(/(?:^|_)(.)/) { $1.upcase }
|
class_name = name.gsub(/(?:^|_)(.)/) { $1.upcase }
|
||||||
begin
|
begin
|
||||||
# call const_get for side effects
|
# call const_get for side effect of creating class
|
||||||
BinData.const_get(class_name)
|
BinData.const_get(class_name)
|
||||||
rescue NameError
|
rescue NameError
|
||||||
end
|
end
|
||||||
@ -124,7 +119,7 @@ module BinData
|
|||||||
prev_class = @registry[name]
|
prev_class = @registry[name]
|
||||||
if prev_class && prev_class != class_to_register
|
if prev_class && prev_class != class_to_register
|
||||||
Kernel.warn "warning: replacing registered class #{prev_class} " \
|
Kernel.warn "warning: replacing registered class #{prev_class} " \
|
||||||
"with #{class_to_register}"
|
"with #{class_to_register}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
3
Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bindata-2.5.1/lib/bindata/version.rb
vendored
Normal file
3
Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bindata-2.5.1/lib/bindata/version.rb
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module BinData
|
||||||
|
VERSION = '2.5.1'
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user