From aef6e2f4a9304dc5709a7f4bc5e86470dd941d36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 13:15:24 +0000 Subject: [PATCH 1/4] build(deps-dev): bump json_schemer from 2.1.1 to 2.2.1 in /Library/Homebrew Dependabot couldn't find the original pull request head commit, 86a9fcf9f24753041c4218c85b6ca8b068473568. --- Library/Homebrew/Gemfile.lock | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 07b7e3765f71e..fbec48bc20bc1 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -4,6 +4,8 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) bindata (2.5.0) bootsnap (1.18.3) msgpack (~> 1.2) @@ -18,7 +20,9 @@ GEM hana (1.3.7) highline (2.0.3) json (2.7.2) - json_schemer (2.1.1) + json_schemer (2.2.1) + base64 + bigdecimal hana (~> 1.3) regexp_parser (~> 2.0) simpleidn (~> 0.2) @@ -158,7 +162,6 @@ GEM PLATFORMS aarch64-linux - arm-linux arm64-darwin x86_64-darwin x86_64-linux From 5302effcdef166b2432e128bacea8f41520fd612 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 23 May 2024 13:23:07 +0000 Subject: [PATCH 2/4] brew vendor-gems: commit updates. --- Library/Homebrew/Gemfile.lock | 1 + .../Homebrew/vendor/bundle/bundler/setup.rb | 5 +- .../ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE | 56 +++++ .../gems/bigdecimal-3.1.8/lib/bigdecimal.rb | 5 + .../lib/bigdecimal/jacobian.rb | 90 +++++++ .../bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb | 89 +++++++ .../bigdecimal-3.1.8/lib/bigdecimal/math.rb | 232 ++++++++++++++++++ .../bigdecimal-3.1.8/lib/bigdecimal/newton.rb | 80 ++++++ .../bigdecimal-3.1.8/lib/bigdecimal/util.rb | 185 ++++++++++++++ 9 files changed, 742 insertions(+), 1 deletion(-) create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index fbec48bc20bc1..ee7bb92b7462c 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -162,6 +162,7 @@ GEM PLATFORMS aarch64-linux + arm-linux arm64-darwin x86_64-darwin x86_64-linux diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 98358d5145e6d..3f25a0bcaf899 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -37,6 +37,9 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-5.0.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.6/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/base64-0.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.1.8") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.1.8/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}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/msgpack-1.7.2") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/msgpack-1.7.2/lib") @@ -54,7 +57,7 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.7.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.9.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simpleidn-0.2.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.1.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.2.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/strscan-3.1.0") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/strscan-3.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rexml-3.2.8/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE new file mode 100644 index 0000000000000..a1f19ff99db14 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE @@ -0,0 +1,56 @@ +Ruby is copyrighted free software by Yukihiro Matsumoto . +You can redistribute it and/or modify it under either the terms of the +2-clause BSDL (see the file BSDL), or the conditions below: + + 1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. + + 2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. + + b) use the modified software only within your corporation or + organization. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 3. You may distribute the software in object code or binary form, + provided that you do at least ONE of the following: + + a) distribute the binaries and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. + + b) accompany the distribution with the machine-readable source of + the software. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 4. You may modify and include the part of the software into any other + software (possibly commercial). But some files in the distribution + are not written by the author, so that they are not under these terms. + + For the list of those files and their copying conditions, see the + file LEGAL. + + 5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. + + 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb new file mode 100644 index 0000000000000..82b3e1b7b9880 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb @@ -0,0 +1,5 @@ +if RUBY_ENGINE == 'jruby' + JRuby::Util.load_ext("org.jruby.ext.bigdecimal.BigDecimalLibrary") +else + require 'bigdecimal.so' +end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb new file mode 100644 index 0000000000000..4448024c74285 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: false + +require 'bigdecimal' + +# require 'bigdecimal/jacobian' +# +# Provides methods to compute the Jacobian matrix of a set of equations at a +# point x. In the methods below: +# +# f is an Object which is used to compute the Jacobian matrix of the equations. +# It must provide the following methods: +# +# f.values(x):: returns the values of all functions at x +# +# f.zero:: returns 0.0 +# f.one:: returns 1.0 +# f.two:: returns 2.0 +# f.ten:: returns 10.0 +# +# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal. +# +# x is the point at which to compute the Jacobian. +# +# fx is f.values(x). +# +module Jacobian + module_function + + # Determines the equality of two numbers by comparing to zero, or using the epsilon value + def isEqual(a,b,zero=0.0,e=1.0e-8) + aa = a.abs + bb = b.abs + if aa == zero && bb == zero then + true + else + if ((a-b)/(aa+bb)).abs < e then + true + else + false + end + end + end + + + # Computes the derivative of +f[i]+ at +x[i]+. + # +fx+ is the value of +f+ at +x+. + def dfdxi(f,fx,x,i) + nRetry = 0 + n = x.size + xSave = x[i] + ok = 0 + ratio = f.ten*f.ten*f.ten + dx = x[i].abs/ratio + dx = fx[i].abs/ratio if isEqual(dx,f.zero,f.zero,f.eps) + dx = f.one/f.ten if isEqual(dx,f.zero,f.zero,f.eps) + until ok>0 do + deriv = [] + nRetry += 1 + if nRetry > 100 + raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]" + end + dx = dx*f.two + x[i] += dx + fxNew = f.values(x) + for j in 0...n do + if !isEqual(fxNew[j],fx[j],f.zero,f.eps) then + ok += 1 + deriv <<= (fxNew[j]-fx[j])/dx + else + deriv <<= f.zero + end + end + x[i] = xSave + end + deriv + end + + # Computes the Jacobian of +f+ at +x+. +fx+ is the value of +f+ at +x+. + def jacobian(f,fx,x) + n = x.size + dfdx = Array.new(n*n) + for i in 0...n do + df = dfdxi(f,fx,x,i) + for j in 0...n do + dfdx[j*n+i] = df[j] + end + end + dfdx + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb new file mode 100644 index 0000000000000..dd265e482a317 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: false +require 'bigdecimal' + +# +# Solves a*x = b for x, using LU decomposition. +# +module LUSolve + module_function + + # Performs LU decomposition of the n by n matrix a. + def ludecomp(a,n,zero=0,one=1) + prec = BigDecimal.limit(nil) + ps = [] + scales = [] + for i in 0...n do # pick up largest(abs. val.) element in each row. + ps <<= i + nrmrow = zero + ixn = i*n + for j in 0...n do + biggst = a[ixn+j].abs + nrmrow = biggst if biggst>nrmrow + end + if nrmrow>zero then + scales <<= one.div(nrmrow,prec) + else + raise "Singular matrix" + end + end + n1 = n - 1 + for k in 0...n1 do # Gaussian elimination with partial pivoting. + biggst = zero; + for i in k...n do + size = a[ps[i]*n+k].abs*scales[ps[i]] + if size>biggst then + biggst = size + pividx = i + end + end + raise "Singular matrix" if biggst<=zero + if pividx!=k then + j = ps[k] + ps[k] = ps[pividx] + ps[pividx] = j + end + pivot = a[ps[k]*n+k] + for i in (k+1)...n do + psin = ps[i]*n + a[psin+k] = mult = a[psin+k].div(pivot,prec) + if mult!=zero then + pskn = ps[k]*n + for j in (k+1)...n do + a[psin+j] -= mult.mult(a[pskn+j],prec) + end + end + end + end + raise "Singular matrix" if a[ps[n1]*n+n1] == zero + ps + end + + # Solves a*x = b for x, using LU decomposition. + # + # a is a matrix, b is a constant vector, x is the solution vector. + # + # ps is the pivot, a vector which indicates the permutation of rows performed + # during LU decomposition. + def lusolve(a,b,ps,zero=0.0) + prec = BigDecimal.limit(nil) + n = ps.size + x = [] + for i in 0...n do + dot = zero + psin = ps[i]*n + for j in 0...i do + dot = a[psin+j].mult(x[j],prec) + dot + end + x <<= b[ps[i]] - dot + end + (n-1).downto(0) do |i| + dot = zero + psin = ps[i]*n + for j in (i+1)...n do + dot = a[psin+j].mult(x[j],prec) + dot + end + x[i] = (x[i]-dot).div(a[psin+i],prec) + end + x + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb new file mode 100644 index 0000000000000..0b9d0648bb3e3 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb @@ -0,0 +1,232 @@ +# frozen_string_literal: false +require 'bigdecimal' + +# +#-- +# Contents: +# sqrt(x, prec) +# sin (x, prec) +# cos (x, prec) +# atan(x, prec) Note: |x|<1, x=0.9999 may not converge. +# PI (prec) +# E (prec) == exp(1.0,prec) +# +# where: +# x ... BigDecimal number to be computed. +# |x| must be small enough to get convergence. +# prec ... Number of digits to be obtained. +#++ +# +# Provides mathematical functions. +# +# Example: +# +# require "bigdecimal/math" +# +# include BigMath +# +# a = BigDecimal((PI(100)/2).to_s) +# puts sin(a,100) # => 0.99999999999999999999......e0 +# +module BigMath + module_function + + # call-seq: + # sqrt(decimal, numeric) -> BigDecimal + # + # Computes the square root of +decimal+ to the specified number of digits of + # precision, +numeric+. + # + # BigMath.sqrt(BigDecimal('2'), 16).to_s + # #=> "0.1414213562373095048801688724e1" + # + def sqrt(x, prec) + x.sqrt(prec) + end + + # call-seq: + # sin(decimal, numeric) -> BigDecimal + # + # Computes the sine of +decimal+ to the specified number of digits of + # precision, +numeric+. + # + # If +decimal+ is Infinity or NaN, returns NaN. + # + # BigMath.sin(BigMath.PI(5)/4, 5).to_s + # #=> "0.70710678118654752440082036563292800375e0" + # + def sin(x, prec) + raise ArgumentError, "Zero or negative precision for sin" if prec <= 0 + return BigDecimal("NaN") if x.infinite? || x.nan? + n = prec + BigDecimal.double_fig + one = BigDecimal("1") + two = BigDecimal("2") + x = -x if neg = x < 0 + if x > (twopi = two * BigMath.PI(prec)) + if x > 30 + x %= twopi + else + x -= twopi while x > twopi + end + end + x1 = x + x2 = x.mult(x,n) + sign = 1 + y = x + d = y + i = one + z = one + while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) + m = BigDecimal.double_fig if m < BigDecimal.double_fig + sign = -sign + x1 = x2.mult(x1,n) + i += two + z *= (i-one) * i + d = sign * x1.div(z,m) + y += d + end + neg ? -y : y + end + + # call-seq: + # cos(decimal, numeric) -> BigDecimal + # + # Computes the cosine of +decimal+ to the specified number of digits of + # precision, +numeric+. + # + # If +decimal+ is Infinity or NaN, returns NaN. + # + # BigMath.cos(BigMath.PI(4), 16).to_s + # #=> "-0.999999999999999999999999999999856613163740061349e0" + # + def cos(x, prec) + raise ArgumentError, "Zero or negative precision for cos" if prec <= 0 + return BigDecimal("NaN") if x.infinite? || x.nan? + n = prec + BigDecimal.double_fig + one = BigDecimal("1") + two = BigDecimal("2") + x = -x if x < 0 + if x > (twopi = two * BigMath.PI(prec)) + if x > 30 + x %= twopi + else + x -= twopi while x > twopi + end + end + x1 = one + x2 = x.mult(x,n) + sign = 1 + y = one + d = y + i = BigDecimal("0") + z = one + while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) + m = BigDecimal.double_fig if m < BigDecimal.double_fig + sign = -sign + x1 = x2.mult(x1,n) + i += two + z *= (i-one) * i + d = sign * x1.div(z,m) + y += d + end + y + end + + # call-seq: + # atan(decimal, numeric) -> BigDecimal + # + # Computes the arctangent of +decimal+ to the specified number of digits of + # precision, +numeric+. + # + # If +decimal+ is NaN, returns NaN. + # + # BigMath.atan(BigDecimal('-1'), 16).to_s + # #=> "-0.785398163397448309615660845819878471907514682065e0" + # + def atan(x, prec) + raise ArgumentError, "Zero or negative precision for atan" if prec <= 0 + return BigDecimal("NaN") if x.nan? + pi = PI(prec) + x = -x if neg = x < 0 + return pi.div(neg ? -2 : 2, prec) if x.infinite? + return pi / (neg ? -4 : 4) if x.round(prec) == 1 + x = BigDecimal("1").div(x, prec) if inv = x > 1 + x = (-1 + sqrt(1 + x**2, prec))/x if dbl = x > 0.5 + n = prec + BigDecimal.double_fig + y = x + d = y + t = x + r = BigDecimal("3") + x2 = x.mult(x,n) + while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) + m = BigDecimal.double_fig if m < BigDecimal.double_fig + t = -t.mult(x2,n) + d = t.div(r,m) + y += d + r += 2 + end + y *= 2 if dbl + y = pi / 2 - y if inv + y = -y if neg + y + end + + # call-seq: + # PI(numeric) -> BigDecimal + # + # Computes the value of pi to the specified number of digits of precision, + # +numeric+. + # + # BigMath.PI(10).to_s + # #=> "0.3141592653589793238462643388813853786957412e1" + # + def PI(prec) + raise ArgumentError, "Zero or negative precision for PI" if prec <= 0 + n = prec + BigDecimal.double_fig + zero = BigDecimal("0") + one = BigDecimal("1") + two = BigDecimal("2") + + m25 = BigDecimal("-0.04") + m57121 = BigDecimal("-57121") + + pi = zero + + d = one + k = one + t = BigDecimal("-80") + while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0) + m = BigDecimal.double_fig if m < BigDecimal.double_fig + t = t*m25 + d = t.div(k,m) + k = k+two + pi = pi + d + end + + d = one + k = one + t = BigDecimal("956") + while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0) + m = BigDecimal.double_fig if m < BigDecimal.double_fig + t = t.div(m57121,n) + d = t.div(k,m) + pi = pi + d + k = k+two + end + pi + end + + # call-seq: + # E(numeric) -> BigDecimal + # + # Computes e (the base of natural logarithms) to the specified number of + # digits of precision, +numeric+. + # + # BigMath.E(10).to_s + # #=> "0.271828182845904523536028752390026306410273e1" + # + def E(prec) + raise ArgumentError, "Zero or negative precision for E" if prec <= 0 + BigMath.exp(1, prec) + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb new file mode 100644 index 0000000000000..85bacb7f2efbf --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: false +require "bigdecimal/ludcmp" +require "bigdecimal/jacobian" + +# +# newton.rb +# +# Solves the nonlinear algebraic equation system f = 0 by Newton's method. +# This program is not dependent on BigDecimal. +# +# To call: +# n = nlsolve(f,x) +# where n is the number of iterations required, +# x is the initial value vector +# f is an Object which is used to compute the values of the equations to be solved. +# It must provide the following methods: +# +# f.values(x):: returns the values of all functions at x +# +# f.zero:: returns 0.0 +# f.one:: returns 1.0 +# f.two:: returns 2.0 +# f.ten:: returns 10.0 +# +# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal. +# +# On exit, x is the solution vector. +# +module Newton + include LUSolve + include Jacobian + module_function + + def norm(fv,zero=0.0) # :nodoc: + s = zero + n = fv.size + for i in 0...n do + s += fv[i]*fv[i] + end + s + end + + # See also Newton + def nlsolve(f,x) + nRetry = 0 + n = x.size + + f0 = f.values(x) + zero = f.zero + one = f.one + two = f.two + p5 = one/two + d = norm(f0,zero) + minfact = f.ten*f.ten*f.ten + minfact = one/minfact + e = f.eps + while d >= e do + nRetry += 1 + # Not yet converged. => Compute Jacobian matrix + dfdx = jacobian(f,f0,x) + # Solve dfdx*dx = -f0 to estimate dx + dx = lusolve(dfdx,f0,ludecomp(dfdx,n,zero,one),zero) + fact = two + xs = x.dup + begin + fact *= p5 + if fact < minfact then + raise "Failed to reduce function values." + end + for i in 0...n do + x[i] = xs[i] - dx[i]*fact + end + f0 = f.values(x) + dn = norm(f0,zero) + end while(dn>=d) + d = dn + end + nRetry + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb new file mode 100644 index 0000000000000..8bfc0ed8ed2a7 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: false +# +#-- +# bigdecimal/util extends various native classes to provide the #to_d method, +# and provides BigDecimal#to_d and BigDecimal#to_digits. +#++ + +require 'bigdecimal' + +class Integer < Numeric + # call-seq: + # int.to_d -> bigdecimal + # + # Returns the value of +int+ as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # 42.to_d # => 0.42e2 + # + # See also Kernel.BigDecimal. + # + def to_d + BigDecimal(self) + end +end + + +class Float < Numeric + # call-seq: + # float.to_d -> bigdecimal + # float.to_d(precision) -> bigdecimal + # + # Returns the value of +float+ as a BigDecimal. + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # 0.5.to_d # => 0.5e0 + # 1.234.to_d # => 0.1234e1 + # 1.234.to_d(2) # => 0.12e1 + # + # See also Kernel.BigDecimal. + # + def to_d(precision=0) + BigDecimal(self, precision) + end +end + + +class String + # call-seq: + # str.to_d -> bigdecimal + # + # Returns the result of interpreting leading characters in +str+ + # as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # "0.5".to_d # => 0.5e0 + # "123.45e1".to_d # => 0.12345e4 + # "45.67 degrees".to_d # => 0.4567e2 + # + # See also Kernel.BigDecimal. + # + def to_d + BigDecimal.interpret_loosely(self) + end +end + + +class BigDecimal < Numeric + # call-seq: + # a.to_digits -> string + # + # Converts a BigDecimal to a String of the form "nnnnnn.mmm". + # This method is deprecated; use BigDecimal#to_s("F") instead. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_digits # => "3.14" + # + def to_digits + if self.nan? || self.infinite? || self.zero? + self.to_s + else + i = self.to_i.to_s + _,f,_,z = self.frac.split + i + "." + ("0"*(-z)) + f + end + end + + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + def to_d + self + end +end + + +class Rational < Numeric + # call-seq: + # rat.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The required +precision+ parameter is used to determine the number of + # significant digits for the result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Rational(22, 7).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + def to_d(precision) + BigDecimal(self, precision) + end +end + + +class Complex < Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is required for a rational complex number. + # This parameter is used to determine the number of significant digits + # for the result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + def to_d(*args) + BigDecimal(self) unless self.imag.zero? # to raise eerror + + if args.length == 0 + case self.real + when Rational + BigDecimal(self.real) # to raise error + end + end + self.real.to_d(*args) + end +end + + +class NilClass + # call-seq: + # nil.to_d -> bigdecimal + # + # Returns nil represented as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # nil.to_d # => 0.0 + # + def to_d + BigDecimal(0) + end +end From d3e8e0b47a210e9dfb7e19ce1e30478dde8f578d Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 23 May 2024 13:23:23 +0000 Subject: [PATCH 3/4] Update RBI files for json_schemer. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- .../Homebrew/sorbet/rbi/gems/base64@0.2.0.rbi | 507 ++++++++++++++++++ .../sorbet/rbi/gems/bigdecimal@3.1.8.rbi | 9 + ...hemer@2.1.1.rbi => json_schemer@2.2.1.rbi} | 483 ++++++++++++----- 3 files changed, 861 insertions(+), 138 deletions(-) create mode 100644 Library/Homebrew/sorbet/rbi/gems/base64@0.2.0.rbi create mode 100644 Library/Homebrew/sorbet/rbi/gems/bigdecimal@3.1.8.rbi rename Library/Homebrew/sorbet/rbi/gems/{json_schemer@2.1.1.rbi => json_schemer@2.2.1.rbi} (87%) diff --git a/Library/Homebrew/sorbet/rbi/gems/base64@0.2.0.rbi b/Library/Homebrew/sorbet/rbi/gems/base64@0.2.0.rbi new file mode 100644 index 0000000000000..087b64e5aec27 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/base64@0.2.0.rbi @@ -0,0 +1,507 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in +str+, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +module Base64 + private + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# source://base64//base64.rb#186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/bigdecimal@3.1.8.rbi b/Library/Homebrew/sorbet/rbi/gems/bigdecimal@3.1.8.rbi new file mode 100644 index 0000000000000..c52d9ff8798ed --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/bigdecimal@3.1.8.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bigdecimal` gem. +# Please instead update this file by running `bin/tapioca gem bigdecimal`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/Library/Homebrew/sorbet/rbi/gems/json_schemer@2.1.1.rbi b/Library/Homebrew/sorbet/rbi/gems/json_schemer@2.2.1.rbi similarity index 87% rename from Library/Homebrew/sorbet/rbi/gems/json_schemer@2.1.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/json_schemer@2.2.1.rbi index b69c3095d281d..797f7724b88cd 100644 --- a/Library/Homebrew/sorbet/rbi/gems/json_schemer@2.1.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/json_schemer@2.2.1.rbi @@ -4,52 +4,69 @@ # This is an autogenerated file for types exported from the `json_schemer` gem. # Please instead update this file by running `bin/tapioca gem json_schemer`. + # Based on code from @robacarp found in issue 48: # https://github.com/davishmcclurg/json_schemer/issues/48 # # source://json_schemer//lib/json_schemer/version.rb#2 module JSONSchemer class << self - # source://json_schemer//lib/json_schemer.rb#157 + # source://json_schemer//lib/json_schemer.rb#235 + def configuration; end + + # @yield [configuration] + # + # source://json_schemer//lib/json_schemer.rb#239 + def configure; end + + # source://json_schemer//lib/json_schemer.rb#143 def draft201909; end - # source://json_schemer//lib/json_schemer.rb#145 + # source://json_schemer//lib/json_schemer.rb#131 def draft202012; end - # source://json_schemer//lib/json_schemer.rb#193 + # source://json_schemer//lib/json_schemer.rb#179 def draft4; end - # source://json_schemer//lib/json_schemer.rb#181 + # source://json_schemer//lib/json_schemer.rb#167 def draft6; end - # source://json_schemer//lib/json_schemer.rb#169 + # source://json_schemer//lib/json_schemer.rb#155 def draft7; end - # source://json_schemer//lib/json_schemer.rb#245 + # source://json_schemer//lib/json_schemer.rb#231 def openapi(document, **options); end - # source://json_schemer//lib/json_schemer.rb#215 + # source://json_schemer//lib/json_schemer.rb#201 def openapi30; end - # source://json_schemer//lib/json_schemer.rb#237 + # source://json_schemer//lib/json_schemer.rb#223 def openapi30_document; end - # source://json_schemer//lib/json_schemer.rb#205 + # source://json_schemer//lib/json_schemer.rb#191 def openapi31; end - # source://json_schemer//lib/json_schemer.rb#229 + # source://json_schemer//lib/json_schemer.rb#215 def openapi31_document; end # source://json_schemer//lib/json_schemer.rb#116 - def schema(schema, meta_schema: T.unsafe(nil), **options); end + def schema(schema, **options); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer.rb#137 + # source://json_schemer//lib/json_schemer.rb#121 def valid_schema?(schema, **options); end - # source://json_schemer//lib/json_schemer.rb#141 + # source://json_schemer//lib/json_schemer.rb#126 def validate_schema(schema, **options); end + + private + + # source://json_schemer//lib/json_schemer.rb#264 + def meta_schema(schema, options); end + + # source://json_schemer//lib/json_schemer.rb#245 + def resolve(schema, options); end end end @@ -73,6 +90,209 @@ class JSONSchemer::CachedResolver def call(*args); end end +# source://json_schemer//lib/json_schemer/configuration.rb#3 +class JSONSchemer::Configuration < ::Struct + # @return [Configuration] a new instance of Configuration + # + # source://json_schemer//lib/json_schemer/configuration.rb#9 + def initialize(base_uri: T.unsafe(nil), meta_schema: T.unsafe(nil), vocabulary: T.unsafe(nil), format: T.unsafe(nil), formats: T.unsafe(nil), content_encodings: T.unsafe(nil), content_media_types: T.unsafe(nil), keywords: T.unsafe(nil), before_property_validation: T.unsafe(nil), after_property_validation: T.unsafe(nil), insert_property_defaults: T.unsafe(nil), property_default_resolver: T.unsafe(nil), ref_resolver: T.unsafe(nil), regexp_resolver: T.unsafe(nil), output_format: T.unsafe(nil), resolve_enumerators: T.unsafe(nil), access_mode: T.unsafe(nil)); end + + # Returns the value of attribute access_mode + # + # @return [Object] the current value of access_mode + def access_mode; end + + # Sets the attribute access_mode + # + # @param value [Object] the value to set the attribute access_mode to. + # @return [Object] the newly set value + def access_mode=(_); end + + # Returns the value of attribute after_property_validation + # + # @return [Object] the current value of after_property_validation + def after_property_validation; end + + # Sets the attribute after_property_validation + # + # @param value [Object] the value to set the attribute after_property_validation to. + # @return [Object] the newly set value + def after_property_validation=(_); end + + # Returns the value of attribute base_uri + # + # @return [Object] the current value of base_uri + def base_uri; end + + # Sets the attribute base_uri + # + # @param value [Object] the value to set the attribute base_uri to. + # @return [Object] the newly set value + def base_uri=(_); end + + # Returns the value of attribute before_property_validation + # + # @return [Object] the current value of before_property_validation + def before_property_validation; end + + # Sets the attribute before_property_validation + # + # @param value [Object] the value to set the attribute before_property_validation to. + # @return [Object] the newly set value + def before_property_validation=(_); end + + # Returns the value of attribute content_encodings + # + # @return [Object] the current value of content_encodings + def content_encodings; end + + # Sets the attribute content_encodings + # + # @param value [Object] the value to set the attribute content_encodings to. + # @return [Object] the newly set value + def content_encodings=(_); end + + # Returns the value of attribute content_media_types + # + # @return [Object] the current value of content_media_types + def content_media_types; end + + # Sets the attribute content_media_types + # + # @param value [Object] the value to set the attribute content_media_types to. + # @return [Object] the newly set value + def content_media_types=(_); end + + # Returns the value of attribute format + # + # @return [Object] the current value of format + def format; end + + # Sets the attribute format + # + # @param value [Object] the value to set the attribute format to. + # @return [Object] the newly set value + def format=(_); end + + # Returns the value of attribute formats + # + # @return [Object] the current value of formats + def formats; end + + # Sets the attribute formats + # + # @param value [Object] the value to set the attribute formats to. + # @return [Object] the newly set value + def formats=(_); end + + # Returns the value of attribute insert_property_defaults + # + # @return [Object] the current value of insert_property_defaults + def insert_property_defaults; end + + # Sets the attribute insert_property_defaults + # + # @param value [Object] the value to set the attribute insert_property_defaults to. + # @return [Object] the newly set value + def insert_property_defaults=(_); end + + # Returns the value of attribute keywords + # + # @return [Object] the current value of keywords + def keywords; end + + # Sets the attribute keywords + # + # @param value [Object] the value to set the attribute keywords to. + # @return [Object] the newly set value + def keywords=(_); end + + # Returns the value of attribute meta_schema + # + # @return [Object] the current value of meta_schema + def meta_schema; end + + # Sets the attribute meta_schema + # + # @param value [Object] the value to set the attribute meta_schema to. + # @return [Object] the newly set value + def meta_schema=(_); end + + # Returns the value of attribute output_format + # + # @return [Object] the current value of output_format + def output_format; end + + # Sets the attribute output_format + # + # @param value [Object] the value to set the attribute output_format to. + # @return [Object] the newly set value + def output_format=(_); end + + # Returns the value of attribute property_default_resolver + # + # @return [Object] the current value of property_default_resolver + def property_default_resolver; end + + # Sets the attribute property_default_resolver + # + # @param value [Object] the value to set the attribute property_default_resolver to. + # @return [Object] the newly set value + def property_default_resolver=(_); end + + # Returns the value of attribute ref_resolver + # + # @return [Object] the current value of ref_resolver + def ref_resolver; end + + # Sets the attribute ref_resolver + # + # @param value [Object] the value to set the attribute ref_resolver to. + # @return [Object] the newly set value + def ref_resolver=(_); end + + # Returns the value of attribute regexp_resolver + # + # @return [Object] the current value of regexp_resolver + def regexp_resolver; end + + # Sets the attribute regexp_resolver + # + # @param value [Object] the value to set the attribute regexp_resolver to. + # @return [Object] the newly set value + def regexp_resolver=(_); end + + # Returns the value of attribute resolve_enumerators + # + # @return [Object] the current value of resolve_enumerators + def resolve_enumerators; end + + # Sets the attribute resolve_enumerators + # + # @param value [Object] the value to set the attribute resolve_enumerators to. + # @return [Object] the newly set value + def resolve_enumerators=(_); end + + # Returns the value of attribute vocabulary + # + # @return [Object] the current value of vocabulary + def vocabulary; end + + # Sets the attribute vocabulary + # + # @param value [Object] the value to set the attribute vocabulary to. + # @return [Object] the newly set value + def vocabulary=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + # source://json_schemer//lib/json_schemer/content.rb#3 module JSONSchemer::ContentEncoding; end @@ -684,32 +904,38 @@ class JSONSchemer::Draft202012::Vocab::Unevaluated::UnevaluatedItems < ::JSONSch def error(formatted_instance_location:, **_arg1); end # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#11 - def parse; end + def false_schema_error(formatted_instance_location:, **_arg1); end # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#15 + def parse; end + + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#19 def validate(instance, instance_location, keyword_location, context); end private - # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#33 - def collect_unevaluated_items(result, instance_location, unevaluated_items); end + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#37 + def collect_unevaluated_items(result, unevaluated_items); end end -# source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#49 +# source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#54 class JSONSchemer::Draft202012::Vocab::Unevaluated::UnevaluatedProperties < ::JSONSchemer::Keyword - # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#50 + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#55 def error(formatted_instance_location:, **_arg1); end - # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#54 + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#59 + def false_schema_error(formatted_instance_location:, **_arg1); end + + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#63 def parse; end - # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#58 + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#67 def validate(instance, instance_location, keyword_location, context); end private - # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#80 - def collect_evaluated_keys(result, instance_location, evaluated_keys); end + # source://json_schemer//lib/json_schemer/draft202012/vocab/unevaluated.rb#89 + def collect_evaluated_keys(result, evaluated_keys); end end # https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#section-6 @@ -1063,7 +1289,7 @@ end # source://json_schemer//lib/json_schemer/ecma_regexp.rb#27 JSONSchemer::EcmaRegexp::RUBY_EQUIVALENTS = T.let(T.unsafe(nil), Hash) -# source://json_schemer//lib/json_schemer/ecma_regexp.rb#6 +# source://json_schemer//lib/json_schemer/ecma_regexp.rb#4 class JSONSchemer::EcmaRegexp::Syntax < ::Regexp::Syntax::Base; end # regexp_parser >= 2.3.0 uses syntax classes directly instead of instances @@ -1092,12 +1318,12 @@ module JSONSchemer::Format extend ::JSONSchemer::Format::URITemplate class << self - # source://json_schemer//lib/json_schemer/format.rb#133 + # source://json_schemer//lib/json_schemer/format.rb#132 def iri_escape(data); end # @raise [::URI::InvalidURIError] # - # source://json_schemer//lib/json_schemer/format.rb#113 + # source://json_schemer//lib/json_schemer/format.rb#112 def parse_uri_scheme(data); end # source://json_schemer//lib/json_schemer/format.rb#90 @@ -1105,38 +1331,38 @@ module JSONSchemer::Format # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#97 + # source://json_schemer//lib/json_schemer/format.rb#96 def valid_date_time?(data); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#106 + # source://json_schemer//lib/json_schemer/format.rb#105 def valid_ip?(data, family); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#137 + # source://json_schemer//lib/json_schemer/format.rb#136 def valid_regex?(data); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#120 + # source://json_schemer//lib/json_schemer/format.rb#119 def valid_uri?(data); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#126 + # source://json_schemer//lib/json_schemer/format.rb#125 def valid_uri_reference?(data); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/format.rb#143 + # source://json_schemer//lib/json_schemer/format.rb#142 def valid_uuid?(data); end end end # source://json_schemer//lib/json_schemer/format.rb#79 -JSONSchemer::Format::ASCII_8BIT_TO_PERCENT_ENCODED = T.let(T.unsafe(nil), Hash) +JSONSchemer::Format::BINARY_TO_PERCENT_ENCODED = T.let(T.unsafe(nil), Hash) # source://json_schemer//lib/json_schemer/format.rb#8 JSONSchemer::Format::DATE = T.let(T.unsafe(nil), Proc) @@ -1689,10 +1915,10 @@ JSONSchemer::Location::JSON_POINTER_TOKEN_ESCAPE_CHARS = T.let(T.unsafe(nil), Ha # source://json_schemer//lib/json_schemer/location.rb#5 JSONSchemer::Location::JSON_POINTER_TOKEN_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) -# source://json_schemer//lib/json_schemer.rb#262 +# source://json_schemer//lib/json_schemer.rb#286 JSONSchemer::META_SCHEMAS_BY_BASE_URI_STR = T.let(T.unsafe(nil), Hash) -# source://json_schemer//lib/json_schemer.rb#250 +# source://json_schemer//lib/json_schemer.rb#274 JSONSchemer::META_SCHEMA_CALLABLES_BY_BASE_URI_STR = T.let(T.unsafe(nil), Hash) # source://json_schemer//lib/json_schemer/openapi.rb#3 @@ -1702,18 +1928,18 @@ class JSONSchemer::OpenAPI # source://json_schemer//lib/json_schemer/openapi.rb#4 def initialize(document, **options); end - # source://json_schemer//lib/json_schemer/openapi.rb#32 + # source://json_schemer//lib/json_schemer/openapi.rb#30 def ref(value); end - # source://json_schemer//lib/json_schemer/openapi.rb#36 + # source://json_schemer//lib/json_schemer/openapi.rb#34 def schema(name); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/openapi.rb#24 + # source://json_schemer//lib/json_schemer/openapi.rb#22 def valid?; end - # source://json_schemer//lib/json_schemer/openapi.rb#28 + # source://json_schemer//lib/json_schemer/openapi.rb#26 def validate(**options); end end @@ -1849,7 +2075,7 @@ class JSONSchemer::OpenAPI31::Vocab::Base::AnyOf < ::JSONSchemer::Draft202012::V def validate(*_arg0); end end -# source://json_schemer//lib/json_schemer/openapi31/vocab/base.rb#37 +# source://json_schemer//lib/json_schemer/openapi31/vocab/base.rb#36 class JSONSchemer::OpenAPI31::Vocab::Base::Discriminator < ::JSONSchemer::Keyword # source://json_schemer//lib/json_schemer/openapi31/vocab/base.rb#42 def error(formatted_instance_location:, **_arg1); end @@ -2089,6 +2315,11 @@ class JSONSchemer::Result < ::Struct # source://json_schemer//lib/json_schemer/result.rb#163 def verbose; end + private + + # source://json_schemer//lib/json_schemer/result.rb#232 + def default_keyword_instance(schema); end + class << self def [](*_arg0); end def inspect; end @@ -2104,211 +2335,214 @@ class JSONSchemer::Schema # @return [Schema] a new instance of Schema # - # source://json_schemer//lib/json_schemer/schema.rb#48 - def initialize(value, parent = T.unsafe(nil), root = T.unsafe(nil), keyword = T.unsafe(nil), base_uri: T.unsafe(nil), meta_schema: T.unsafe(nil), vocabulary: T.unsafe(nil), format: T.unsafe(nil), formats: T.unsafe(nil), content_encodings: T.unsafe(nil), content_media_types: T.unsafe(nil), keywords: T.unsafe(nil), before_property_validation: T.unsafe(nil), after_property_validation: T.unsafe(nil), insert_property_defaults: T.unsafe(nil), property_default_resolver: T.unsafe(nil), ref_resolver: T.unsafe(nil), regexp_resolver: T.unsafe(nil), output_format: T.unsafe(nil), resolve_enumerators: T.unsafe(nil), access_mode: T.unsafe(nil)); end + # source://json_schemer//lib/json_schemer/schema.rb#49 + def initialize(value, parent = T.unsafe(nil), root = T.unsafe(nil), keyword = T.unsafe(nil), configuration: T.unsafe(nil), base_uri: T.unsafe(nil), meta_schema: T.unsafe(nil), vocabulary: T.unsafe(nil), format: T.unsafe(nil), formats: T.unsafe(nil), content_encodings: T.unsafe(nil), content_media_types: T.unsafe(nil), keywords: T.unsafe(nil), before_property_validation: T.unsafe(nil), after_property_validation: T.unsafe(nil), insert_property_defaults: T.unsafe(nil), property_default_resolver: T.unsafe(nil), ref_resolver: T.unsafe(nil), regexp_resolver: T.unsafe(nil), output_format: T.unsafe(nil), resolve_enumerators: T.unsafe(nil), access_mode: T.unsafe(nil)); end - # source://json_schemer//lib/json_schemer/schema.rb#270 + # source://json_schemer//lib/json_schemer/schema.rb#267 def absolute_keyword_location; end # Returns the value of attribute after_property_validation. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def after_property_validation; end # Returns the value of attribute base_uri. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def base_uri; end # Sets the attribute base_uri # # @param value the value to set the attribute base_uri to. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def base_uri=(_arg0); end # Returns the value of attribute before_property_validation. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def before_property_validation; end - # source://json_schemer//lib/json_schemer/schema.rb#221 + # source://json_schemer//lib/json_schemer/schema.rb#218 def bundle; end - # Returns the value of attribute content_encodings. + # Returns the value of attribute configuration. # # source://json_schemer//lib/json_schemer/schema.rb#46 + def configuration; end + + # Returns the value of attribute content_encodings. + # + # source://json_schemer//lib/json_schemer/schema.rb#47 def content_encodings; end # Returns the value of attribute content_media_types. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def content_media_types; end # Returns the value of attribute custom_keywords. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def custom_keywords; end - # source://json_schemer//lib/json_schemer/schema.rb#329 + # source://json_schemer//lib/json_schemer/schema.rb#326 def defs_keyword; end - # source://json_schemer//lib/json_schemer/schema.rb#337 + # source://json_schemer//lib/json_schemer/schema.rb#334 def error(formatted_instance_location:, **options); end - # source://json_schemer//lib/json_schemer/schema.rb#293 + # source://json_schemer//lib/json_schemer/schema.rb#290 def error_key; end - # source://json_schemer//lib/json_schemer/schema.rb#297 + # source://json_schemer//lib/json_schemer/schema.rb#294 def fetch(key); end - # source://json_schemer//lib/json_schemer/schema.rb#309 + # source://json_schemer//lib/json_schemer/schema.rb#306 def fetch_content_encoding(content_encoding, *args, &block); end - # source://json_schemer//lib/json_schemer/schema.rb#317 + # source://json_schemer//lib/json_schemer/schema.rb#314 def fetch_content_media_type(content_media_type, *args, &block); end - # source://json_schemer//lib/json_schemer/schema.rb#301 + # source://json_schemer//lib/json_schemer/schema.rb#298 def fetch_format(format, *args, &block); end # Returns the value of attribute format. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def format; end # Returns the value of attribute formats. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def formats; end - # source://json_schemer//lib/json_schemer/schema.rb#325 + # source://json_schemer//lib/json_schemer/schema.rb#322 def id_keyword; end # Returns the value of attribute insert_property_defaults. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def insert_property_defaults; end - # source://json_schemer//lib/json_schemer/schema.rb#345 + # source://json_schemer//lib/json_schemer/schema.rb#357 def inspect; end # Returns the value of attribute keyword_order. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def keyword_order; end # Sets the attribute keyword_order # # @param value the value to set the attribute keyword_order to. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def keyword_order=(_arg0); end # Returns the value of attribute keywords. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def keywords; end # Sets the attribute keywords # # @param value the value to set the attribute keywords to. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def keywords=(_arg0); end # Returns the value of attribute meta_schema. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def meta_schema; end # Sets the attribute meta_schema # # @param value the value to set the attribute meta_schema to. # - # source://json_schemer//lib/json_schemer/schema.rb#44 + # source://json_schemer//lib/json_schemer/schema.rb#45 def meta_schema=(_arg0); end # Returns the value of attribute parent. # - # source://json_schemer//lib/json_schemer/schema.rb#45 + # source://json_schemer//lib/json_schemer/schema.rb#46 def parent; end # Returns the value of attribute parsed. # - # source://json_schemer//lib/json_schemer/schema.rb#45 - def parsed; end - - # Returns the value of attribute property_default_resolver. - # # source://json_schemer//lib/json_schemer/schema.rb#46 - def property_default_resolver; end + def parsed; end - # source://json_schemer//lib/json_schemer/schema.rb#120 + # source://json_schemer//lib/json_schemer/schema.rb#123 def ref(value); end + # source://json_schemer//lib/json_schemer/schema.rb#342 + def ref_resolver; end + + # source://json_schemer//lib/json_schemer/schema.rb#346 + def regexp_resolver; end + # @raise [InvalidRefPointer] # - # source://json_schemer//lib/json_schemer/schema.rb#166 + # source://json_schemer//lib/json_schemer/schema.rb#170 def resolve_ref(uri); end - # source://json_schemer//lib/json_schemer/schema.rb#217 + # source://json_schemer//lib/json_schemer/schema.rb#214 def resolve_regexp(pattern); end - # source://json_schemer//lib/json_schemer/schema.rb#333 + # source://json_schemer//lib/json_schemer/schema.rb#330 def resources; end # Returns the value of attribute root. # - # source://json_schemer//lib/json_schemer/schema.rb#45 + # source://json_schemer//lib/json_schemer/schema.rb#46 def root; end - # source://json_schemer//lib/json_schemer/schema.rb#283 + # source://json_schemer//lib/json_schemer/schema.rb#280 def schema_pointer; end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/schema.rb#96 + # source://json_schemer//lib/json_schemer/schema.rb#99 def valid?(instance, **options); end # @return [Boolean] # - # source://json_schemer//lib/json_schemer/schema.rb#112 - def valid_schema?; end + # source://json_schemer//lib/json_schemer/schema.rb#115 + def valid_schema?(**options); end - # source://json_schemer//lib/json_schemer/schema.rb#100 + # source://json_schemer//lib/json_schemer/schema.rb#103 def validate(instance, output_format: T.unsafe(nil), resolve_enumerators: T.unsafe(nil), access_mode: T.unsafe(nil)); end - # source://json_schemer//lib/json_schemer/schema.rb#124 + # source://json_schemer//lib/json_schemer/schema.rb#127 def validate_instance(instance, instance_location, keyword_location, context); end - # source://json_schemer//lib/json_schemer/schema.rb#116 - def validate_schema; end + # source://json_schemer//lib/json_schemer/schema.rb#119 + def validate_schema(**options); end # Returns the value of attribute value. # - # source://json_schemer//lib/json_schemer/schema.rb#45 + # source://json_schemer//lib/json_schemer/schema.rb#46 def value; end # Returns the value of attribute vocabulary. # - # source://json_schemer//lib/json_schemer/schema.rb#46 + # source://json_schemer//lib/json_schemer/schema.rb#47 def vocabulary; end private - # source://json_schemer//lib/json_schemer/schema.rb#351 + # source://json_schemer//lib/json_schemer/schema.rb#363 def parse; end - # source://json_schemer//lib/json_schemer/schema.rb#397 - def ref_resolver; end - - # source://json_schemer//lib/json_schemer/schema.rb#401 - def regexp_resolver; end + # source://json_schemer//lib/json_schemer/schema.rb#409 + def property_default_resolver; end - # source://json_schemer//lib/json_schemer/schema.rb#412 + # source://json_schemer//lib/json_schemer/schema.rb#413 def resolve_enumerators!(output); end - # source://json_schemer//lib/json_schemer/schema.rb#393 + # source://json_schemer//lib/json_schemer/schema.rb#405 def root_keyword_location; end end @@ -2381,61 +2615,37 @@ class JSONSchemer::Schema::Context < ::Struct end end -# source://json_schemer//lib/json_schemer/schema.rb#27 -JSONSchemer::Schema::DEFAULT_AFTER_PROPERTY_VALIDATION = T.let(T.unsafe(nil), Array) - -# source://json_schemer//lib/json_schemer/schema.rb#21 -JSONSchemer::Schema::DEFAULT_BASE_URI = T.let(T.unsafe(nil), URI::Generic) - -# source://json_schemer//lib/json_schemer/schema.rb#26 -JSONSchemer::Schema::DEFAULT_BEFORE_PROPERTY_VALIDATION = T.let(T.unsafe(nil), Array) - -# source://json_schemer//lib/json_schemer/schema.rb#23 -JSONSchemer::Schema::DEFAULT_CONTENT_ENCODINGS = T.let(T.unsafe(nil), Hash) - -# source://json_schemer//lib/json_schemer/schema.rb#24 -JSONSchemer::Schema::DEFAULT_CONTENT_MEDIA_TYPES = T.let(T.unsafe(nil), Hash) - -# source://json_schemer//lib/json_schemer/schema.rb#22 -JSONSchemer::Schema::DEFAULT_FORMATS = T.let(T.unsafe(nil), Hash) - -# source://json_schemer//lib/json_schemer/schema.rb#25 -JSONSchemer::Schema::DEFAULT_KEYWORDS = T.let(T.unsafe(nil), Hash) - -# source://json_schemer//lib/json_schemer/schema.rb#33 +# source://json_schemer//lib/json_schemer/schema.rb#31 JSONSchemer::Schema::DEFAULT_PROPERTY_DEFAULT_RESOLVER = T.let(T.unsafe(nil), Proc) -# source://json_schemer//lib/json_schemer/schema.rb#28 -JSONSchemer::Schema::DEFAULT_REF_RESOLVER = T.let(T.unsafe(nil), Proc) - -# source://json_schemer//lib/json_schemer/schema.rb#14 -JSONSchemer::Schema::DEFAULT_SCHEMA = T.let(T.unsafe(nil), String) - -# source://json_schemer//lib/json_schemer/schema.rb#31 +# source://json_schemer//lib/json_schemer/schema.rb#29 JSONSchemer::Schema::ECMA_REGEXP_RESOLVER = T.let(T.unsafe(nil), Proc) -# source://json_schemer//lib/json_schemer/schema.rb#17 +# source://json_schemer//lib/json_schemer/schema.rb#22 JSONSchemer::Schema::ID_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Core::Id -# source://json_schemer//lib/json_schemer/schema.rb#29 +# source://json_schemer//lib/json_schemer/schema.rb#27 JSONSchemer::Schema::NET_HTTP_REF_RESOLVER = T.let(T.unsafe(nil), Proc) -# source://json_schemer//lib/json_schemer/schema.rb#19 +# source://json_schemer//lib/json_schemer/schema.rb#24 JSONSchemer::Schema::NOT_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Applicator::Not -# source://json_schemer//lib/json_schemer/schema.rb#20 +# source://json_schemer//lib/json_schemer/schema.rb#25 JSONSchemer::Schema::PROPERTIES_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Applicator::Properties -# source://json_schemer//lib/json_schemer/schema.rb#30 +# source://json_schemer//lib/json_schemer/schema.rb#28 JSONSchemer::Schema::RUBY_REGEXP_RESOLVER = T.let(T.unsafe(nil), Proc) -# source://json_schemer//lib/json_schemer/schema.rb#15 +# source://json_schemer//lib/json_schemer/schema.rb#20 JSONSchemer::Schema::SCHEMA_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Core::Schema -# source://json_schemer//lib/json_schemer/schema.rb#18 +# source://json_schemer//lib/json_schemer/schema.rb#41 +JSONSchemer::Schema::SYMBOL_PROPERTY_DEFAULT_RESOLVER = T.let(T.unsafe(nil), Proc) + +# source://json_schemer//lib/json_schemer/schema.rb#23 JSONSchemer::Schema::UNKNOWN_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Core::UnknownKeyword -# source://json_schemer//lib/json_schemer/schema.rb#16 +# source://json_schemer//lib/json_schemer/schema.rb#21 JSONSchemer::Schema::VOCABULARY_KEYWORD_CLASS = JSONSchemer::Draft202012::Vocab::Core::Vocabulary # source://json_schemer//lib/json_schemer.rb#70 @@ -2456,9 +2666,6 @@ class JSONSchemer::UnknownRef < ::StandardError; end # source://json_schemer//lib/json_schemer.rb#69 class JSONSchemer::UnknownVocabulary < ::StandardError; end -# source://json_schemer//lib/json_schemer.rb#65 -class JSONSchemer::UnsupportedMetaSchema < ::StandardError; end - # source://json_schemer//lib/json_schemer.rb#66 class JSONSchemer::UnsupportedOpenAPIVersion < ::StandardError; end From d70e5d4071aa550d4c9d1f58fc1d82dca02e2d22 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Thu, 23 May 2024 14:30:09 +0100 Subject: [PATCH 4/4] .gitignore: add bigdecimal (native gem) --- .gitignore | 1 + .../ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE | 56 ----- .../gems/bigdecimal-3.1.8/lib/bigdecimal.rb | 5 - .../lib/bigdecimal/jacobian.rb | 90 ------- .../bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb | 89 ------- .../bigdecimal-3.1.8/lib/bigdecimal/math.rb | 232 ------------------ .../bigdecimal-3.1.8/lib/bigdecimal/newton.rb | 80 ------ .../bigdecimal-3.1.8/lib/bigdecimal/util.rb | 185 -------------- 8 files changed, 1 insertion(+), 737 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb diff --git a/.gitignore b/.gitignore index e86f39e9adcd8..93132f8ef0565 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ # Ignore dependencies we don't wish to vendor **/vendor/bundle/ruby/*/gems/ast-*/ +**/vendor/bundle/ruby/*/gems/bigdecimal-*/ **/vendor/bundle/ruby/*/gems/bootsnap-*/ **/vendor/bundle/ruby/*/gems/bundler-*/ **/vendor/bundle/ruby/*/gems/byebug-*/ diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE deleted file mode 100644 index a1f19ff99db14..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ -Ruby is copyrighted free software by Yukihiro Matsumoto . -You can redistribute it and/or modify it under either the terms of the -2-clause BSDL (see the file BSDL), or the conditions below: - - 1. You may make and give away verbatim copies of the source form of the - software without restriction, provided that you duplicate all of the - original copyright notices and associated disclaimers. - - 2. You may modify your copy of the software in any way, provided that - you do at least ONE of the following: - - a) place your modifications in the Public Domain or otherwise - make them Freely Available, such as by posting said - modifications to Usenet or an equivalent medium, or by allowing - the author to include your modifications in the software. - - b) use the modified software only within your corporation or - organization. - - c) give non-standard binaries non-standard names, with - instructions on where to get the original software distribution. - - d) make other distribution arrangements with the author. - - 3. You may distribute the software in object code or binary form, - provided that you do at least ONE of the following: - - a) distribute the binaries and library files of the software, - together with instructions (in the manual page or equivalent) - on where to get the original distribution. - - b) accompany the distribution with the machine-readable source of - the software. - - c) give non-standard binaries non-standard names, with - instructions on where to get the original software distribution. - - d) make other distribution arrangements with the author. - - 4. You may modify and include the part of the software into any other - software (possibly commercial). But some files in the distribution - are not written by the author, so that they are not under these terms. - - For the list of those files and their copying conditions, see the - file LEGAL. - - 5. The scripts and library files supplied as input to or produced as - output from the software do not automatically fall under the - copyright of the software, but belong to whomever generated them, - and may be sold commercially, and may be aggregated with this - software. - - 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb deleted file mode 100644 index 82b3e1b7b9880..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal.rb +++ /dev/null @@ -1,5 +0,0 @@ -if RUBY_ENGINE == 'jruby' - JRuby::Util.load_ext("org.jruby.ext.bigdecimal.BigDecimalLibrary") -else - require 'bigdecimal.so' -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb deleted file mode 100644 index 4448024c74285..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/jacobian.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: false - -require 'bigdecimal' - -# require 'bigdecimal/jacobian' -# -# Provides methods to compute the Jacobian matrix of a set of equations at a -# point x. In the methods below: -# -# f is an Object which is used to compute the Jacobian matrix of the equations. -# It must provide the following methods: -# -# f.values(x):: returns the values of all functions at x -# -# f.zero:: returns 0.0 -# f.one:: returns 1.0 -# f.two:: returns 2.0 -# f.ten:: returns 10.0 -# -# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal. -# -# x is the point at which to compute the Jacobian. -# -# fx is f.values(x). -# -module Jacobian - module_function - - # Determines the equality of two numbers by comparing to zero, or using the epsilon value - def isEqual(a,b,zero=0.0,e=1.0e-8) - aa = a.abs - bb = b.abs - if aa == zero && bb == zero then - true - else - if ((a-b)/(aa+bb)).abs < e then - true - else - false - end - end - end - - - # Computes the derivative of +f[i]+ at +x[i]+. - # +fx+ is the value of +f+ at +x+. - def dfdxi(f,fx,x,i) - nRetry = 0 - n = x.size - xSave = x[i] - ok = 0 - ratio = f.ten*f.ten*f.ten - dx = x[i].abs/ratio - dx = fx[i].abs/ratio if isEqual(dx,f.zero,f.zero,f.eps) - dx = f.one/f.ten if isEqual(dx,f.zero,f.zero,f.eps) - until ok>0 do - deriv = [] - nRetry += 1 - if nRetry > 100 - raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]" - end - dx = dx*f.two - x[i] += dx - fxNew = f.values(x) - for j in 0...n do - if !isEqual(fxNew[j],fx[j],f.zero,f.eps) then - ok += 1 - deriv <<= (fxNew[j]-fx[j])/dx - else - deriv <<= f.zero - end - end - x[i] = xSave - end - deriv - end - - # Computes the Jacobian of +f+ at +x+. +fx+ is the value of +f+ at +x+. - def jacobian(f,fx,x) - n = x.size - dfdx = Array.new(n*n) - for i in 0...n do - df = dfdxi(f,fx,x,i) - for j in 0...n do - dfdx[j*n+i] = df[j] - end - end - dfdx - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb deleted file mode 100644 index dd265e482a317..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/ludcmp.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: false -require 'bigdecimal' - -# -# Solves a*x = b for x, using LU decomposition. -# -module LUSolve - module_function - - # Performs LU decomposition of the n by n matrix a. - def ludecomp(a,n,zero=0,one=1) - prec = BigDecimal.limit(nil) - ps = [] - scales = [] - for i in 0...n do # pick up largest(abs. val.) element in each row. - ps <<= i - nrmrow = zero - ixn = i*n - for j in 0...n do - biggst = a[ixn+j].abs - nrmrow = biggst if biggst>nrmrow - end - if nrmrow>zero then - scales <<= one.div(nrmrow,prec) - else - raise "Singular matrix" - end - end - n1 = n - 1 - for k in 0...n1 do # Gaussian elimination with partial pivoting. - biggst = zero; - for i in k...n do - size = a[ps[i]*n+k].abs*scales[ps[i]] - if size>biggst then - biggst = size - pividx = i - end - end - raise "Singular matrix" if biggst<=zero - if pividx!=k then - j = ps[k] - ps[k] = ps[pividx] - ps[pividx] = j - end - pivot = a[ps[k]*n+k] - for i in (k+1)...n do - psin = ps[i]*n - a[psin+k] = mult = a[psin+k].div(pivot,prec) - if mult!=zero then - pskn = ps[k]*n - for j in (k+1)...n do - a[psin+j] -= mult.mult(a[pskn+j],prec) - end - end - end - end - raise "Singular matrix" if a[ps[n1]*n+n1] == zero - ps - end - - # Solves a*x = b for x, using LU decomposition. - # - # a is a matrix, b is a constant vector, x is the solution vector. - # - # ps is the pivot, a vector which indicates the permutation of rows performed - # during LU decomposition. - def lusolve(a,b,ps,zero=0.0) - prec = BigDecimal.limit(nil) - n = ps.size - x = [] - for i in 0...n do - dot = zero - psin = ps[i]*n - for j in 0...i do - dot = a[psin+j].mult(x[j],prec) + dot - end - x <<= b[ps[i]] - dot - end - (n-1).downto(0) do |i| - dot = zero - psin = ps[i]*n - for j in (i+1)...n do - dot = a[psin+j].mult(x[j],prec) + dot - end - x[i] = (x[i]-dot).div(a[psin+i],prec) - end - x - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb deleted file mode 100644 index 0b9d0648bb3e3..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/math.rb +++ /dev/null @@ -1,232 +0,0 @@ -# frozen_string_literal: false -require 'bigdecimal' - -# -#-- -# Contents: -# sqrt(x, prec) -# sin (x, prec) -# cos (x, prec) -# atan(x, prec) Note: |x|<1, x=0.9999 may not converge. -# PI (prec) -# E (prec) == exp(1.0,prec) -# -# where: -# x ... BigDecimal number to be computed. -# |x| must be small enough to get convergence. -# prec ... Number of digits to be obtained. -#++ -# -# Provides mathematical functions. -# -# Example: -# -# require "bigdecimal/math" -# -# include BigMath -# -# a = BigDecimal((PI(100)/2).to_s) -# puts sin(a,100) # => 0.99999999999999999999......e0 -# -module BigMath - module_function - - # call-seq: - # sqrt(decimal, numeric) -> BigDecimal - # - # Computes the square root of +decimal+ to the specified number of digits of - # precision, +numeric+. - # - # BigMath.sqrt(BigDecimal('2'), 16).to_s - # #=> "0.1414213562373095048801688724e1" - # - def sqrt(x, prec) - x.sqrt(prec) - end - - # call-seq: - # sin(decimal, numeric) -> BigDecimal - # - # Computes the sine of +decimal+ to the specified number of digits of - # precision, +numeric+. - # - # If +decimal+ is Infinity or NaN, returns NaN. - # - # BigMath.sin(BigMath.PI(5)/4, 5).to_s - # #=> "0.70710678118654752440082036563292800375e0" - # - def sin(x, prec) - raise ArgumentError, "Zero or negative precision for sin" if prec <= 0 - return BigDecimal("NaN") if x.infinite? || x.nan? - n = prec + BigDecimal.double_fig - one = BigDecimal("1") - two = BigDecimal("2") - x = -x if neg = x < 0 - if x > (twopi = two * BigMath.PI(prec)) - if x > 30 - x %= twopi - else - x -= twopi while x > twopi - end - end - x1 = x - x2 = x.mult(x,n) - sign = 1 - y = x - d = y - i = one - z = one - while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) - m = BigDecimal.double_fig if m < BigDecimal.double_fig - sign = -sign - x1 = x2.mult(x1,n) - i += two - z *= (i-one) * i - d = sign * x1.div(z,m) - y += d - end - neg ? -y : y - end - - # call-seq: - # cos(decimal, numeric) -> BigDecimal - # - # Computes the cosine of +decimal+ to the specified number of digits of - # precision, +numeric+. - # - # If +decimal+ is Infinity or NaN, returns NaN. - # - # BigMath.cos(BigMath.PI(4), 16).to_s - # #=> "-0.999999999999999999999999999999856613163740061349e0" - # - def cos(x, prec) - raise ArgumentError, "Zero or negative precision for cos" if prec <= 0 - return BigDecimal("NaN") if x.infinite? || x.nan? - n = prec + BigDecimal.double_fig - one = BigDecimal("1") - two = BigDecimal("2") - x = -x if x < 0 - if x > (twopi = two * BigMath.PI(prec)) - if x > 30 - x %= twopi - else - x -= twopi while x > twopi - end - end - x1 = one - x2 = x.mult(x,n) - sign = 1 - y = one - d = y - i = BigDecimal("0") - z = one - while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) - m = BigDecimal.double_fig if m < BigDecimal.double_fig - sign = -sign - x1 = x2.mult(x1,n) - i += two - z *= (i-one) * i - d = sign * x1.div(z,m) - y += d - end - y - end - - # call-seq: - # atan(decimal, numeric) -> BigDecimal - # - # Computes the arctangent of +decimal+ to the specified number of digits of - # precision, +numeric+. - # - # If +decimal+ is NaN, returns NaN. - # - # BigMath.atan(BigDecimal('-1'), 16).to_s - # #=> "-0.785398163397448309615660845819878471907514682065e0" - # - def atan(x, prec) - raise ArgumentError, "Zero or negative precision for atan" if prec <= 0 - return BigDecimal("NaN") if x.nan? - pi = PI(prec) - x = -x if neg = x < 0 - return pi.div(neg ? -2 : 2, prec) if x.infinite? - return pi / (neg ? -4 : 4) if x.round(prec) == 1 - x = BigDecimal("1").div(x, prec) if inv = x > 1 - x = (-1 + sqrt(1 + x**2, prec))/x if dbl = x > 0.5 - n = prec + BigDecimal.double_fig - y = x - d = y - t = x - r = BigDecimal("3") - x2 = x.mult(x,n) - while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0) - m = BigDecimal.double_fig if m < BigDecimal.double_fig - t = -t.mult(x2,n) - d = t.div(r,m) - y += d - r += 2 - end - y *= 2 if dbl - y = pi / 2 - y if inv - y = -y if neg - y - end - - # call-seq: - # PI(numeric) -> BigDecimal - # - # Computes the value of pi to the specified number of digits of precision, - # +numeric+. - # - # BigMath.PI(10).to_s - # #=> "0.3141592653589793238462643388813853786957412e1" - # - def PI(prec) - raise ArgumentError, "Zero or negative precision for PI" if prec <= 0 - n = prec + BigDecimal.double_fig - zero = BigDecimal("0") - one = BigDecimal("1") - two = BigDecimal("2") - - m25 = BigDecimal("-0.04") - m57121 = BigDecimal("-57121") - - pi = zero - - d = one - k = one - t = BigDecimal("-80") - while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0) - m = BigDecimal.double_fig if m < BigDecimal.double_fig - t = t*m25 - d = t.div(k,m) - k = k+two - pi = pi + d - end - - d = one - k = one - t = BigDecimal("956") - while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0) - m = BigDecimal.double_fig if m < BigDecimal.double_fig - t = t.div(m57121,n) - d = t.div(k,m) - pi = pi + d - k = k+two - end - pi - end - - # call-seq: - # E(numeric) -> BigDecimal - # - # Computes e (the base of natural logarithms) to the specified number of - # digits of precision, +numeric+. - # - # BigMath.E(10).to_s - # #=> "0.271828182845904523536028752390026306410273e1" - # - def E(prec) - raise ArgumentError, "Zero or negative precision for E" if prec <= 0 - BigMath.exp(1, prec) - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb deleted file mode 100644 index 85bacb7f2efbf..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/newton.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: false -require "bigdecimal/ludcmp" -require "bigdecimal/jacobian" - -# -# newton.rb -# -# Solves the nonlinear algebraic equation system f = 0 by Newton's method. -# This program is not dependent on BigDecimal. -# -# To call: -# n = nlsolve(f,x) -# where n is the number of iterations required, -# x is the initial value vector -# f is an Object which is used to compute the values of the equations to be solved. -# It must provide the following methods: -# -# f.values(x):: returns the values of all functions at x -# -# f.zero:: returns 0.0 -# f.one:: returns 1.0 -# f.two:: returns 2.0 -# f.ten:: returns 10.0 -# -# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal. -# -# On exit, x is the solution vector. -# -module Newton - include LUSolve - include Jacobian - module_function - - def norm(fv,zero=0.0) # :nodoc: - s = zero - n = fv.size - for i in 0...n do - s += fv[i]*fv[i] - end - s - end - - # See also Newton - def nlsolve(f,x) - nRetry = 0 - n = x.size - - f0 = f.values(x) - zero = f.zero - one = f.one - two = f.two - p5 = one/two - d = norm(f0,zero) - minfact = f.ten*f.ten*f.ten - minfact = one/minfact - e = f.eps - while d >= e do - nRetry += 1 - # Not yet converged. => Compute Jacobian matrix - dfdx = jacobian(f,f0,x) - # Solve dfdx*dx = -f0 to estimate dx - dx = lusolve(dfdx,f0,ludecomp(dfdx,n,zero,one),zero) - fact = two - xs = x.dup - begin - fact *= p5 - if fact < minfact then - raise "Failed to reduce function values." - end - for i in 0...n do - x[i] = xs[i] - dx[i]*fact - end - f0 = f.values(x) - dn = norm(f0,zero) - end while(dn>=d) - d = dn - end - nRetry - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb deleted file mode 100644 index 8bfc0ed8ed2a7..0000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib/bigdecimal/util.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: false -# -#-- -# bigdecimal/util extends various native classes to provide the #to_d method, -# and provides BigDecimal#to_d and BigDecimal#to_digits. -#++ - -require 'bigdecimal' - -class Integer < Numeric - # call-seq: - # int.to_d -> bigdecimal - # - # Returns the value of +int+ as a BigDecimal. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # 42.to_d # => 0.42e2 - # - # See also Kernel.BigDecimal. - # - def to_d - BigDecimal(self) - end -end - - -class Float < Numeric - # call-seq: - # float.to_d -> bigdecimal - # float.to_d(precision) -> bigdecimal - # - # Returns the value of +float+ as a BigDecimal. - # The +precision+ parameter is used to determine the number of - # significant digits for the result. When +precision+ is set to +0+, - # the number of digits to represent the float being converted is determined - # automatically. - # The default +precision+ is +0+. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # 0.5.to_d # => 0.5e0 - # 1.234.to_d # => 0.1234e1 - # 1.234.to_d(2) # => 0.12e1 - # - # See also Kernel.BigDecimal. - # - def to_d(precision=0) - BigDecimal(self, precision) - end -end - - -class String - # call-seq: - # str.to_d -> bigdecimal - # - # Returns the result of interpreting leading characters in +str+ - # as a BigDecimal. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # "0.5".to_d # => 0.5e0 - # "123.45e1".to_d # => 0.12345e4 - # "45.67 degrees".to_d # => 0.4567e2 - # - # See also Kernel.BigDecimal. - # - def to_d - BigDecimal.interpret_loosely(self) - end -end - - -class BigDecimal < Numeric - # call-seq: - # a.to_digits -> string - # - # Converts a BigDecimal to a String of the form "nnnnnn.mmm". - # This method is deprecated; use BigDecimal#to_s("F") instead. - # - # require 'bigdecimal/util' - # - # d = BigDecimal("3.14") - # d.to_digits # => "3.14" - # - def to_digits - if self.nan? || self.infinite? || self.zero? - self.to_s - else - i = self.to_i.to_s - _,f,_,z = self.frac.split - i + "." + ("0"*(-z)) + f - end - end - - # call-seq: - # a.to_d -> bigdecimal - # - # Returns self. - # - # require 'bigdecimal/util' - # - # d = BigDecimal("3.14") - # d.to_d # => 0.314e1 - # - def to_d - self - end -end - - -class Rational < Numeric - # call-seq: - # rat.to_d(precision) -> bigdecimal - # - # Returns the value as a BigDecimal. - # - # The required +precision+ parameter is used to determine the number of - # significant digits for the result. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # Rational(22, 7).to_d(3) # => 0.314e1 - # - # See also Kernel.BigDecimal. - # - def to_d(precision) - BigDecimal(self, precision) - end -end - - -class Complex < Numeric - # call-seq: - # cmp.to_d -> bigdecimal - # cmp.to_d(precision) -> bigdecimal - # - # Returns the value as a BigDecimal. - # - # The +precision+ parameter is required for a rational complex number. - # This parameter is used to determine the number of significant digits - # for the result. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 - # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 - # - # See also Kernel.BigDecimal. - # - def to_d(*args) - BigDecimal(self) unless self.imag.zero? # to raise eerror - - if args.length == 0 - case self.real - when Rational - BigDecimal(self.real) # to raise error - end - end - self.real.to_d(*args) - end -end - - -class NilClass - # call-seq: - # nil.to_d -> bigdecimal - # - # Returns nil represented as a BigDecimal. - # - # require 'bigdecimal' - # require 'bigdecimal/util' - # - # nil.to_d # => 0.0 - # - def to_d - BigDecimal(0) - end -end