+ # BinData::Struct.new(name: :my_struct, fields: ...)
+ # array = BinData::Array.new(type: :my_struct)
+ #
+ module RegisterNamePlugin
+
+ def self.included(base) #:nodoc:
+ # The registered name may be provided explicitly.
+ base.optional_parameter :name
+ end
+
+ def initialize_shared_instance
+ if has_parameter?(:name)
+ RegisteredClasses.register(get_parameter(:name), self)
+ end
+ super
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/offset.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/offset.rb
new file mode 100644
index 0000000000000..7b9a61e658c6e
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/offset.rb
@@ -0,0 +1,94 @@
+module BinData
+ # WARNING: THIS IS UNSUPPORTED!!
+ #
+ # This was a (failed) experimental feature that allowed seeking within the
+ # input stream. It remains here for backwards compatability for the few
+ # people that used it.
+ #
+ # The official way to skip around the stream is to use BinData::Skip with
+ # the `:to_abs_offset` parameter.
+ #
+ # == Parameters
+ #
+ # Parameters may be provided at initialisation to control the behaviour of
+ # an object. These parameters are:
+ #
+ # [:check_offset] Raise an error if the current IO offset doesn't
+ # meet this criteria. A boolean return indicates
+ # success or failure. Any other return is compared
+ # to the current offset. The variable +offset+
+ # is made available to any lambda assigned to
+ # this parameter. This parameter is only checked
+ # before reading.
+ # [:adjust_offset] Ensures that the current IO offset is at this
+ # position before reading. This is like
+ # :check_offset, except that it will
+ # adjust the IO offset instead of raising an error.
+ module CheckOrAdjustOffsetPlugin
+
+ def self.included(base) #:nodoc:
+ base.optional_parameters :check_offset, :adjust_offset
+ base.mutually_exclusive_parameters :check_offset, :adjust_offset
+ end
+
+ def initialize_shared_instance
+ extend CheckOffsetMixin if has_parameter?(:check_offset)
+ extend AdjustOffsetMixin if has_parameter?(:adjust_offset)
+ super
+ end
+
+ module CheckOffsetMixin
+ def do_read(io) #:nodoc:
+ check_offset(io)
+ super(io)
+ end
+
+ #---------------
+ private
+
+ def check_offset(io)
+ actual_offset = io.offset
+ expected = eval_parameter(:check_offset, offset: actual_offset)
+
+ if !expected
+ raise ValidityError, "offset not as expected for #{debug_name}"
+ elsif actual_offset != expected && expected != true
+ raise ValidityError,
+ "offset is '#{actual_offset}' but " +
+ "expected '#{expected}' for #{debug_name}"
+ end
+ end
+ end
+
+ module AdjustOffsetMixin
+ def do_read(io) #:nodoc:
+ adjust_offset(io)
+ super(io)
+ end
+
+ #---------------
+ private
+
+ def adjust_offset(io)
+ actual_offset = io.offset
+ expected = eval_parameter(:adjust_offset)
+ if actual_offset != expected
+ begin
+ seek = expected - actual_offset
+ io.seekbytes(seek)
+ warn "adjusting stream position by #{seek} bytes" if $VERBOSE
+ rescue
+ raise ValidityError,
+ "offset is '#{actual_offset}' but couldn't seek to " +
+ "expected '#{expected}' for #{debug_name}"
+ end
+ end
+ end
+ end
+ end
+
+ # Add these offset options to Base
+ class Base
+ include CheckOrAdjustOffsetPlugin
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/params.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/params.rb
new file mode 100644
index 0000000000000..80112483c986b
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/params.rb
@@ -0,0 +1,128 @@
+require 'bindata/lazy'
+
+module BinData
+ module AcceptedParametersPlugin
+ # Mandatory parameters must be present when instantiating a data object.
+ def mandatory_parameters(*args)
+ accepted_parameters.mandatory(*args)
+ end
+
+ # Optional parameters may be present when instantiating a data object.
+ def optional_parameters(*args)
+ accepted_parameters.optional(*args)
+ end
+
+ # Default parameters can be overridden when instantiating a data object.
+ def default_parameters(*args)
+ accepted_parameters.default(*args)
+ end
+
+ # Mutually exclusive parameters may not all be present when
+ # instantiating a data object.
+ def mutually_exclusive_parameters(*args)
+ accepted_parameters.mutually_exclusive(*args)
+ end
+
+ alias mandatory_parameter mandatory_parameters
+ alias optional_parameter optional_parameters
+ alias default_parameter default_parameters
+
+ def accepted_parameters #:nodoc:
+ @accepted_parameters ||= begin
+ ancestor_params = superclass.respond_to?(:accepted_parameters) ?
+ superclass.accepted_parameters : nil
+ AcceptedParameters.new(ancestor_params)
+ end
+ end
+
+ # BinData objects accept parameters when initializing. AcceptedParameters
+ # allow a BinData class to declaratively identify accepted parameters as
+ # mandatory, optional, default or mutually exclusive.
+ class AcceptedParameters
+ def initialize(ancestor_parameters = nil)
+ if ancestor_parameters
+ @mandatory = ancestor_parameters.mandatory.dup
+ @optional = ancestor_parameters.optional.dup
+ @default = ancestor_parameters.default.dup
+ @mutually_exclusive = ancestor_parameters.mutually_exclusive.dup
+ else
+ @mandatory = []
+ @optional = []
+ @default = Hash.new
+ @mutually_exclusive = []
+ end
+ end
+
+ def mandatory(*args)
+ unless args.empty?
+ @mandatory.concat(to_syms(args))
+ @mandatory.uniq!
+ end
+ @mandatory
+ end
+
+ def optional(*args)
+ unless args.empty?
+ @optional.concat(to_syms(args))
+ @optional.uniq!
+ end
+ @optional
+ end
+
+ def default(args = nil)
+ if args
+ to_syms(args.keys) # call for side effect of validating names
+ args.each_pair do |param, value|
+ @default[param.to_sym] = value
+ end
+ end
+ @default
+ end
+
+ def mutually_exclusive(*args)
+ arg1 = args.shift
+ until args.empty?
+ args.each do |arg2|
+ @mutually_exclusive.push([arg1.to_sym, arg2.to_sym])
+ @mutually_exclusive.uniq!
+ end
+ arg1 = args.shift
+ end
+ @mutually_exclusive
+ end
+
+ def all
+ (@mandatory + @optional + @default.keys).uniq
+ end
+
+ #---------------
+ private
+
+ def to_syms(args)
+ syms = args.collect(&:to_sym)
+ ensure_valid_names(syms)
+ syms
+ end
+
+ def ensure_valid_names(names)
+ invalid_names = self.class.invalid_parameter_names
+ names.each do |name|
+ if invalid_names.include?(name)
+ raise NameError.new("Rename parameter '#{name}' " \
+ "as it shadows an existing method.", name)
+ end
+ end
+ end
+
+ def self.invalid_parameter_names
+ @invalid_names ||= begin
+ all_names = LazyEvaluator.instance_methods(true) + Kernel.methods
+ allowed_names = [:name, :type]
+ invalid_names = (all_names - allowed_names).uniq
+
+ Hash[*invalid_names.collect { |key| [key.to_sym, true] }.flatten]
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/primitive.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/primitive.rb
new file mode 100644
index 0000000000000..9b9bd8d41d5bd
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/primitive.rb
@@ -0,0 +1,143 @@
+require 'bindata/base_primitive'
+require 'bindata/dsl'
+require 'bindata/struct'
+
+module BinData
+ # A Primitive is a declarative way to define a new BinData data type.
+ # The data type must contain a primitive value only, i.e numbers or strings.
+ # For new data types that contain multiple values see BinData::Record.
+ #
+ # To define a new data type, set fields as if for Record and add a
+ # #get and #set method to extract / convert the data between the fields
+ # and the #value of the object.
+ #
+ # require 'bindata'
+ #
+ # class PascalString < BinData::Primitive
+ # uint8 :len, value: -> { data.length }
+ # string :data, read_length: :len
+ #
+ # def get
+ # self.data
+ # end
+ #
+ # def set(v)
+ # self.data = v
+ # end
+ # end
+ #
+ # ps = PascalString.new(initial_value: "hello")
+ # ps.to_binary_s #=> "\005hello"
+ # ps.read("\003abcde")
+ # ps #=> "abc"
+ #
+ # # Unsigned 24 bit big endian integer
+ # class Uint24be < BinData::Primitive
+ # uint8 :byte1
+ # uint8 :byte2
+ # uint8 :byte3
+ #
+ # def get
+ # (self.byte1 << 16) | (self.byte2 << 8) | self.byte3
+ # end
+ #
+ # def set(v)
+ # v = 0 if v < 0
+ # v = 0xffffff if v > 0xffffff
+ #
+ # self.byte1 = (v >> 16) & 0xff
+ # self.byte2 = (v >> 8) & 0xff
+ # self.byte3 = v & 0xff
+ # end
+ # end
+ #
+ # u24 = Uint24be.new
+ # u24.read("\x12\x34\x56")
+ # "0x%x" % u24 #=> 0x123456
+ #
+ # == Parameters
+ #
+ # Primitive objects accept all the parameters that BinData::BasePrimitive do.
+ #
+ class Primitive < BasePrimitive
+ extend DSLMixin
+
+ unregister_self
+ dsl_parser :primitive
+ arg_processor :primitive
+
+ mandatory_parameter :struct_params
+
+ def initialize_instance
+ super
+ @struct = BinData::Struct.new(get_parameter(:struct_params), self)
+ end
+
+ def respond_to?(symbol, include_private = false) #:nodoc:
+ @struct.respond_to?(symbol, include_private) || super
+ end
+
+ def method_missing(symbol, *args, &block) #:nodoc:
+ if @struct.respond_to?(symbol)
+ @struct.__send__(symbol, *args, &block)
+ else
+ super
+ end
+ end
+
+ def assign(val)
+ super(val)
+ set(_value)
+ @value = get
+ end
+
+ def debug_name_of(child) #:nodoc:
+ debug_name + "-internal-"
+ end
+
+ def do_write(io)
+ set(_value)
+ @struct.do_write(io)
+ end
+
+ def do_num_bytes
+ set(_value)
+ @struct.do_num_bytes
+ end
+
+ #---------------
+ private
+
+ def sensible_default
+ get
+ end
+
+ def read_and_return_value(io)
+ @struct.do_read(io)
+ get
+ end
+
+ ###########################################################################
+ # To be implemented by subclasses
+
+ # Extracts the value for this data object from the fields of the
+ # internal struct.
+ def get
+ raise NotImplementedError
+ end
+
+ # Sets the fields of the internal struct to represent +v+.
+ def set(v)
+ raise NotImplementedError
+ end
+
+ # To be implemented by subclasses
+ ###########################################################################
+ end
+
+ class PrimitiveArgProcessor < BaseArgProcessor
+ def sanitize_parameters!(obj_class, params)
+ params[:struct_params] = params.create_sanitized_params(obj_class.dsl_params, BinData::Struct)
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/record.rb
new file mode 100644
index 0000000000000..b011cf5e1c8dd
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/record.rb
@@ -0,0 +1,23 @@
+require 'bindata/dsl'
+require 'bindata/struct'
+
+module BinData
+ # A Record is a declarative wrapper around Struct.
+ #
+ # See +Struct+ for more info.
+ class Record < BinData::Struct
+ extend DSLMixin
+
+ unregister_self
+ dsl_parser :struct
+ arg_processor :record
+ end
+
+ class RecordArgProcessor < StructArgProcessor
+ include MultiFieldArgSeparator
+
+ def sanitize_parameters!(obj_class, params)
+ super(obj_class, params.merge!(obj_class.dsl_params))
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/registry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/registry.rb
new file mode 100644
index 0000000000000..fc47740bd5594
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/registry.rb
@@ -0,0 +1,134 @@
+module BinData
+
+ class UnRegisteredTypeError < StandardError ; end
+
+ # This registry contains a register of name -> class mappings.
+ #
+ # Numerics (integers and floating point numbers) have an endian property as
+ # part of their name (e.g. int32be, float_le).
+ #
+ # Classes can be looked up based on their full name or an abbreviated +name+
+ # with +hints+.
+ #
+ # There are two hints supported, :endian and :search_prefix.
+ #
+ # #lookup("int32", { endian: :big }) will return Int32Be.
+ #
+ # #lookup("my_type", { search_prefix: :ns }) will return NsMyType.
+ #
+ # Names are stored in under_score_style, not camelCase.
+ class Registry
+
+ def initialize
+ @registry = {}
+ end
+
+ def register(name, class_to_register)
+ return if name.nil? || class_to_register.nil?
+
+ formatted_name = underscore_name(name)
+ warn_if_name_is_already_registered(formatted_name, class_to_register)
+
+ @registry[formatted_name] = class_to_register
+ end
+
+ def unregister(name)
+ @registry.delete(underscore_name(name))
+ end
+
+ def lookup(name, hints = {})
+ the_class = @registry[normalize_name(name, hints)]
+ if the_class
+ the_class
+ elsif @registry[normalize_name(name, hints.merge(endian: :big))]
+ raise(UnRegisteredTypeError, "#{name}, do you need to specify endian?")
+ else
+ raise(UnRegisteredTypeError, name)
+ end
+ end
+
+ # Convert CamelCase +name+ to underscore style.
+ def underscore_name(name)
+ name.
+ to_s.
+ sub(/.*::/, "").
+ gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
+ gsub(/([a-z\d])([A-Z])/, '\1_\2').
+ tr("-", "_").
+ downcase
+ end
+
+ #---------------
+ private
+
+ def normalize_name(name, hints)
+ name = underscore_name(name)
+
+ if !registered?(name)
+ search_prefix = [""].concat(Array(hints[:search_prefix]))
+ search_prefix.each do |prefix|
+ nwp = name_with_prefix(name, prefix)
+ if registered?(nwp)
+ name = nwp
+ break
+ end
+
+ nwe = name_with_endian(nwp, hints[:endian])
+ if registered?(nwe)
+ name = nwe
+ break
+ end
+ end
+ end
+
+ name
+ end
+
+ def name_with_prefix(name, prefix)
+ prefix = prefix.to_s.chomp("_")
+ if prefix == ""
+ name
+ else
+ "#{prefix}_#{name}"
+ end
+ end
+
+ def name_with_endian(name, endian)
+ return name if endian.nil?
+
+ suffix = (endian == :little) ? "le" : "be"
+ if /^u?int\d+$/ =~ name
+ name + suffix
+ else
+ name + "_" + suffix
+ end
+ end
+
+ def registered?(name)
+ register_dynamic_class(name) unless @registry.key?(name)
+
+ @registry.key?(name)
+ end
+
+ def register_dynamic_class(name)
+ if /^u?int\d+(le|be)$/ =~ name || /^s?bit\d+(le)?$/ =~ name
+ class_name = name.gsub(/(?:^|_)(.)/) { $1.upcase }
+ begin
+ BinData.const_get(class_name)
+ rescue NameError
+ end
+ end
+ end
+
+ def warn_if_name_is_already_registered(name, class_to_register)
+ prev_class = @registry[name]
+ if $VERBOSE && prev_class && prev_class != class_to_register
+ warn "warning: replacing registered class #{prev_class} " \
+ "with #{class_to_register}"
+ end
+ end
+ end
+
+ # A singleton registry of all registered classes.
+ RegisteredClasses = Registry.new
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/rest.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/rest.rb
new file mode 100644
index 0000000000000..cdc104459c568
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/rest.rb
@@ -0,0 +1,34 @@
+require "bindata/base_primitive"
+
+module BinData
+ # Rest will consume the input stream from the current position to the end of
+ # the stream. This will mainly be useful for debugging and developing.
+ #
+ # require 'bindata'
+ #
+ # class A < BinData::Record
+ # string :a, read_length: 5
+ # rest :rest
+ # end
+ #
+ # obj = A.read("abcdefghij")
+ # obj.a #=> "abcde"
+ # obj.rest #=" "fghij"
+ #
+ class Rest < BinData::BasePrimitive
+ #---------------
+ private
+
+ def value_to_binary_string(val)
+ val
+ end
+
+ def read_and_return_value(io)
+ io.read_all_bytes
+ end
+
+ def sensible_default
+ ""
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/sanitize.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/sanitize.rb
new file mode 100644
index 0000000000000..7325b206b0c47
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/sanitize.rb
@@ -0,0 +1,372 @@
+require 'bindata/registry'
+
+module BinData
+
+ # Subclasses of this are sanitized
+ class SanitizedParameter; end
+
+ class SanitizedPrototype < SanitizedParameter
+ def initialize(obj_type, obj_params, hints)
+ raw_hints = hints.dup
+ if raw_hints[:endian].respond_to?(:endian)
+ raw_hints[:endian] = raw_hints[:endian].endian
+ end
+ obj_params ||= {}
+
+ if BinData::Base === obj_type
+ obj_class = obj_type
+ else
+ obj_class = RegisteredClasses.lookup(obj_type, raw_hints)
+ end
+
+ if BinData::Base === obj_class
+ @factory = obj_class
+ else
+ @obj_class = obj_class
+ @obj_params = SanitizedParameters.new(obj_params, @obj_class, hints)
+ end
+ end
+
+ def has_parameter?(param)
+ if defined? @factory
+ @factory.has_parameter?(param)
+ else
+ @obj_params.has_parameter?(param)
+ end
+ end
+
+ def instantiate(value = nil, parent = nil)
+ @factory ||= @obj_class.new(@obj_params)
+
+ @factory.new(value, parent)
+ end
+ end
+ #----------------------------------------------------------------------------
+
+ class SanitizedField < SanitizedParameter
+ def initialize(name, field_type, field_params, hints)
+ @name = name
+ @prototype = SanitizedPrototype.new(field_type, field_params, hints)
+ end
+
+ attr_reader :prototype
+
+ def name_as_sym
+ @name.nil? ? nil : @name.to_sym
+ end
+
+ def name
+ @name
+ end
+
+ def has_parameter?(param)
+ @prototype.has_parameter?(param)
+ end
+
+ def instantiate(value = nil, parent = nil)
+ @prototype.instantiate(value, parent)
+ end
+ end
+ #----------------------------------------------------------------------------
+
+ class SanitizedFields < SanitizedParameter
+ include Enumerable
+
+ def initialize(hints, base_fields = nil)
+ @hints = hints
+ if base_fields
+ @fields = base_fields.raw_fields
+ else
+ @fields = []
+ end
+ end
+
+ def add_field(type, name, params)
+ name = nil if name == ""
+
+ @fields << SanitizedField.new(name, type, params, @hints)
+ end
+
+ def raw_fields
+ @fields.dup
+ end
+
+ def [](idx)
+ @fields[idx]
+ end
+
+ def empty?
+ @fields.empty?
+ end
+
+ def length
+ @fields.length
+ end
+
+ def each(&block)
+ @fields.each(&block)
+ end
+
+ def field_names
+ @fields.collect(&:name_as_sym)
+ end
+
+ def field_name?(name)
+ @fields.detect { |f| f.name_as_sym == name.to_sym }
+ end
+
+ def all_field_names_blank?
+ @fields.all? { |f| f.name.nil? }
+ end
+
+ def no_field_names_blank?
+ @fields.all? { |f| f.name != nil }
+ end
+
+ def any_field_has_parameter?(parameter)
+ @fields.any? { |f| f.has_parameter?(parameter) }
+ end
+ end
+ #----------------------------------------------------------------------------
+
+ class SanitizedChoices < SanitizedParameter
+ def initialize(choices, hints)
+ @choices = {}
+ choices.each_pair do |key, val|
+ if SanitizedParameter === val
+ prototype = val
+ else
+ type, param = val
+ prototype = SanitizedPrototype.new(type, param, hints)
+ end
+
+ if key == :default
+ @choices.default = prototype
+ else
+ @choices[key] = prototype
+ end
+ end
+ end
+
+ def [](key)
+ @choices[key]
+ end
+ end
+ #----------------------------------------------------------------------------
+
+ class SanitizedBigEndian < SanitizedParameter
+ def endian
+ :big
+ end
+ end
+
+ class SanitizedLittleEndian < SanitizedParameter
+ def endian
+ :little
+ end
+ end
+ #----------------------------------------------------------------------------
+
+ # BinData objects are instantiated with parameters to determine their
+ # behaviour. These parameters must be sanitized to ensure their values
+ # are valid. When instantiating many objects with identical parameters,
+ # such as an array of records, there is much duplicated sanitizing.
+ #
+ # The purpose of the sanitizing code is to eliminate the duplicated
+ # validation.
+ #
+ # SanitizedParameters is a hash-like collection of parameters. Its purpose
+ # is to recursively sanitize the parameters of an entire BinData object chain
+ # at a single time.
+ class SanitizedParameters < Hash
+
+ # Memoized constants
+ BIG_ENDIAN = SanitizedBigEndian.new
+ LITTLE_ENDIAN = SanitizedLittleEndian.new
+
+ class << self
+ def sanitize(parameters, the_class)
+ if SanitizedParameters === parameters
+ parameters
+ else
+ SanitizedParameters.new(parameters, the_class, {})
+ end
+ end
+ end
+
+ def initialize(parameters, the_class, hints)
+ parameters.each_pair { |key, value| self[key.to_sym] = value }
+
+ @the_class = the_class
+
+ if hints[:endian]
+ self[:endian] ||= hints[:endian]
+ end
+
+ if hints[:search_prefix] && !hints[:search_prefix].empty?
+ self[:search_prefix] = Array(self[:search_prefix]).concat(Array(hints[:search_prefix]))
+ end
+
+ sanitize!
+ end
+
+ alias_method :has_parameter?, :key?
+
+ def has_at_least_one_of?(*keys)
+ keys.each do |key|
+ return true if has_parameter?(key)
+ end
+
+ false
+ end
+
+ def warn_replacement_parameter(bad_key, suggested_key)
+ if has_parameter?(bad_key)
+ Kernel.warn ":#{bad_key} is not used with #{@the_class}. " \
+ "You probably want to change this to :#{suggested_key}"
+ end
+ end
+
+# def warn_renamed_parameter(old_key, new_key)
+# val = delete(old_key)
+# if val
+# self[new_key] = val
+# Kernel.warn ":#{old_key} has been renamed to :#{new_key} in #{@the_class}. " \
+# "Using :#{old_key} is now deprecated and will be removed in the future"
+# end
+# end
+
+ def must_be_integer(*keys)
+ keys.each do |key|
+ if has_parameter?(key)
+ parameter = self[key]
+ unless Symbol === parameter ||
+ parameter.respond_to?(:arity) ||
+ parameter.respond_to?(:to_int)
+ raise ArgumentError, "parameter '#{key}' in #{@the_class} must " \
+ "evaluate to an integer, got #{parameter.class}"
+ end
+ end
+ end
+ end
+
+ def rename_parameter(old_key, new_key)
+ if has_parameter?(old_key)
+ self[new_key] = delete(old_key)
+ end
+ end
+
+ def sanitize_object_prototype(key)
+ sanitize(key) { |obj_type, obj_params| create_sanitized_object_prototype(obj_type, obj_params) }
+ end
+
+ def sanitize_fields(key, &block)
+ sanitize(key) do |fields|
+ sanitized_fields = create_sanitized_fields
+ yield(fields, sanitized_fields)
+ sanitized_fields
+ end
+ end
+
+ def sanitize_choices(key, &block)
+ sanitize(key) do |obj|
+ create_sanitized_choices(yield(obj))
+ end
+ end
+
+ def sanitize_endian(key)
+ sanitize(key) { |endian| create_sanitized_endian(endian) }
+ end
+
+ def sanitize(key, &block)
+ if needs_sanitizing?(key)
+ self[key] = yield(self[key])
+ end
+ end
+
+ def create_sanitized_params(params, the_class)
+ SanitizedParameters.new(params, the_class, hints)
+ end
+
+ def hints
+ { endian: self[:endian], search_prefix: self[:search_prefix] }
+ end
+
+ #---------------
+ private
+
+ def sanitize!
+ ensure_no_nil_values
+ merge_default_parameters!
+
+ @the_class.arg_processor.sanitize_parameters!(@the_class, self)
+
+ ensure_mandatory_parameters_exist
+ ensure_mutual_exclusion_of_parameters
+ end
+
+ def needs_sanitizing?(key)
+ has_key?(key) && ! self[key].is_a?(SanitizedParameter)
+ end
+
+ def ensure_no_nil_values
+ each do |key, value|
+ if value.nil?
+ raise ArgumentError,
+ "parameter '#{key}' has nil value in #{@the_class}"
+ end
+ end
+ end
+
+ def merge_default_parameters!
+ @the_class.default_parameters.each do |key, value|
+ self[key] = value unless has_key?(key)
+ end
+ end
+
+ def ensure_mandatory_parameters_exist
+ @the_class.mandatory_parameters.each do |key|
+ unless has_parameter?(key)
+ raise ArgumentError,
+ "parameter '#{key}' must be specified in #{@the_class}"
+ end
+ end
+ end
+
+ def ensure_mutual_exclusion_of_parameters
+ return if length < 2
+
+ @the_class.mutually_exclusive_parameters.each do |key1, key2|
+ if has_parameter?(key1) && has_parameter?(key2)
+ raise ArgumentError, "params '#{key1}' and '#{key2}' " \
+ "are mutually exclusive in #{@the_class}"
+ end
+ end
+ end
+
+ def create_sanitized_endian(endian)
+ if endian == :big
+ BIG_ENDIAN
+ elsif endian == :little
+ LITTLE_ENDIAN
+ elsif endian == :big_and_little
+ raise ArgumentError, "endian: :big or endian: :little is required"
+ else
+ raise ArgumentError, "unknown value for endian '#{endian}'"
+ end
+ end
+
+ def create_sanitized_choices(choices)
+ SanitizedChoices.new(choices, hints)
+ end
+
+ def create_sanitized_fields
+ SanitizedFields.new(hints)
+ end
+
+ def create_sanitized_object_prototype(obj_type, obj_params)
+ SanitizedPrototype.new(obj_type, obj_params, hints)
+ end
+ end
+ #----------------------------------------------------------------------------
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/skip.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/skip.rb
new file mode 100644
index 0000000000000..40d4fe940af67
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/skip.rb
@@ -0,0 +1,133 @@
+require "bindata/base_primitive"
+
+module BinData
+ # Skip will skip over bytes from the input stream. If the stream is not
+ # seekable, then the bytes are consumed and discarded.
+ #
+ # When writing, skip will write the appropriate number of zero bytes.
+ #
+ # require 'bindata'
+ #
+ # class A < BinData::Record
+ # skip length: 5
+ # string :a, read_length: 5
+ # end
+ #
+ # obj = A.read("abcdefghij")
+ # obj.a #=> "fghij"
+ #
+ #
+ # class B < BinData::Record
+ # skip until_valid: [:string, {read_length: 2, assert: "ef"} ]
+ # string :b, read_length: 5
+ # end
+ #
+ # obj = B.read("abcdefghij")
+ # obj.b #=> "efghi"
+ #
+ #
+ # == Parameters
+ #
+ # Skip objects accept all the params that BinData::BasePrimitive
+ # does, as well as the following:
+ #
+ # :length:: The number of bytes to skip.
+ # :to_abs_offset:: Skips to the given absolute offset.
+ # :until_valid:: Skips untils a given byte pattern is matched.
+ # This parameter contains a type that will raise
+ # a BinData::ValidityError unless an acceptable byte
+ # sequence is found. The type is represented by a
+ # Symbol, or if the type is to have params #
+ # passed to it, then it should be provided as #
+ # [type_symbol, hash_params].
+ #
+ class Skip < BinData::BasePrimitive
+ arg_processor :skip
+
+ optional_parameters :length, :to_abs_offset, :until_valid
+ mutually_exclusive_parameters :length, :to_abs_offset, :until_valid
+
+ def initialize_shared_instance
+ extend SkipLengthPlugin if has_parameter?(:length)
+ extend SkipToAbsOffsetPlugin if has_parameter?(:to_abs_offset)
+ extend SkipUntilValidPlugin if has_parameter?(:until_valid)
+ super
+ end
+
+ #---------------
+ private
+
+ def value_to_binary_string(val)
+ len = skip_length
+ if len < 0
+ raise ValidityError, "#{debug_name} attempted to seek backwards by #{len.abs} bytes"
+ end
+
+ "\000" * skip_length
+ end
+
+ def read_and_return_value(io)
+ len = skip_length
+ if len < 0
+ raise ValidityError, "#{debug_name} attempted to seek backwards by #{len.abs} bytes"
+ end
+
+ io.seekbytes(len)
+ ""
+ end
+
+ def sensible_default
+ ""
+ end
+ end
+
+ class SkipArgProcessor < BaseArgProcessor
+ def sanitize_parameters!(obj_class, params)
+ unless params.has_at_least_one_of?(:length, :to_abs_offset, :until_valid)
+ raise ArgumentError,
+ "#{obj_class} requires either :length, :to_abs_offset or :until_valid"
+ end
+ params.must_be_integer(:to_abs_offset, :length)
+ params.sanitize_object_prototype(:until_valid)
+ end
+ end
+
+ # Logic for the :length parameter
+ module SkipLengthPlugin
+ def skip_length
+ eval_parameter(:length)
+ end
+ end
+
+ # Logic for the :to_abs_offset parameter
+ module SkipToAbsOffsetPlugin
+ def skip_length
+ eval_parameter(:to_abs_offset) - abs_offset
+ end
+ end
+
+ # Logic for the :until_valid parameter
+ module SkipUntilValidPlugin
+ def skip_length
+ # no skipping when writing
+ 0
+ end
+
+ def read_and_return_value(io)
+ prototype = get_parameter(:until_valid)
+ validator = prototype.instantiate(nil, self)
+
+ valid = false
+ until valid
+ begin
+ io.with_readahead do
+ validator.read(io)
+ valid = true
+ end
+ rescue ValidityError
+ io.readbytes(1)
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/string.rb
new file mode 100644
index 0000000000000..cf744ae2dfad3
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/string.rb
@@ -0,0 +1,153 @@
+require "bindata/base_primitive"
+
+module BinData
+ # A String is a sequence of bytes. This is the same as strings in Ruby 1.8.
+ # The issue of character encoding is ignored by this class.
+ #
+ # require 'bindata'
+ #
+ # data = "abcdefghij"
+ #
+ # obj = BinData::String.new(read_length: 5)
+ # obj.read(data)
+ # obj #=> "abcde"
+ #
+ # obj = BinData::String.new(length: 6)
+ # obj.read(data)
+ # obj #=> "abcdef"
+ # obj.assign("abcdefghij")
+ # obj #=> "abcdef"
+ # obj.assign("abcd")
+ # obj #=> "abcd\000\000"
+ #
+ # obj = BinData::String.new(length: 6, trim_padding: true)
+ # obj.assign("abcd")
+ # obj #=> "abcd"
+ # obj.to_binary_s #=> "abcd\000\000"
+ #
+ # obj = BinData::String.new(length: 6, pad_byte: 'A')
+ # obj.assign("abcd")
+ # obj #=> "abcdAA"
+ # obj.to_binary_s #=> "abcdAA"
+ #
+ # == Parameters
+ #
+ # String objects accept all the params that BinData::BasePrimitive
+ # does, as well as the following:
+ #
+ # :read_length:: The length in bytes to use when reading a value.
+ # :length:: The fixed length of the string. If a shorter
+ # string is set, it will be padded to this length.
+ # :pad_byte:: The byte to use when padding a string to a
+ # set length. Valid values are Integers and
+ # Strings of length 1. "\0" is the default.
+ # :pad_front:: Signifies that the padding occurs at the front
+ # of the string rather than the end. Default
+ # is false.
+ # :trim_padding:: Boolean, default false. If set, #value will
+ # return the value with all pad_bytes trimmed
+ # from the end of the string. The value will
+ # not be trimmed when writing.
+ class String < BinData::BasePrimitive
+ arg_processor :string
+
+ optional_parameters :read_length, :length, :trim_padding, :pad_front, :pad_left
+ default_parameters pad_byte: "\0"
+ mutually_exclusive_parameters :read_length, :length
+ mutually_exclusive_parameters :length, :value
+
+ def initialize_shared_instance
+ if (has_parameter?(:value) || has_parameter?(:asserted_value)) &&
+ !has_parameter?(:read_length)
+ extend WarnNoReadLengthPlugin
+ end
+ super
+ end
+
+ def assign(val)
+ super(binary_string(val))
+ end
+
+ def snapshot
+ # override to trim padding
+ snap = super
+ snap = clamp_to_length(snap)
+
+ if get_parameter(:trim_padding)
+ trim_padding(snap)
+ else
+ snap
+ end
+ end
+
+ #---------------
+ private
+
+ def clamp_to_length(str)
+ str = binary_string(str)
+
+ len = eval_parameter(:length) || str.length
+ if str.length == len
+ str
+ elsif str.length > len
+ str.slice(0, len)
+ else
+ padding = (eval_parameter(:pad_byte) * (len - str.length))
+ if get_parameter(:pad_front)
+ padding + str
+ else
+ str + padding
+ end
+ end
+ end
+
+ def trim_padding(str)
+ if get_parameter(:pad_front)
+ str.sub(/\A#{eval_parameter(:pad_byte)}*/, "")
+ else
+ str.sub(/#{eval_parameter(:pad_byte)}*\z/, "")
+ end
+ end
+
+ def value_to_binary_string(val)
+ clamp_to_length(val)
+ end
+
+ def read_and_return_value(io)
+ len = eval_parameter(:read_length) || eval_parameter(:length) || 0
+ io.readbytes(len)
+ end
+
+ def sensible_default
+ ""
+ end
+ end
+
+ class StringArgProcessor < BaseArgProcessor
+ def sanitize_parameters!(obj_class, params)
+ params.warn_replacement_parameter(:initial_length, :read_length)
+ params.must_be_integer(:read_length, :length)
+ params.rename_parameter(:pad_left, :pad_front)
+ params.sanitize(:pad_byte) { |byte| sanitized_pad_byte(byte) }
+ end
+
+ #-------------
+ private
+
+ def sanitized_pad_byte(byte)
+ pad_byte = byte.is_a?(Integer) ? byte.chr : byte.to_s
+ if pad_byte.bytesize > 1
+ raise ArgumentError, ":pad_byte must not contain more than 1 byte"
+ end
+ pad_byte
+ end
+ end
+
+ # Warns when reading if :value && no :read_length
+ module WarnNoReadLengthPlugin
+ def read_and_return_value(io)
+ warn "#{debug_name} does not have a :read_length parameter - returning empty string"
+ ""
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/stringz.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/stringz.rb
new file mode 100644
index 0000000000000..74e8814f9b290
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/stringz.rb
@@ -0,0 +1,96 @@
+require "bindata/base_primitive"
+
+module BinData
+ # A BinData::Stringz object is a container for a zero ("\0") terminated
+ # string.
+ #
+ # For convenience, the zero terminator is not necessary when setting the
+ # value. Likewise, the returned value will not be zero terminated.
+ #
+ # require 'bindata'
+ #
+ # data = "abcd\x00efgh"
+ #
+ # obj = BinData::Stringz.new
+ # obj.read(data)
+ # obj.snapshot #=> "abcd"
+ # obj.num_bytes #=> 5
+ # obj.to_binary_s #=> "abcd\000"
+ #
+ # == Parameters
+ #
+ # Stringz objects accept all the params that BinData::BasePrimitive
+ # does, as well as the following:
+ #
+ # :max_length:: The maximum length of the string including the zero
+ # byte.
+ class Stringz < BinData::BasePrimitive
+
+ optional_parameters :max_length
+
+ def assign(val)
+ super(binary_string(val))
+ end
+
+ def snapshot
+ # override to always remove trailing zero bytes
+ result = super
+ trim_and_zero_terminate(result).chomp("\0")
+ end
+
+ #---------------
+ private
+
+ def value_to_binary_string(val)
+ trim_and_zero_terminate(val)
+ end
+
+ def read_and_return_value(io)
+ max_length = eval_parameter(:max_length)
+ str = ""
+ i = 0
+ ch = nil
+
+ # read until zero byte or we have read in the max number of bytes
+ while ch != "\0" && i != max_length
+ ch = io.readbytes(1)
+ str << ch
+ i += 1
+ end
+
+ trim_and_zero_terminate(str)
+ end
+
+ def sensible_default
+ ""
+ end
+
+ def trim_and_zero_terminate(str)
+ result = binary_string(str)
+ truncate_after_first_zero_byte!(result)
+ trim_to!(result, eval_parameter(:max_length))
+ append_zero_byte_if_needed!(result)
+ result
+ end
+
+ def truncate_after_first_zero_byte!(str)
+ str.sub!(/([^\0]*\0).*/, '\1')
+ end
+
+ def trim_to!(str, max_length = nil)
+ if max_length
+ max_length = 1 if max_length < 1
+ str.slice!(max_length)
+ if str.length == max_length && str[-1, 1] != "\0"
+ str[-1, 1] = "\0"
+ end
+ end
+ end
+
+ def append_zero_byte_if_needed!(str)
+ if str.length == 0 || str[-1, 1] != "\0"
+ str << "\0"
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/struct.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/struct.rb
new file mode 100644
index 0000000000000..a34ec85701920
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/struct.rb
@@ -0,0 +1,415 @@
+require 'bindata/base'
+
+module BinData
+
+ class Base
+ optional_parameter :onlyif, :byte_align # Used by Struct
+ end
+
+ # A Struct is an ordered collection of named data objects.
+ #
+ # require 'bindata'
+ #
+ # class Tuple < BinData::Record
+ # int8 :x
+ # int8 :y
+ # int8 :z
+ # end
+ #
+ # obj = BinData::Struct.new(hide: :a,
+ # fields: [ [:int32le, :a],
+ # [:int16le, :b],
+ # [:tuple, :s] ])
+ # obj.field_names =># [:b, :s]
+ #
+ #
+ # == Parameters
+ #
+ # Parameters may be provided at initialisation to control the behaviour of
+ # an object. These params are:
+ #
+ # :fields:: An array specifying the fields for this struct.
+ # Each element of the array is of the form [type, name,
+ # params]. Type is a symbol representing a registered
+ # type. Name is the name of this field. Params is an
+ # optional hash of parameters to pass to this field
+ # when instantiating it. If name is "" or nil, then
+ # that field is anonymous and behaves as a hidden field.
+ # :hide:: A list of the names of fields that are to be hidden
+ # from the outside world. Hidden fields don't appear
+ # in #snapshot or #field_names but are still accessible
+ # by name.
+ # :endian:: Either :little or :big. This specifies the default
+ # endian of any numerics in this struct, or in any
+ # nested data objects.
+ # :search_prefix:: Allows abbreviated type names. If a type is
+ # unrecognised, then each prefix is applied until
+ # a match is found.
+ #
+ # == Field Parameters
+ #
+ # Fields may have have extra parameters as listed below:
+ #
+ # [:onlyif] Used to indicate a data object is optional.
+ # if +false+, this object will not be included in any
+ # calls to #read, #write, #num_bytes or #snapshot.
+ # [:byte_align] This field's rel_offset must be a multiple of
+ # :byte_align.
+ class Struct < BinData::Base
+ arg_processor :struct
+
+ mandatory_parameter :fields
+ optional_parameters :endian, :search_prefix, :hide
+
+ # These reserved words may not be used as field names
+ RESERVED =
+ Hash[*
+ (Hash.instance_methods +
+ %w{alias and begin break case class def defined do else elsif
+ end ensure false for if in module next nil not or redo
+ rescue retry return self super then true undef unless until
+ when while yield} +
+ %w{array element index value} +
+ %w{type initial_length read_until} +
+ %w{fields endian search_prefix hide only_if byte_align} +
+ %w{choices selection copy_on_change} +
+ %w{read_abs_offset struct_params}).collect(&:to_sym).
+ uniq.collect { |key| [key, true] }.flatten
+ ]
+
+ def initialize_shared_instance
+ fields = get_parameter(:fields)
+ @field_names = fields.field_names.freeze
+ extend ByteAlignPlugin if fields.any_field_has_parameter?(:byte_align)
+ define_field_accessors
+ super
+ end
+
+ def initialize_instance
+ @field_objs = []
+ end
+
+ def clear #:nodoc:
+ @field_objs.each { |f| f.clear unless f.nil? }
+ end
+
+ def clear? #:nodoc:
+ @field_objs.all? { |f| f.nil? || f.clear? }
+ end
+
+ def assign(val)
+ clear
+ assign_fields(val)
+ end
+
+ def snapshot
+ snapshot = Snapshot.new
+ field_names.each do |name|
+ obj = find_obj_for_name(name)
+ snapshot[name] = obj.snapshot if include_obj?(obj)
+ end
+ snapshot
+ end
+
+ # Returns a list of the names of all fields accessible through this
+ # object. +include_hidden+ specifies whether to include hidden names
+ # in the listing.
+ def field_names(include_hidden = false)
+ if include_hidden
+ @field_names.compact
+ else
+ hidden = get_parameter(:hide) || []
+ @field_names.compact - hidden
+ end
+ end
+
+ def debug_name_of(child) #:nodoc:
+ field_name = @field_names[find_index_of(child)]
+ "#{debug_name}.#{field_name}"
+ end
+
+ def offset_of(child) #:nodoc:
+ instantiate_all_objs
+ sum = sum_num_bytes_below_index(find_index_of(child))
+ child.bit_aligned? ? sum.floor : sum.ceil
+ end
+
+ def do_read(io) #:nodoc:
+ instantiate_all_objs
+ @field_objs.each { |f| f.do_read(io) if include_obj?(f) }
+ end
+
+ def do_write(io) #:nodoc
+ instantiate_all_objs
+ @field_objs.each { |f| f.do_write(io) if include_obj?(f) }
+ end
+
+ def do_num_bytes #:nodoc:
+ instantiate_all_objs
+ sum_num_bytes_for_all_fields
+ end
+
+ def [](key)
+ find_obj_for_name(key)
+ end
+
+ def []=(key, value)
+ obj = find_obj_for_name(key)
+ if obj
+ obj.assign(value)
+ end
+ end
+
+ def key?(key)
+ @field_names.index(base_field_name(key))
+ end
+
+ def each_pair
+ @field_names.compact.each do |name|
+ yield [name, find_obj_for_name(name)]
+ end
+ end
+
+ #---------------
+ private
+
+ def define_field_accessors
+ get_parameter(:fields).each_with_index do |field, i|
+ name = field.name_as_sym
+ define_field_accessors_for(name, i) if name
+ end
+ end
+
+ def define_field_accessors_for(name, index)
+ define_singleton_method(name) do
+ instantiate_obj_at(index) if @field_objs[index].nil?
+ @field_objs[index]
+ end
+ define_singleton_method("#{name}=") do |*vals|
+ instantiate_obj_at(index) if @field_objs[index].nil?
+ @field_objs[index].assign(*vals)
+ end
+ define_singleton_method("#{name}?") do
+ instantiate_obj_at(index) if @field_objs[index].nil?
+ include_obj?(@field_objs[index])
+ end
+ end
+
+ def find_index_of(obj)
+ @field_objs.index { |el| el.equal?(obj) }
+ end
+
+ def find_obj_for_name(name)
+ index = @field_names.index(base_field_name(name))
+ if index
+ instantiate_obj_at(index)
+ @field_objs[index]
+ else
+ nil
+ end
+ end
+
+ def base_field_name(name)
+ name.to_s.sub(/(=|\?)\z/, "").to_sym
+ end
+
+ def instantiate_all_objs
+ @field_names.each_index { |i| instantiate_obj_at(i) }
+ end
+
+ def instantiate_obj_at(index)
+ if @field_objs[index].nil?
+ field = get_parameter(:fields)[index]
+ @field_objs[index] = field.instantiate(nil, self)
+ end
+ end
+
+ def assign_fields(val)
+ src = as_stringified_hash(val)
+
+ @field_names.compact.each do |name|
+ obj = find_obj_for_name(name)
+ if obj && src.key?(name)
+ obj.assign(src[name])
+ end
+ end
+ end
+
+ def as_stringified_hash(val)
+ if BinData::Struct === val
+ val
+ elsif val.nil?
+ {}
+ else
+ hash = Snapshot.new
+ val.each_pair { |k,v| hash[k] = v }
+ hash
+ end
+ end
+
+ def sum_num_bytes_for_all_fields
+ sum_num_bytes_below_index(@field_objs.length)
+ end
+
+ def sum_num_bytes_below_index(index)
+ (0...index).inject(0) do |sum, i|
+ obj = @field_objs[i]
+ if include_obj?(obj)
+ nbytes = obj.do_num_bytes
+ (nbytes.is_a?(Integer) ? sum.ceil : sum) + nbytes
+ else
+ sum
+ end
+ end
+ end
+
+ def include_obj?(obj)
+ !obj.has_parameter?(:onlyif) || obj.eval_parameter(:onlyif)
+ end
+
+ # A hash that can be accessed via attributes.
+ class Snapshot < ::Hash #:nodoc:
+ def []=(key, value)
+ super unless value.nil?
+ end
+
+ def respond_to?(symbol, include_private = false)
+ key?(symbol) || super
+ end
+
+ def method_missing(symbol, *args)
+ key?(symbol) ? self[symbol] : super
+ end
+ end
+ end
+
+ # Align fields to a multiple of :byte_align
+ module ByteAlignPlugin
+ def do_read(io)
+ initial_offset = io.offset
+ instantiate_all_objs
+ @field_objs.each do |f|
+ if include_obj?(f)
+ if align_obj?(f)
+ io.seekbytes(bytes_to_align(f, io.offset - initial_offset))
+ end
+ f.do_read(io)
+ end
+ end
+ end
+
+ def do_write(io)
+ initial_offset = io.offset
+ instantiate_all_objs
+ @field_objs.each do |f|
+ if include_obj?(f)
+ if align_obj?(f)
+ io.writebytes("\x00" * bytes_to_align(f, io.offset - initial_offset))
+ end
+ f.do_write(io)
+ end
+ end
+ end
+
+ def sum_num_bytes_below_index(index)
+ sum = 0
+ (0...@field_objs.length).each do |i|
+ obj = @field_objs[i]
+ if include_obj?(obj)
+ sum = sum.ceil + bytes_to_align(obj, sum.ceil) if align_obj?(obj)
+
+ break if i >= index
+
+ nbytes = obj.do_num_bytes
+ sum = (nbytes.is_a?(Integer) ? sum.ceil : sum) + nbytes
+ end
+ end
+
+ sum
+ end
+
+ def bytes_to_align(obj, rel_offset)
+ align = obj.eval_parameter(:byte_align)
+ (align - (rel_offset % align)) % align
+ end
+
+ def align_obj?(obj)
+ obj.has_parameter?(:byte_align)
+ end
+ end
+
+ class StructArgProcessor < BaseArgProcessor
+ def sanitize_parameters!(obj_class, params)
+ sanitize_endian(params)
+ sanitize_search_prefix(params)
+ sanitize_fields(obj_class, params)
+ sanitize_hide(params)
+ end
+
+ #-------------
+ private
+
+ def sanitize_endian(params)
+ params.sanitize_endian(:endian)
+ end
+
+ def sanitize_search_prefix(params)
+ params.sanitize(:search_prefix) do |sprefix|
+ search_prefix = []
+ Array(sprefix).each do |prefix|
+ prefix = prefix.to_s.chomp("_")
+ search_prefix << prefix if prefix != ""
+ end
+
+ search_prefix
+ end
+ end
+
+ def sanitize_fields(obj_class, params)
+ params.sanitize_fields(:fields) do |fields, sanitized_fields|
+ fields.each do |ftype, fname, fparams|
+ sanitized_fields.add_field(ftype, fname, fparams)
+ end
+
+ field_names = sanitized_field_names(sanitized_fields)
+ ensure_field_names_are_valid(obj_class, field_names)
+ end
+ end
+
+ def sanitize_hide(params)
+ params.sanitize(:hide) do |hidden|
+ field_names = sanitized_field_names(params[:fields])
+ hfield_names = hidden_field_names(hidden)
+
+ hfield_names & field_names
+ end
+ end
+
+ def sanitized_field_names(sanitized_fields)
+ sanitized_fields.field_names.compact
+ end
+
+ def hidden_field_names(hidden)
+ (hidden || []).collect(&:to_sym)
+ end
+
+ def ensure_field_names_are_valid(obj_class, field_names)
+ reserved_names = BinData::Struct::RESERVED
+
+ field_names.each do |name|
+ if obj_class.method_defined?(name)
+ raise NameError.new("Rename field '#{name}' in #{obj_class}, " \
+ "as it shadows an existing method.", name)
+ end
+ if reserved_names.include?(name)
+ raise NameError.new("Rename field '#{name}' in #{obj_class}, " \
+ "as it is a reserved name.", name)
+ end
+ if field_names.count(name) != 1
+ raise NameError.new("field '#{name}' in #{obj_class}, " \
+ "is defined multiple times.", name)
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/trace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/trace.rb
new file mode 100644
index 0000000000000..4e4f9ba59c477
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/trace.rb
@@ -0,0 +1,95 @@
+module BinData
+ # reference to the current tracer
+ @tracer ||= nil
+
+ class Tracer #:nodoc:
+ def initialize(io)
+ @trace_io = io
+ end
+
+ def trace(msg)
+ @trace_io.puts(msg)
+ end
+
+ def trace_obj(obj_name, val)
+ if val.length > 30
+ val = val.slice(0..30) + "..."
+ end
+
+ trace "#{obj_name} => #{val}"
+ end
+ end
+
+ # Turn on trace information when reading a BinData object.
+ # If +block+ is given then the tracing only occurs for that block.
+ # This is useful for debugging a BinData declaration.
+ def trace_reading(io = STDERR)
+ @tracer = Tracer.new(io)
+ [BasePrimitive, Choice].each(&:turn_on_tracing)
+
+ if block_given?
+ begin
+ yield
+ ensure
+ [BasePrimitive, Choice].each(&:turn_off_tracing)
+ @tracer = nil
+ end
+ end
+ end
+
+ def trace_message #:nodoc:
+ yield @tracer if @tracer
+ end
+
+ module_function :trace_reading, :trace_message
+
+ class BasePrimitive < BinData::Base
+ class << self
+ def turn_on_tracing
+ alias_method :do_read_without_hook, :do_read
+ alias_method :do_read, :do_read_with_hook
+ end
+
+ def turn_off_tracing
+ alias_method :do_read, :do_read_without_hook
+ end
+ end
+
+ def do_read_with_hook(io)
+ do_read_without_hook(io)
+ trace_value
+ end
+
+ def trace_value
+ BinData.trace_message do |tracer|
+ value_string = _value.inspect
+ tracer.trace_obj(debug_name, value_string)
+ end
+ end
+ end
+
+ class Choice < BinData::Base
+ class << self
+ def turn_on_tracing
+ alias_method :do_read_without_hook, :do_read
+ alias_method :do_read, :do_read_with_hook
+ end
+
+ def turn_off_tracing
+ alias_method :do_read, :do_read_without_hook
+ end
+ end
+
+ def do_read_with_hook(io)
+ trace_selection
+ do_read_without_hook(io)
+ end
+
+ def trace_selection
+ BinData.trace_message do |tracer|
+ selection_string = eval_parameter(:selection).inspect
+ tracer.trace_obj("#{debug_name}-selection-", selection_string)
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/uint8_array.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/uint8_array.rb
new file mode 100644
index 0000000000000..72816611e8eeb
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/uint8_array.rb
@@ -0,0 +1,62 @@
+require "bindata/base_primitive"
+
+module BinData
+ # Uint8Array is a specialised type of array that only contains
+ # bytes (Uint8). It is a faster and more memory efficient version
+ # of `BinData::Array.new(:type => :uint8)`.
+ #
+ # require 'bindata'
+ #
+ # obj = BinData::Uint8Array.new(initial_length: 5)
+ # obj.read("abcdefg") #=> [97, 98, 99, 100, 101]
+ # obj[2] #=> 99
+ # obj.collect { |x| x.chr }.join #=> "abcde"
+ #
+ # == Parameters
+ #
+ # Parameters may be provided at initialisation to control the behaviour of
+ # an object. These params are:
+ #
+ # :initial_length:: The initial length of the array.
+ # :read_until:: May only have a value of `:eof`. This parameter
+ # instructs the array to read as much data from
+ # the stream as possible.
+ class Uint8Array < BinData::BasePrimitive
+ optional_parameters :initial_length, :read_until
+ mutually_exclusive_parameters :initial_length, :read_until
+ arg_processor :uint8_array
+
+ #---------------
+ private
+
+ def value_to_binary_string(val)
+ val.pack("C*")
+ end
+
+ def read_and_return_value(io)
+ if has_parameter?(:initial_length)
+ data = io.readbytes(eval_parameter(:initial_length))
+ else
+ data = io.read_all_bytes
+ end
+
+ data.unpack("C*")
+ end
+
+ def sensible_default
+ []
+ end
+ end
+
+ class Uint8ArrayArgProcessor < BaseArgProcessor
+ def sanitize_parameters!(obj_class, params) #:nodoc:
+ # ensure one of :initial_length and :read_until exists
+ unless params.has_at_least_one_of?(:initial_length, :read_until)
+ params[:initial_length] = 0
+ end
+
+ msg = "Parameter :read_until must have a value of :eof"
+ params.sanitize(:read_until) { |val| raise ArgumentError, msg unless val == :eof }
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/version.rb
new file mode 100644
index 0000000000000..0a79a6ac62b29
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/version.rb
@@ -0,0 +1,3 @@
+module BinData
+ VERSION = "2.4.4"
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/virtual.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/virtual.rb
new file mode 100644
index 0000000000000..1a7205f74bf83
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/virtual.rb
@@ -0,0 +1,47 @@
+require "bindata/base"
+
+module BinData
+ # A virtual field is one that is neither read, written nor occupies space in
+ # the data stream. It is used to make assertions or as a convenient label
+ # for determining offsets or storing values.
+ #
+ # require 'bindata'
+ #
+ # class A < BinData::Record
+ # string :a, read_length: 5
+ # string :b, read_length: 5
+ # virtual :c, assert: -> { a == b }
+ # end
+ #
+ # obj = A.read("abcdeabcde")
+ # obj.a #=> "abcde"
+ # obj.c.offset #=> 10
+ #
+ # obj = A.read("abcdeABCDE") #=> BinData::ValidityError: assertion failed for obj.c
+ #
+ # == Parameters
+ #
+ # Parameters may be provided at initialisation to control the behaviour of
+ # an object. These params include those for BinData::Base as well as:
+ #
+ # [:assert] Raise an error when reading or assigning if the value
+ # of this evaluated parameter is false.
+ # [:value] The virtual object will always have this value.
+ #
+ class Virtual < BinData::BasePrimitive
+
+ def do_read(io)
+ end
+
+ def do_write(io)
+ end
+
+ def do_num_bytes
+ 0.0
+ end
+
+ def sensible_default
+ nil
+ end
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/warnings.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/warnings.rb
new file mode 100644
index 0000000000000..3d1cfe728be72
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.4/lib/bindata/warnings.rb
@@ -0,0 +1,36 @@
+module BinData
+ class Base
+ # Don't override initialize. If you are defining a new kind of datatype
+ # (list, array, choice etc) then put your initialization code in
+ # #initialize_instance. BinData objects might be initialized as prototypes
+ # and your initialization code may not be called.
+ #
+ # If you're subclassing BinData::Record, you are definitely doing the wrong
+ # thing. Read the documentation on how to use BinData.
+ # http://github.com/dmendel/bindata/wiki/Records
+ alias_method :initialize_without_warning, :initialize
+ def initialize_with_warning(*args)
+ owner = method(:initialize).owner
+ if owner != BinData::Base
+ msg = "Don't override #initialize on #{owner}."
+ if %w(BinData::Base BinData::BasePrimitive).include? self.class.superclass.name
+ msg += "\nrename #initialize to #initialize_instance."
+ end
+ fail msg
+ end
+ initialize_without_warning(*args)
+ end
+ alias initialize initialize_with_warning
+
+ def initialize_instance(*args)
+ unless args.empty?
+ fail "#{caller[0]} remove the call to super in #initialize_instance"
+ end
+ end
+ end
+
+ class Struct
+ # has_key? is deprecated
+ alias has_key? key?
+ end
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools.rb
new file mode 100644
index 0000000000000..2b16c7ef8cbcc
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+require 'elftools/constants'
+require 'elftools/elf_file'
+require 'elftools/version'
+
+# The ELF parsing tools!
+# Main entry point is {ELFTools::ELFFile}, see it
+# for more information.
+module ELFTools
+end
diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools/constants.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools/constants.rb
new file mode 100644
index 0000000000000..197ec969d0137
--- /dev/null
+++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.1.2/lib/elftools/constants.rb
@@ -0,0 +1,303 @@
+# frozen_string_literal: true
+
+module ELFTools
+ # Define constants from elf.h.
+ # Mostly refer from https://github.com/torvalds/linux/blob/master/include/uapi/linux/elf.h
+ # and binutils/elfcpp/elfcpp.h.
+ module Constants
+ # ELF magic header
+ ELFMAG = "\x7FELF"
+
+ # Values of `d_un.d_val' in the DT_FLAGS and DT_FLAGS_1 entry.
+ module DF
+ DF_ORIGIN = 0x00000001 # Object may use DF_ORIGIN
+ DF_SYMBOLIC = 0x00000002 # Symbol resolutions starts here
+ DF_TEXTREL = 0x00000004 # Object contains text relocations
+ DF_BIND_NOW = 0x00000008 # No lazy binding for this object
+ DF_STATIC_TLS = 0x00000010 # Module uses the static TLS model
+
+ DF_1_NOW = 0x00000001 # Set RTLD_NOW for this object.
+ DF_1_GLOBAL = 0x00000002 # Set RTLD_GLOBAL for this object.
+ DF_1_GROUP = 0x00000004 # Set RTLD_GROUP for this object.
+ DF_1_NODELETE = 0x00000008 # Set RTLD_NODELETE for this object.
+ DF_1_LOADFLTR = 0x00000010 # Trigger filtee loading at runtime.
+ DF_1_INITFIRST = 0x00000020 # Set RTLD_INITFIRST for this object
+ DF_1_NOOPEN = 0x00000040 # Set RTLD_NOOPEN for this object.
+ DF_1_ORIGIN = 0x00000080 # $ORIGIN must be handled.
+ DF_1_DIRECT = 0x00000100 # Direct binding enabled.
+ DF_1_TRANS = 0x00000200 # :nodoc:
+ DF_1_INTERPOSE = 0x00000400 # Object is used to interpose.
+ DF_1_NODEFLIB = 0x00000800 # Ignore default lib search path.
+ DF_1_NODUMP = 0x00001000 # Object can't be dldump'ed.
+ DF_1_CONFALT = 0x00002000 # Configuration alternative created.
+ DF_1_ENDFILTEE = 0x00004000 # Filtee terminates filters search.
+ DF_1_DISPRELDNE = 0x00008000 # Disp reloc applied at build time.
+ DF_1_DISPRELPND = 0x00010000 # Disp reloc applied at run-time.
+ DF_1_NODIRECT = 0x00020000 # Object has no-direct binding.
+ DF_1_IGNMULDEF = 0x00040000 # :nodoc:
+ DF_1_NOKSYMS = 0x00080000 # :nodoc:
+ DF_1_NOHDR = 0x00100000 # :nodoc:
+ DF_1_EDITED = 0x00200000 # Object is modified after built.
+ DF_1_NORELOC = 0x00400000 # :nodoc:
+ DF_1_SYMINTPOSE = 0x00800000 # Object has individual interposers.
+ DF_1_GLOBAUDIT = 0x01000000 # Global auditing required.
+ DF_1_SINGLETON = 0x02000000 # Singleton symbols are used.
+ end
+ include DF
+
+ # Dynamic table types, records in +d_tag+.
+ module DT
+ DT_NULL = 0 # marks the end of the _DYNAMIC array
+ DT_NEEDED = 1 # libraries need to be linked by loader
+ DT_PLTRELSZ = 2 # total size of relocation entries
+ DT_PLTGOT = 3 # address of procedure linkage table or global offset table
+ DT_HASH = 4 # address of symbol hash table
+ DT_STRTAB = 5 # address of string table
+ DT_SYMTAB = 6 # address of symbol table
+ DT_RELA = 7 # address of a relocation table
+ DT_RELASZ = 8 # total size of the {DT_RELA} table
+ DT_RELAENT = 9 # size of each entry in the {DT_RELA} table
+ DT_STRSZ = 10 # total size of {DT_STRTAB}
+ DT_SYMENT = 11 # size of each entry in {DT_SYMTAB}
+ DT_INIT = 12 # where the initialization function is
+ DT_FINI = 13 # where the termination function is
+ DT_SONAME = 14 # the shared object name
+ DT_RPATH = 15 # has been superseded by {DT_RUNPATH}
+ DT_SYMBOLIC = 16 # has been superseded by the DF_SYMBOLIC flag
+ DT_REL = 17 # similar to {DT_RELA}
+ DT_RELSZ = 18 # total size of the {DT_REL} table
+ DT_RELENT = 19 # size of each entry in the {DT_REL} table
+ DT_PLTREL = 20 # type of relocation entry, either {DT_REL} or {DT_RELA}
+ DT_DEBUG = 21 # for debugging
+ DT_TEXTREL = 22 # has been superseded by the DF_TEXTREL flag
+ DT_JMPREL = 23 # address of relocation entries that are associated solely with the procedure linkage table
+ DT_BIND_NOW = 24 # if the loader needs to do relocate now, superseded by the DF_BIND_NOW flag
+ DT_INIT_ARRAY = 25 # address init array
+ DT_FINI_ARRAY = 26 # address of fini array
+ DT_INIT_ARRAYSZ = 27 # total size of init array
+ DT_FINI_ARRAYSZ = 28 # total size of fini array
+ DT_RUNPATH = 29 # path of libraries for searching
+ DT_FLAGS = 30 # flags
+ DT_ENCODING = 32 # just a lower bound
+ # Values between {DT_LOOS} and {DT_HIOS} are reserved for operating system-specific semantics.
+ DT_LOOS = 0x6000000d
+ DT_HIOS = 0x6ffff000 # see {DT_LOOS}
+ # Values between {DT_VALRNGLO} and {DT_VALRNGHI} use the +d_un.d_val+ field of the dynamic structure.
+ DT_VALRNGLO = 0x6ffffd00
+ DT_VALRNGHI = 0x6ffffdff # see {DT_VALRNGLO}
+ # Values between {DT_ADDRRNGLO} and {DT_ADDRRNGHI} use the +d_un.d_ptr+ field of the dynamic structure.
+ DT_ADDRRNGLO = 0x6ffffe00
+ DT_GNU_HASH = 0x6ffffef5 # the gnu hash
+ DT_ADDRRNGHI = 0x6ffffeff # see {DT_ADDRRNGLO}
+ DT_RELACOUNT = 0x6ffffff9 # relative relocation count
+ DT_RELCOUNT = 0x6ffffffa # relative relocation count
+ DT_FLAGS_1 = 0x6ffffffb # flags
+ DT_VERDEF = 0x6ffffffc # address of version definition table
+ DT_VERDEFNUM = 0x6ffffffd # number of entries in {DT_VERDEF}
+ DT_VERNEED = 0x6ffffffe # address of version dependency table
+ DT_VERNEEDNUM = 0x6fffffff # number of entries in {DT_VERNEED}
+ # Values between {DT_LOPROC} and {DT_HIPROC} are reserved for processor-specific semantics.
+ DT_LOPROC = 0x70000000
+ DT_HIPROC = 0x7fffffff # see {DT_LOPROC}
+ end
+ include DT
+
+ # These constants define the various ELF target machines.
+ module EM
+ EM_NONE = 0 # none
+ EM_M32 = 1 # AT&T WE 32100
+ EM_SPARC = 2 # SPARC
+ EM_386 = 3 # Intel 80386
+ EM_68K = 4 # Motorola 68000
+ EM_88K = 5 # Motorola 88000
+ EM_486 = 6 # Intel 80486
+ EM_860 = 7 # Intel 80860
+ EM_MIPS = 8 # MIPS R3000 (officially, big-endian only)
+
+ # Next two are historical and binaries and
+ # modules of these types will be rejected by Linux.
+ EM_MIPS_RS3_LE = 10 # MIPS R3000 little-endian
+ EM_MIPS_RS4_BE = 10 # MIPS R4000 big-endian
+
+ EM_PARISC = 15 # HPPA
+ EM_SPARC32PLUS = 18 # Sun's "v8plus"
+ EM_PPC = 20 # PowerPC
+ EM_PPC64 = 21 # PowerPC64
+ EM_SPU = 23 # Cell BE SPU
+ EM_ARM = 40 # ARM 32 bit
+ EM_SH = 42 # SuperH
+ EM_SPARCV9 = 43 # SPARC v9 64-bit
+ EM_H8_300 = 46 # Renesas H8/300
+ EM_IA_64 = 50 # HP/Intel IA-64
+ EM_X86_64 = 62 # AMD x86-64
+ EM_S390 = 22 # IBM S/390
+ EM_CRIS = 76 # Axis Communications 32-bit embedded processor
+ EM_M32R = 88 # Renesas M32R
+ EM_MN10300 = 89 # Panasonic/MEI MN10300, AM33
+ EM_OPENRISC = 92 # OpenRISC 32-bit embedded processor
+ EM_BLACKFIN = 106 # ADI Blackfin Processor
+ EM_ALTERA_NIOS2 = 113 # Altera Nios II soft-core processor
+ EM_TI_C6000 = 140 # TI C6X DSPs
+ EM_AARCH64 = 183 # ARM 64 bit
+ EM_TILEPRO = 188 # Tilera TILEPro
+ EM_MICROBLAZE = 189 # Xilinx MicroBlaze
+ EM_TILEGX = 191 # Tilera TILE-Gx
+ EM_BPF = 247 # Linux BPF - in-kernel virtual machine
+ EM_FRV = 0x5441 # Fujitsu FR-V
+ EM_AVR32 = 0x18ad # Atmel AVR32
+
+ # This is an interim value that we will use until the committee comes up with a final number.
+ EM_ALPHA = 0x9026
+
+ # Bogus old m32r magic number, used by old tools.
+ EM_CYGNUS_M32R = 0x9041
+ # This is the old interim value for S/390 architecture
+ EM_S390_OLD = 0xA390
+ # Also Panasonic/MEI MN10300, AM33
+ EM_CYGNUS_MN10300 = 0xbeef
+
+ # Return the architecture name according to +val+.
+ # Used by {ELFTools::ELFFile#machine}.
+ #
+ # Only supports famous archs.
+ # @param [Integer] val Value of +e_machine+.
+ # @return [String]
+ # Name of architecture.
+ # @example
+ # mapping(3)
+ # #=> 'Intel 80386'
+ # mapping(6)
+ # #=> 'Intel 80386'
+ # mapping(62)
+ # #=> 'Advanced Micro Devices X86-64'
+ # mapping(1337)
+ # #=> '