Merge pull request #20244 from Homebrew/dependabot/bundler/Library/Homebrew/dependabot-9b21bfb7c6

build(deps): bump the dependabot group across 1 directory with 25 updates
This commit is contained in:
Patrick Linnane 2025-07-14 20:05:56 +00:00 committed by GitHub
commit fe81c46f9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
179 changed files with 6673 additions and 8146 deletions

View File

@ -451,8 +451,6 @@ jobs:
- run: brew test-bot --only-cleanup-before - run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- name: Run brew bundle and brew services integration tests - name: Run brew bundle and brew services integration tests
run: | run: |
cat <<EOS >> Brewfile cat <<EOS >> Brewfile

1
.gitignore vendored
View File

@ -116,6 +116,7 @@
**/vendor/bundle/ruby/*/gems/rdoc-*/ **/vendor/bundle/ruby/*/gems/rdoc-*/
**/vendor/bundle/ruby/*/gems/redcarpet-*/ **/vendor/bundle/ruby/*/gems/redcarpet-*/
**/vendor/bundle/ruby/*/gems/regexp_parser-*/ **/vendor/bundle/ruby/*/gems/regexp_parser-*/
**/vendor/bundle/ruby/*/gems/require-hooks-*/
**/vendor/bundle/ruby/*/gems/rexml-*/ **/vendor/bundle/ruby/*/gems/rexml-*/
**/vendor/bundle/ruby/*/gems/rspec-*/ **/vendor/bundle/ruby/*/gems/rspec-*/
**/vendor/bundle/ruby/*/gems/rspec-core-*/ **/vendor/bundle/ruby/*/gems/rspec-core-*/

View File

@ -216,6 +216,10 @@ Naming/MethodParameterName:
merge: merge:
- AllowedNames - AllowedNames
# Allows a nicer API for boolean methods with side effects.
Naming/PredicateMethod:
AllowBangMethods: true
# Both styles are used depending on context, # Both styles are used depending on context,
# e.g. `sha256` and `something_countable_1`. # e.g. `sha256` and `something_countable_1`.
Naming/VariableNumber: Naming/VariableNumber:

View File

@ -10,7 +10,13 @@ Homebrew/MoveToExtendOS:
- "{extend,test,requirements}/**/*" - "{extend,test,requirements}/**/*"
- "os.rb" - "os.rb"
Naming/PredicateName: # We don't use Sorbet for RSpec tests so let's disable this there.
Sorbet/BlockMethodDefinition:
Exclude:
- test/**/*
# Want to preserve our own API for these methods for now.
Naming/PredicatePrefix:
inherit_mode: inherit_mode:
merge: merge:
- AllowedMethods - AllowedMethods

View File

@ -4,20 +4,20 @@ GEM
addressable (2.8.7) addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0) public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3) ast (2.4.3)
base64 (0.2.0) base64 (0.3.0)
benchmark (0.4.0) benchmark (0.4.1)
bigdecimal (3.1.9) bigdecimal (3.2.2)
bindata (2.5.1) bindata (2.5.1)
coderay (1.1.3) coderay (1.1.3)
concurrent-ruby (1.3.5) concurrent-ruby (1.3.5)
csv (3.3.4) csv (3.3.5)
diff-lcs (1.6.2) diff-lcs (1.6.2)
docile (1.4.1) docile (1.4.1)
elftools (1.3.1) elftools (1.3.1)
bindata (~> 2) bindata (~> 2)
erubi (1.13.1) erubi (1.13.1)
hana (1.3.7) hana (1.3.7)
json (2.12.0) json (2.12.2)
json_schemer (2.4.0) json_schemer (2.4.0)
bigdecimal bigdecimal
hana (~> 1.3) hana (~> 1.3)
@ -32,7 +32,7 @@ GEM
minitest (5.25.5) minitest (5.25.5)
netrc (0.11.0) netrc (0.11.0)
parallel (1.27.0) parallel (1.27.0)
parallel_tests (5.2.0) parallel_tests (5.3.0)
parallel parallel
parser (3.3.8.0) parser (3.3.8.0)
ast (~> 2.4.1) ast (~> 2.4.1)
@ -48,37 +48,38 @@ GEM
pycall (1.5.2) pycall (1.5.2)
racc (1.8.1) racc (1.8.1)
rainbow (3.1.1) rainbow (3.1.1)
rbi (0.3.3) rbi (0.3.6)
prism (~> 1.0) prism (~> 1.0)
rbs (>= 3.4.4) rbs (>= 3.4.4)
sorbet-runtime (>= 0.5.9204) rbs (4.0.0.dev.4)
rbs (3.9.4)
logger logger
prism (>= 1.3.0)
redcarpet (3.6.1) redcarpet (3.6.1)
regexp_parser (2.10.0) regexp_parser (2.10.0)
require-hooks (0.2.2)
rexml (3.4.1) rexml (3.4.1)
rspec (3.13.0) rspec (3.13.1)
rspec-core (~> 3.13.0) rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0) rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0) rspec-mocks (~> 3.13.0)
rspec-core (3.13.3) rspec-core (3.13.5)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
rspec-expectations (3.13.4) rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
rspec-github (3.0.0) rspec-github (3.0.0)
rspec-core (~> 3.0) rspec-core (~> 3.0)
rspec-mocks (3.13.4) rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
rspec-retry (0.6.2) rspec-retry (0.6.2)
rspec-core (> 3.3) rspec-core (> 3.3)
rspec-sorbet (1.9.2) rspec-sorbet (1.9.2)
sorbet-runtime sorbet-runtime
rspec-support (3.13.3) rspec-support (3.13.4)
rspec_junit_formatter (0.6.0) rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.75.6) rubocop (1.77.0)
json (~> 2.3) json (~> 2.3)
language_server-protocol (~> 3.17.0.2) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0) lint_roller (~> 1.1.0)
@ -86,10 +87,10 @@ GEM
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0) rubocop-ast (>= 1.45.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.1) rubocop-ast (1.45.1)
parser (>= 3.3.7.2) parser (>= 3.3.7.2)
prism (~> 1.4) prism (~> 1.4)
rubocop-md (2.0.1) rubocop-md (2.0.1)
@ -102,15 +103,17 @@ GEM
rubocop-rspec (3.6.0) rubocop-rspec (3.6.0)
lint_roller (~> 1.1) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1) rubocop (~> 1.72, >= 1.72.1)
rubocop-sorbet (0.10.0) rubocop-sorbet (0.10.5)
rubocop (>= 1) lint_roller
ruby-lsp (0.23.21) rubocop (>= 1.75.2)
ruby-lsp (0.24.2)
language_server-protocol (~> 3.17.0) language_server-protocol (~> 3.17.0)
prism (>= 1.2, < 2.0) prism (>= 1.2, < 2.0)
rbs (>= 3, < 4) rbs (>= 3, < 5)
sorbet-runtime (>= 0.5.10782) sorbet-runtime (>= 0.5.10782)
ruby-macho (4.1.0) ruby-macho (4.1.0)
ruby-prof (1.7.1) ruby-prof (1.7.2)
base64
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
simplecov (0.22.0) simplecov (0.22.0)
docile (~> 1.1) docile (~> 1.1)
@ -122,38 +125,40 @@ GEM
simplecov-html (0.13.1) simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4) simplecov_json_formatter (0.1.4)
simpleidn (0.2.3) simpleidn (0.2.3)
sorbet (0.5.12117) sorbet (0.5.12222)
sorbet-static (= 0.5.12117) sorbet-static (= 0.5.12222)
sorbet-runtime (0.5.12117) sorbet-runtime (0.5.12222)
sorbet-static (0.5.12117-aarch64-linux) sorbet-static (0.5.12222-aarch64-linux)
sorbet-static (0.5.12117-universal-darwin) sorbet-static (0.5.12222-universal-darwin)
sorbet-static (0.5.12117-x86_64-linux) sorbet-static (0.5.12222-x86_64-linux)
sorbet-static-and-runtime (0.5.12117) sorbet-static-and-runtime (0.5.12222)
sorbet (= 0.5.12117) sorbet (= 0.5.12222)
sorbet-runtime (= 0.5.12117) sorbet-runtime (= 0.5.12222)
spoom (1.6.3) spoom (1.7.4)
erubi (>= 1.10.0) erubi (>= 1.10.0)
prism (>= 0.28.0) prism (>= 0.28.0)
rbi (>= 0.3.3) rbi (>= 0.3.3)
rbs (>= 4.0.0.dev.4)
rexml (>= 3.2.6) rexml (>= 3.2.6)
sorbet-static-and-runtime (>= 0.5.10187) sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2) thor (>= 0.19.2)
stackprof (0.2.27) stackprof (0.2.27)
tapioca (0.16.11) tapioca (0.17.5)
benchmark benchmark
bundler (>= 2.2.25) bundler (>= 2.2.25)
netrc (>= 0.11.0) netrc (>= 0.11.0)
parallel (>= 1.21.0) parallel (>= 1.21.0)
rbi (~> 0.2) rbi (>= 0.3.1)
require-hooks (>= 0.2.2)
sorbet-static-and-runtime (>= 0.5.11087) sorbet-static-and-runtime (>= 0.5.11087)
spoom (>= 1.2.0) spoom (>= 1.7.0)
thor (>= 1.2.0) thor (>= 1.2.0)
yard-sorbet yard-sorbet
thor (1.3.2) thor (1.3.2)
unicode-display_width (3.1.4) unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4) unicode-emoji (4.0.4)
vernier (1.7.1) vernier (1.8.0)
warning (1.5.0) warning (1.5.0)
yard (0.9.37) yard (0.9.37)
yard-sorbet (0.9.0) yard-sorbet (0.9.0)

View File

@ -142,7 +142,7 @@ module Homebrew
end end
sig { params(names: T::Array[String], type: String, regenerate: T::Boolean).returns(T::Boolean) } sig { params(names: T::Array[String], type: String, regenerate: T::Boolean).returns(T::Boolean) }
def self.write_names_file(names, type, regenerate:) def self.write_names_file!(names, type, regenerate:)
names_path = HOMEBREW_CACHE_API/"#{type}_names.txt" names_path = HOMEBREW_CACHE_API/"#{type}_names.txt"
if !names_path.exist? || regenerate if !names_path.exist? || regenerate
names_path.write(names.join("\n")) names_path.write(names.join("\n"))

View File

@ -28,7 +28,7 @@ module Homebrew
sig { params(cask: ::Cask::Cask).returns(::Cask::Cask) } sig { params(cask: ::Cask::Cask).returns(::Cask::Cask) }
def self.source_download(cask) def self.source_download(cask)
path = cask.ruby_source_path.to_s || "Casks/#{cask.token}.rb" path = cask.ruby_source_path.to_s
sha256 = cask.ruby_source_checksum[:sha256] sha256 = cask.ruby_source_checksum[:sha256]
checksum = Checksum.new(sha256) if sha256 checksum = Checksum.new(sha256) if sha256
git_head = cask.tap_git_head || "HEAD" git_head = cask.tap_git_head || "HEAD"
@ -95,7 +95,7 @@ module Homebrew
def self.write_names(regenerate: false) def self.write_names(regenerate: false)
download_and_cache_data! unless cache.key?("casks") download_and_cache_data! unless cache.key?("casks")
Homebrew::API.write_names_file(all_casks.keys, "cask", regenerate:) Homebrew::API.write_names_file!(all_casks.keys, "cask", regenerate:)
end end
end end
end end

View File

@ -129,7 +129,7 @@ module Homebrew
def self.write_names_and_aliases(regenerate: false) def self.write_names_and_aliases(regenerate: false)
download_and_cache_data! unless cache.key?("formulae") download_and_cache_data! unless cache.key?("formulae")
return unless Homebrew::API.write_names_file(all_formulae.keys, "formula", regenerate:) return unless Homebrew::API.write_names_file!(all_formulae.keys, "formula", regenerate:)
(HOMEBREW_CACHE_API/"formula_aliases.txt").open("w") do |file| (HOMEBREW_CACHE_API/"formula_aliases.txt").open("w") do |file|
all_aliases.each do |alias_name, real_name| all_aliases.each do |alias_name, real_name|

View File

@ -91,7 +91,7 @@ class Bottle
def fetch(verify_download_integrity: true, timeout: nil, quiet: false) def fetch(verify_download_integrity: true, timeout: nil, quiet: false)
resource.fetch(verify_download_integrity:, timeout:, quiet:) resource.fetch(verify_download_integrity:, timeout:, quiet:)
rescue DownloadError rescue DownloadError
raise unless fallback_on_error raise unless fallback_on_error?
fetch_tab fetch_tab
retry retry
@ -121,7 +121,7 @@ class Bottle
begin begin
resource.fetch(timeout:, quiet:) resource.fetch(timeout:, quiet:)
rescue DownloadError rescue DownloadError
raise unless fallback_on_error raise unless fallback_on_error?
retry retry
rescue Resource::BottleManifest::Error rescue Resource::BottleManifest::Error
@ -193,7 +193,7 @@ class Bottle
specs specs
end end
def fallback_on_error def fallback_on_error?
# Use the default bottle domain as a fallback mirror # Use the default bottle domain as a fallback mirror
if @resource.url.start_with?(Homebrew::EnvConfig.bottle_domain) && if @resource.url.start_with?(Homebrew::EnvConfig.bottle_domain) &&
Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN

View File

@ -41,7 +41,7 @@ module Homebrew
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def mas_installed? def mas_installed?
@mas_installed ||= which_formula("mas") @mas_installed ||= which_formula?("mas")
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
@ -59,7 +59,7 @@ module Homebrew
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def whalebrew_installed? def whalebrew_installed?
@whalebrew_installed ||= which_formula("whalebrew") @whalebrew_installed ||= which_formula?("whalebrew")
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
@ -70,7 +70,7 @@ module Homebrew
end end
sig { params(name: String).returns(T::Boolean) } sig { params(name: String).returns(T::Boolean) }
def which_formula(name) def which_formula?(name)
formula = Formulary.factory(name) formula = Formulary.factory(name)
ENV["PATH"] = "#{formula.opt_bin}:#{ENV.fetch("PATH", nil)}" if formula.any_version_installed? ENV["PATH"] = "#{formula.opt_bin}:#{ENV.fetch("PATH", nil)}" if formula.any_version_installed?
which(name).present? which(name).present?

View File

@ -18,7 +18,7 @@ module Homebrew
Homebrew::Bundle::CaskDumper.cask_is_outdated_using_greedy?(name) Homebrew::Bundle::CaskDumper.cask_is_outdated_using_greedy?(name)
end end
def self.preinstall(name, no_upgrade: false, verbose: false, **options) def self.preinstall!(name, no_upgrade: false, verbose: false, **options)
if installed_casks.include?(name) && !upgrading?(no_upgrade, name, options) if installed_casks.include?(name) && !upgrading?(no_upgrade, name, options)
puts "Skipping install of #{name} cask. It is already installed." if verbose puts "Skipping install of #{name} cask. It is already installed." if verbose
return false return false
@ -27,7 +27,7 @@ module Homebrew
true true
end end
def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options)
return true unless preinstall return true unless preinstall
full_name = options.fetch(:full_name, name) full_name = options.fetch(:full_name, name)

View File

@ -37,12 +37,12 @@ module Homebrew
if casks.any? if casks.any?
args = zap ? ["--zap"] : [] args = zap ? ["--zap"] : []
Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--cask", *args, "--force", *casks Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--cask", *args, "--force", *casks
puts "Uninstalled #{casks.size} cask#{(casks.size == 1) ? "" : "s"}" puts "Uninstalled #{casks.size} cask#{"s" if casks.size != 1}"
end end
if formulae.any? if formulae.any?
Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--formula", "--force", *formulae Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--formula", "--force", *formulae
puts "Uninstalled #{formulae.size} formula#{(formulae.size == 1) ? "" : "e"}" puts "Uninstalled #{formulae.size} formula#{"e" if formulae.size != 1}"
end end
Kernel.system HOMEBREW_BREW_FILE, "untap", *taps if taps.any? Kernel.system HOMEBREW_BREW_FILE, "untap", *taps if taps.any?

View File

@ -11,7 +11,7 @@ module Homebrew
def self.run(global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, force: false, def self.run(global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, force: false,
quiet: false) quiet: false)
@dsl = Brewfile.read(global:, file:) @dsl = Brewfile.read(global:, file:)
Homebrew::Bundle::Installer.install( Homebrew::Bundle::Installer.install!(
@dsl.entries, @dsl.entries,
global:, file:, no_lock:, no_upgrade:, verbose:, force:, quiet:, global:, file:, no_lock:, no_upgrade:, verbose:, force:, quiet:,
) || exit(1) ) || exit(1)

View File

@ -10,12 +10,12 @@ module Homebrew
@pinned_formulae = nil @pinned_formulae = nil
end end
def self.preinstall(name, no_upgrade: false, verbose: false, **options) def self.preinstall!(name, no_upgrade: false, verbose: false, **options)
new(name, options).preinstall(no_upgrade:, verbose:) new(name, options).preinstall!(no_upgrade:, verbose:)
end end
def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options)
new(name, options).install(preinstall:, no_upgrade:, verbose:, force:) new(name, options).install!(preinstall:, no_upgrade:, verbose:, force:)
end end
def initialize(name, options = {}) def initialize(name, options = {})
@ -31,7 +31,7 @@ module Homebrew
@changed = nil @changed = nil
end end
def preinstall(no_upgrade: false, verbose: false) def preinstall!(no_upgrade: false, verbose: false)
if installed? && (self.class.no_upgrade_with_args?(no_upgrade, @name) || !upgradable?) if installed? && (self.class.no_upgrade_with_args?(no_upgrade, @name) || !upgradable?)
puts "Skipping install of #{@name} formula. It is already installed." if verbose puts "Skipping install of #{@name} formula. It is already installed." if verbose
@changed = nil @changed = nil
@ -41,7 +41,7 @@ module Homebrew
true true
end end
def install(preinstall: true, no_upgrade: false, verbose: false, force: false) def install!(preinstall: true, no_upgrade: false, verbose: false, force: false)
install_result = if preinstall install_result = if preinstall
install_change_state!(no_upgrade:, verbose:, force:) install_change_state!(no_upgrade:, verbose:, force:)
else else
@ -80,9 +80,9 @@ module Homebrew
return false unless resolve_conflicts!(verbose:) return false unless resolve_conflicts!(verbose:)
if installed? if installed?
upgrade!(verbose:, force:) upgrade_formula!(verbose:, force:)
else else
install!(verbose:, force:) install_formula!(verbose:, force:)
end end
end end
@ -282,7 +282,7 @@ module Homebrew
true true
end end
def install!(verbose:, force:) def install_formula!(verbose:, force:)
install_args = @args.dup install_args = @args.dup
install_args << "--force" << "--overwrite" if force install_args << "--force" << "--overwrite" if force
install_args << "--skip-link" if @link == false install_args << "--skip-link" if @link == false
@ -298,7 +298,7 @@ module Homebrew
true true
end end
def upgrade!(verbose:, force:) def upgrade_formula!(verbose:, force:)
upgrade_args = [] upgrade_args = []
upgrade_args << "--force" if force upgrade_args << "--force" if force
with_args = " with #{upgrade_args.join(" ")}" if upgrade_args.present? with_args = " with #{upgrade_args.join(" ")}" if upgrade_args.present?

View File

@ -13,8 +13,8 @@ require "bundle/skipper"
module Homebrew module Homebrew
module Bundle module Bundle
module Installer module Installer
def self.install(entries, global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, def self.install!(entries, global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false,
force: false, quiet: false) force: false, quiet: false)
success = 0 success = 0
failure = 0 failure = 0
@ -49,7 +49,7 @@ module Homebrew
next if cls.nil? next if cls.nil?
next if Homebrew::Bundle::Skipper.skip? entry next if Homebrew::Bundle::Skipper.skip? entry
preinstall = if cls.preinstall(*args, **options, no_upgrade:, verbose:) preinstall = if cls.preinstall!(*args, **options, no_upgrade:, verbose:)
puts Formatter.success("#{verb} #{name}") puts Formatter.success("#{verb} #{name}")
true true
else else
@ -57,7 +57,7 @@ module Homebrew
false false
end end
if cls.install(*args, **options, if cls.install!(*args, **options,
preinstall:, no_upgrade:, verbose:, force:) preinstall:, no_upgrade:, verbose:, force:)
success += 1 success += 1
else else

View File

@ -11,7 +11,7 @@ module Homebrew
@outdated_app_ids = nil @outdated_app_ids = nil
end end
def self.preinstall(name, id, no_upgrade: false, verbose: false) def self.preinstall!(name, id, no_upgrade: false, verbose: false)
unless Bundle.mas_installed? unless Bundle.mas_installed?
puts "Installing mas. It is not currently installed." if verbose puts "Installing mas. It is not currently installed." if verbose
Bundle.brew("install", "mas", verbose:) Bundle.brew("install", "mas", verbose:)
@ -27,7 +27,7 @@ module Homebrew
true true
end end
def self.install(name, id, preinstall: true, no_upgrade: false, verbose: false, force: false) def self.install!(name, id, preinstall: true, no_upgrade: false, verbose: false, force: false)
return true unless preinstall return true unless preinstall
if app_id_installed?(id) if app_id_installed?(id)

View File

@ -4,7 +4,7 @@
module Homebrew module Homebrew
module Bundle module Bundle
module TapInstaller module TapInstaller
def self.preinstall(name, verbose: false, **_options) def self.preinstall!(name, verbose: false, **_options)
if installed_taps.include? name if installed_taps.include? name
puts "Skipping install of #{name} tap. It is already installed." if verbose puts "Skipping install of #{name} tap. It is already installed." if verbose
return false return false
@ -13,7 +13,7 @@ module Homebrew
true true
end end
def self.install(name, preinstall: true, verbose: false, force: false, **options) def self.install!(name, preinstall: true, verbose: false, force: false, **options)
return true unless preinstall return true unless preinstall
puts "Installing #{name} tap. It is not currently installed." if verbose puts "Installing #{name} tap. It is not currently installed." if verbose

View File

@ -8,7 +8,7 @@ module Homebrew
@installed_extensions = nil @installed_extensions = nil
end end
def self.preinstall(name, no_upgrade: false, verbose: false) def self.preinstall!(name, no_upgrade: false, verbose: false)
if !Bundle.vscode_installed? && Bundle.cask_installed? if !Bundle.vscode_installed? && Bundle.cask_installed?
puts "Installing visual-studio-code. It is not currently installed." if verbose puts "Installing visual-studio-code. It is not currently installed." if verbose
Bundle.brew("install", "--cask", "visual-studio-code", verbose:) Bundle.brew("install", "--cask", "visual-studio-code", verbose:)
@ -24,7 +24,7 @@ module Homebrew
true true
end end
def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false) def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false)
return true unless preinstall return true unless preinstall
return true if extension_installed?(name) return true if extension_installed?(name)

View File

@ -8,7 +8,7 @@ module Homebrew
@installed_images = nil @installed_images = nil
end end
def self.preinstall(name, verbose: false, **_options) def self.preinstall!(name, verbose: false, **_options)
unless Bundle.whalebrew_installed? unless Bundle.whalebrew_installed?
puts "Installing whalebrew. It is not currently installed." if verbose puts "Installing whalebrew. It is not currently installed." if verbose
Bundle.brew("install", "--formula", "whalebrew", verbose:) Bundle.brew("install", "--formula", "whalebrew", verbose:)
@ -23,7 +23,7 @@ module Homebrew
true true
end end
def self.install(name, preinstall: true, verbose: false, force: false, **_options) def self.install!(name, preinstall: true, verbose: false, force: false, **_options)
odeprecated "`brew bundle` `whalebrew` support", "using `whalebrew` directly" odeprecated "`brew bundle` `whalebrew` support", "using `whalebrew` directly"
return true unless preinstall return true unless preinstall

View File

@ -189,7 +189,7 @@ on_request: true)
when :deprecated when :deprecated
opoo message_full opoo message_full
when :disabled when :disabled
GitHub::Actions.puts_annotation_if_env_set(:error, message) GitHub::Actions.puts_annotation_if_env_set!(:error, message)
raise CaskCannotBeInstalledError.new(@cask, message) raise CaskCannotBeInstalledError.new(@cask, message)
end end
end end

View File

@ -23,7 +23,7 @@ module Cask
require_sha: T.nilable(T::Boolean), require_sha: T.nilable(T::Boolean),
).returns(T::Boolean) ).returns(T::Boolean)
} }
def self.upgrade_casks( def self.upgrade_casks!(
*casks, *casks,
args:, args:,
force: false, force: false,
@ -134,7 +134,7 @@ module Cask
return true if caught_exceptions.empty? return true if caught_exceptions.empty?
raise MultipleCaskErrors, caught_exceptions if caught_exceptions.count > 1 raise MultipleCaskErrors, caught_exceptions if caught_exceptions.count > 1
raise caught_exceptions.fetch(0) if caught_exceptions.count == 1 raise caught_exceptions.fetch(0) if caught_exceptions.one?
false false
end end

View File

@ -194,7 +194,7 @@ class Caveats
startup = formula.service.requires_root? startup = formula.service.requires_root?
if Utils::Service.running?(formula) if Utils::Service.running?(formula)
s << "To restart #{formula.full_name} after an upgrade:" s << "To restart #{formula.full_name} after an upgrade:"
s << " #{startup ? "sudo " : ""}brew services restart #{formula.full_name}" s << " #{"sudo " if startup}brew services restart #{formula.full_name}"
elsif startup elsif startup
s << "To start #{formula.full_name} now and restart at startup:" s << "To start #{formula.full_name} now and restart at startup:"
s << " sudo brew services start #{formula.full_name}" s << " sudo brew services start #{formula.full_name}"

View File

@ -259,7 +259,7 @@ module Homebrew
if !Homebrew::EnvConfig.no_install_upgrade? && installed_casks.any? if !Homebrew::EnvConfig.no_install_upgrade? && installed_casks.any?
require "cask/upgrade" require "cask/upgrade"
Cask::Upgrade.upgrade_casks( Cask::Upgrade.upgrade_casks!(
*installed_casks, *installed_casks,
force: args.force?, force: args.force?,
dry_run: args.dry_run?, dry_run: args.dry_run?,

View File

@ -52,8 +52,8 @@ module Homebrew
version = Keg.new(path).version version = Keg.new(path).version
major_version = version.major.to_i major_version = version.major.to_i
minor_version = version.minor.to_i || 0 minor_version = version.minor.to_i
patch_version = version.patch.to_i || 0 patch_version = version.patch.to_i
minor_version_range, patch_version_range = if Homebrew::EnvConfig.env_sync_strict? minor_version_range, patch_version_range = if Homebrew::EnvConfig.env_sync_strict?
# Only create symlinks for the exact installed patch version. # Only create symlinks for the exact installed patch version.

View File

@ -53,7 +53,7 @@ module Homebrew
version = Keg.new(path).version version = Keg.new(path).version
major_version = version.major.to_i major_version = version.major.to_i
minor_version = version.minor.to_i minor_version = version.minor.to_i
patch_version = version.patch.to_i || 0 patch_version = version.patch.to_i
patch_version_range = if Homebrew::EnvConfig.env_sync_strict? patch_version_range = if Homebrew::EnvConfig.env_sync_strict?
# Only create symlinks for the exact installed patch version. # Only create symlinks for the exact installed patch version.

View File

@ -65,7 +65,7 @@ module Homebrew
sig { override.void } sig { override.void }
def run def run
return if search_package_manager return if search_package_manager!
query = args.named.join(" ") query = args.named.join(" ")
string_or_regex = Search.query_regexp(query) string_or_regex = Search.query_regexp(query)
@ -108,7 +108,7 @@ module Homebrew
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def search_package_manager def search_package_manager!
package_manager = PACKAGE_MANAGERS.find { |name,| args.public_send(:"#{name}?") } package_manager = PACKAGE_MANAGERS.find { |name,| args.public_send(:"#{name}?") }
return false if package_manager.nil? return false if package_manager.nil?

View File

@ -137,8 +137,8 @@ module Homebrew
formulae = Homebrew::Attestation.sort_formulae_for_install(formulae) if Homebrew::Attestation.enabled? formulae = Homebrew::Attestation.sort_formulae_for_install(formulae) if Homebrew::Attestation.enabled?
upgrade_outdated_formulae(formulae) unless only_upgrade_casks upgrade_outdated_formulae!(formulae) unless only_upgrade_casks
upgrade_outdated_casks(casks) unless only_upgrade_formulae upgrade_outdated_casks!(casks) unless only_upgrade_formulae
Cleanup.periodic_clean!(dry_run: args.dry_run?) Cleanup.periodic_clean!(dry_run: args.dry_run?)
@ -148,7 +148,7 @@ module Homebrew
private private
sig { params(formulae: T::Array[Formula]).returns(T::Boolean) } sig { params(formulae: T::Array[Formula]).returns(T::Boolean) }
def upgrade_outdated_formulae(formulae) def upgrade_outdated_formulae!(formulae)
return false if args.cask? return false if args.cask?
if args.build_from_source? if args.build_from_source?
@ -280,12 +280,12 @@ module Homebrew
end end
sig { params(casks: T::Array[Cask::Cask]).returns(T::Boolean) } sig { params(casks: T::Array[Cask::Cask]).returns(T::Boolean) }
def upgrade_outdated_casks(casks) def upgrade_outdated_casks!(casks)
return false if args.formula? return false if args.formula?
Install.ask_casks casks if args.ask? Install.ask_casks casks if args.ask?
Cask::Upgrade.upgrade_casks( Cask::Upgrade.upgrade_casks!(
*casks, *casks,
force: args.force?, force: args.force?,
greedy: args.greedy?, greedy: args.greedy?,

View File

@ -723,7 +723,7 @@ module Homebrew
all_bottle = !args.no_all_checks? && all_bottle = !args.no_all_checks? &&
(!old_bottle_spec_matches || bottle.rebuild != old_bottle_spec.rebuild) && (!old_bottle_spec_matches || bottle.rebuild != old_bottle_spec.rebuild) &&
tag_hashes.count > 1 && tag_hashes.count > 1 &&
tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1 tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.one?
old_all_bottle = old_bottle_spec.tag?(Utils::Bottles.tag(:all)) old_all_bottle = old_bottle_spec.tag?(Utils::Bottles.tag(:all))
if !all_bottle && old_all_bottle && !args.no_all_checks? if !all_bottle && old_all_bottle && !args.no_all_checks?

View File

@ -589,7 +589,7 @@ module Homebrew
#{leading_spaces}resource "#{resource.name}" do #{leading_spaces}resource "#{resource.name}" do
#{leading_spaces} url "#{new_url}"#{new_mirrors.map { |m| "\n#{leading_spaces} mirror \"#{m}\"" }.join} #{leading_spaces} url "#{new_url}"#{new_mirrors.map { |m| "\n#{leading_spaces} mirror \"#{m}\"" }.join}
#{leading_spaces} sha256 "#{new_hash}" #{leading_spaces} sha256 "#{new_hash}"
#{forced_version ? "#{leading_spaces} version \"#{version}\"\n" : ""} #{"#{leading_spaces} version \"#{version}\"\n" if forced_version}
#{leading_spaces} livecheck do #{leading_spaces} livecheck do
#{leading_spaces} formula :parent #{leading_spaces} formula :parent
#{leading_spaces} end #{leading_spaces} end

View File

@ -180,7 +180,7 @@ module Homebrew
formulae_and_casks.each_with_index do |formula_or_cask, i| formulae_and_casks.each_with_index do |formula_or_cask, i|
puts if i.positive? puts if i.positive?
next if skip_ineligible_formulae(formula_or_cask) next if skip_ineligible_formulae!(formula_or_cask)
use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask) use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask)
name = Livecheck.package_or_resource_name(formula_or_cask, full_name: use_full_name) name = Livecheck.package_or_resource_name(formula_or_cask, full_name: use_full_name)
@ -204,7 +204,7 @@ module Homebrew
sig { sig {
params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T::Boolean) params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T::Boolean)
} }
def skip_ineligible_formulae(formula_or_cask) def skip_ineligible_formulae!(formula_or_cask)
if formula_or_cask.is_a?(Formula) if formula_or_cask.is_a?(Formula)
skip = formula_or_cask.disabled? || formula_or_cask.head_only? skip = formula_or_cask.disabled? || formula_or_cask.head_only?
name = formula_or_cask.name name = formula_or_cask.name

View File

@ -587,7 +587,7 @@ module Homebrew
EOS EOS
end end
def __check_linked_brew(formula) def __check_linked_brew!(formula)
formula.installed_prefixes.each do |prefix| formula.installed_prefixes.each do |prefix|
prefix.find do |src| prefix.find do |src|
next if src == prefix next if src == prefix

View File

@ -341,7 +341,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
.reject { |path| path.extname.end_with?(".incomplete") } .reject { |path| path.extname.end_with?(".incomplete") }
@cached_location = T.let( @cached_location = T.let(
if downloads.count == 1 if downloads.one?
downloads.fetch(0) downloads.fetch(0)
else else
HOMEBREW_CACHE/"downloads/#{url_sha256}--#{Utils.safe_filename(resolved_basename)}" HOMEBREW_CACHE/"downloads/#{url_sha256}--#{Utils.safe_filename(resolved_basename)}"

View File

@ -20,11 +20,11 @@ class File
# file.write('hello') # file.write('hello')
# end # end
sig { sig {
type_parameters(:out).params( type_parameters(:Out).params(
file_name: T.any(Pathname, String), file_name: T.any(Pathname, String),
temp_dir: String, temp_dir: String,
_block: T.proc.params(arg0: Tempfile).returns(T.type_parameter(:out)), _block: T.proc.params(arg0: Tempfile).returns(T.type_parameter(:Out)),
).returns(T.type_parameter(:out)) ).returns(T.type_parameter(:Out))
} }
def self.atomic_write(file_name, temp_dir = dirname(file_name), &_block) def self.atomic_write(file_name, temp_dir = dirname(file_name), &_block)
require "tempfile" unless defined?(Tempfile) require "tempfile" unless defined?(Tempfile)

View File

@ -3,18 +3,18 @@
class Hash class Hash
sig { sig {
type_parameters(:k2).params( type_parameters(:K2).params(
other_hash: T::Hash[T.type_parameter(:k2), T.untyped], other_hash: T::Hash[T.type_parameter(:K2), T.untyped],
block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)), block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)),
).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped]) ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:K2)), T.untyped])
} }
def deep_merge(other_hash, &block); end def deep_merge(other_hash, &block); end
sig { sig {
type_parameters(:k2).params( type_parameters(:K2).params(
other_hash: T::Hash[T.type_parameter(:k2), T.untyped], other_hash: T::Hash[T.type_parameter(:K2), T.untyped],
block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)), block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)),
).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped]) ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:K2)), T.untyped])
} }
def deep_merge!(other_hash, &block); end def deep_merge!(other_hash, &block); end
end end

View File

@ -2,16 +2,16 @@
class Hash class Hash
sig { sig {
type_parameters(:out).params( type_parameters(:Out).params(
block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)), block: T.proc.params(o: Hash::V).returns(T.type_parameter(:Out)),
).returns(T::Hash[Hash::K, T.type_parameter(:out)]) ).returns(T::Hash[Hash::K, T.type_parameter(:Out)])
} }
def deep_transform_values(&block); end def deep_transform_values(&block); end
sig { sig {
type_parameters(:out).params( type_parameters(:Out).params(
block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)), block: T.proc.params(o: Hash::V).returns(T.type_parameter(:Out)),
).returns(T::Hash[Hash::K, T.type_parameter(:out)]) ).returns(T::Hash[Hash::K, T.type_parameter(:Out)])
} }
def deep_transform_values!(&block); end def deep_transform_values!(&block); end
end end

View File

@ -3,16 +3,16 @@
class Hash class Hash
sig { sig {
type_parameters(:out).params( type_parameters(:Out).params(
block: T.proc.params(o: K).returns(T.type_parameter(:out)), block: T.proc.params(o: K).returns(T.type_parameter(:Out)),
).returns(T::Hash[T.type_parameter(:out), V]) ).returns(T::Hash[T.type_parameter(:Out), V])
} }
def deep_transform_keys(&block); end def deep_transform_keys(&block); end
sig { sig {
type_parameters(:out).params( type_parameters(:Out).params(
block: T.proc.params(o: K).returns(T.type_parameter(:out)), block: T.proc.params(o: K).returns(T.type_parameter(:Out)),
).returns(T::Hash[T.type_parameter(:out), V]) ).returns(T::Hash[T.type_parameter(:Out), V])
} }
def deep_transform_keys!(&block); end def deep_transform_keys!(&block); end

View File

@ -26,9 +26,8 @@ module Kernel
require path require path
end end
true true
rescue LoadError => e rescue LoadError
# we should raise on syntax errors but not if the file doesn't exist. false
raise unless e.message.include?(path)
end end
def ohai_title(title) def ohai_title(title)
@ -81,7 +80,7 @@ module Kernel
sig { params(message: T.any(String, Exception)).void } sig { params(message: T.any(String, Exception)).void }
def opoo(message) def opoo(message)
require "utils/github/actions" require "utils/github/actions"
return if GitHub::Actions.puts_annotation_if_env_set(:warning, message.to_s) return if GitHub::Actions.puts_annotation_if_env_set!(:warning, message.to_s)
require "utils/formatter" require "utils/formatter"
@ -107,7 +106,7 @@ module Kernel
sig { params(message: T.any(String, Exception)).void } sig { params(message: T.any(String, Exception)).void }
def onoe(message) def onoe(message)
require "utils/github/actions" require "utils/github/actions"
return if GitHub::Actions.puts_annotation_if_env_set(:error, message.to_s) return if GitHub::Actions.puts_annotation_if_env_set!(:error, message.to_s)
require "utils/formatter" require "utils/formatter"
@ -205,7 +204,7 @@ module Kernel
disable = true if disable_for_developers && Homebrew::EnvConfig.developer? disable = true if disable_for_developers && Homebrew::EnvConfig.developer?
if disable || Homebrew.raise_deprecation_exceptions? if disable || Homebrew.raise_deprecation_exceptions?
require "utils/github/actions" require "utils/github/actions"
GitHub::Actions.puts_annotation_if_env_set(:error, message, file:, line:) GitHub::Actions.puts_annotation_if_env_set!(:error, message, file:, line:)
exception = MethodDeprecatedError.new(message) exception = MethodDeprecatedError.new(message)
exception.set_backtrace(backtrace) exception.set_backtrace(backtrace)
raise exception raise exception

View File

@ -12,12 +12,12 @@ class Keg
elf_files.each do |file| elf_files.each do |file|
file.ensure_writable do file.ensure_writable do
change_rpath(file, old_prefix, new_prefix) change_rpath!(file, old_prefix, new_prefix)
end end
end end
end end
def change_rpath(file, old_prefix, new_prefix) def change_rpath!(file, old_prefix, new_prefix)
return false if !file.elf? || !file.dynamic_elf? return false if !file.elf? || !file.dynamic_elf?
updated = {} updated = {}

View File

@ -5,7 +5,7 @@ require "requirement"
class XcodeRequirement < Requirement class XcodeRequirement < Requirement
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def xcode_installed_version def xcode_installed_version!
true true
end end
end end

View File

@ -38,7 +38,7 @@ module OS
# conflict between what `uname` reports and the underlying `sysctl` flags, # conflict between what `uname` reports and the underlying `sysctl` flags,
# since the `sysctl` flags don't change behaviour under Rosetta 2. # since the `sysctl` flags don't change behaviour under Rosetta 2.
def in_rosetta2? def in_rosetta2?
::Hardware::CPU.sysctl_bool("sysctl.proc_translated") ::Hardware::CPU.sysctl_bool!("sysctl.proc_translated")
end end
def features def features
@ -50,7 +50,7 @@ module OS
end end
def sse4? def sse4?
::Hardware::CPU.sysctl_bool("hw.optional.sse4_1") ::Hardware::CPU.sysctl_bool!("hw.optional.sse4_1")
end end
end end
end end
@ -68,41 +68,41 @@ module Hardware
end end
def aes? def aes?
sysctl_bool("hw.optional.aes") sysctl_bool!("hw.optional.aes")
end end
def altivec? def altivec?
sysctl_bool("hw.optional.altivec") sysctl_bool!("hw.optional.altivec")
end end
def avx? def avx?
sysctl_bool("hw.optional.avx1_0") sysctl_bool!("hw.optional.avx1_0")
end end
def avx2? def avx2?
sysctl_bool("hw.optional.avx2_0") sysctl_bool!("hw.optional.avx2_0")
end end
def sse3? def sse3?
sysctl_bool("hw.optional.sse3") sysctl_bool!("hw.optional.sse3")
end end
def ssse3? def ssse3?
sysctl_bool("hw.optional.supplementalsse3") sysctl_bool!("hw.optional.supplementalsse3")
end end
def sse4_2? def sse4_2?
sysctl_bool("hw.optional.sse4_2") sysctl_bool!("hw.optional.sse4_2")
end end
# NOTE: This is more reliable than checking `uname`. `sysctl` returns # NOTE: This is more reliable than checking `uname`. `sysctl` returns
# the right answer even when running in Rosetta 2. # the right answer even when running in Rosetta 2.
def physical_cpu_arm64? def physical_cpu_arm64?
sysctl_bool("hw.optional.arm64") sysctl_bool!("hw.optional.arm64")
end end
def virtualized? def virtualized?
sysctl_bool("kern.hv_vmm_present") sysctl_bool!("kern.hv_vmm_present")
end end
def arm_family def arm_family
@ -173,7 +173,7 @@ module Hardware
end end
end end
def sysctl_bool(key) def sysctl_bool!(key)
sysctl_int(key) == 1 sysctl_int(key) == 1
end end

View File

@ -306,7 +306,7 @@ class FormulaInstaller
if force? if force?
opoo message opoo message
else else
GitHub::Actions.puts_annotation_if_env_set(:error, message) GitHub::Actions.puts_annotation_if_env_set!(:error, message)
raise CannotInstallFormulaError, message raise CannotInstallFormulaError, message
end end
end end

View File

@ -79,6 +79,9 @@ module Formulary
end end
module PathnameWriteMkpath module PathnameWriteMkpath
# TODO: migrate away from refinements here, they don't play nicely with
# Sorbet, when we migrate to `typed: strict`
# rubocop:todo Sorbet/BlockMethodDefinition
refine Pathname do refine Pathname do
def write(content, offset = nil, **open_args) def write(content, offset = nil, **open_args)
T.bind(self, Pathname) T.bind(self, Pathname)
@ -89,6 +92,7 @@ module Formulary
super super
end end
end end
# rubocop:enable Sorbet/BlockMethodDefinition
end end
using PathnameWriteMkpath using PathnameWriteMkpath
@ -133,7 +137,7 @@ module Formulary
rescue NameError => e rescue NameError => e
class_list = mod.constants class_list = mod.constants
.map { |const_name| mod.const_get(const_name) } .map { |const_name| mod.const_get(const_name) }
.select { |const| const.is_a?(Class) } .grep(Class)
new_exception = FormulaClassUnavailableError.new(name, path, class_name, class_list) new_exception = FormulaClassUnavailableError.new(name, path, class_name, class_list)
remove_const(namespace) remove_const(namespace)
raise new_exception, "", e.backtrace raise new_exception, "", e.backtrace
@ -170,7 +174,7 @@ module Formulary
end end
sig { params(name: String, flags: T::Array[String]).returns(T.class_of(Formula)) } sig { params(name: String, flags: T::Array[String]).returns(T.class_of(Formula)) }
def self.load_formula_from_api(name, flags:) def self.load_formula_from_api!(name, flags:)
namespace = :"FormulaNamespaceAPI#{namespace_key(name)}" namespace = :"FormulaNamespaceAPI#{namespace_key(name)}"
mod = Module.new mod = Module.new
@ -264,6 +268,9 @@ module Formulary
end end
end end
# TODO: migrate away from this inline class here, they don't play nicely with
# Sorbet, when we migrate to `typed: strict`
# rubocop:todo Sorbet/BlockMethodDefinition
klass = Class.new(::Formula) do klass = Class.new(::Formula) do
@loaded_from_api = true @loaded_from_api = true
@ -431,6 +438,7 @@ module Formulary
Checksum.new(checksum) if checksum Checksum.new(checksum) if checksum
end end
end end
# rubocop:enable Sorbet/BlockMethodDefinition
mod.const_set(class_name, klass) mod.const_set(class_name, klass)
@ -902,7 +910,7 @@ module Formulary
private private
def load_from_api(flags:) def load_from_api(flags:)
Formulary.load_formula_from_api(name, flags:) Formulary.load_formula_from_api!(name, flags:)
end end
end end

View File

@ -19,6 +19,9 @@ module Ignorable
end end
def self.hook_raise def self.hook_raise
# TODO: migrate away from this inline class here, they don't play nicely with
# Sorbet, when we migrate to `typed: strict`
# rubocop:todo Sorbet/BlockMethodDefinition
Object.class_eval do Object.class_eval do
alias_method :original_raise, :raise alias_method :original_raise, :raise
@ -37,6 +40,7 @@ module Ignorable
alias_method :fail, :raise alias_method :fail, :raise
end end
# rubocop:enable Sorbet/BlockMethodDefinition
return unless block_given? return unless block_given?

View File

@ -465,9 +465,7 @@ module Homebrew
def collect_dependencies(formulae_installer, dependants) def collect_dependencies(formulae_installer, dependants)
formulae_dependencies = formulae_installer.flat_map do |f| formulae_dependencies = formulae_installer.flat_map do |f|
[f.formula, f.compute_dependencies.flatten.filter do |c| [f.formula, f.compute_dependencies.flatten.grep(Dependency).flat_map(&:to_formula)]
c.is_a? Dependency
end.flat_map(&:to_formula)]
end.flatten.uniq end.flatten.uniq
formulae_dependencies.concat(dependants.upgradeable) if dependants&.upgradeable formulae_dependencies.concat(dependants.upgradeable) if dependants&.upgradeable
formulae_dependencies.uniq formulae_dependencies.uniq

View File

@ -35,7 +35,7 @@ class Keg
end end
sig { params(text: String).returns(T::Boolean) } sig { params(text: String).returns(T::Boolean) }
def replace_text(text) def replace_text!(text)
replacements = @replacement_map.values.to_h replacements = @replacement_map.values.to_h
sorted_keys = replacements.keys.sort_by do |key| sorted_keys = replacements.keys.sort_by do |key|
@ -143,7 +143,7 @@ class Keg
files.map { path.join(_1) }.group_by { |f| f.stat.ino }.each_value do |first, *rest| files.map { path.join(_1) }.group_by { |f| f.stat.ino }.each_value do |first, *rest|
s = first.open("rb", &:read) s = first.open("rb", &:read)
next unless relocation.replace_text(s) next unless relocation.replace_text!(s)
changed_files += [first, *rest].map { |file| file.relative_path_from(path) } changed_files += [first, *rest].map { |file| file.relative_path_from(path) }

View File

@ -323,7 +323,7 @@ module Homebrew
end end
return unless name return unless name
if skip_hash[:messages].is_a?(Array) && skip_hash[:messages].count.positive? if skip_hash[:messages].is_a?(Array) && skip_hash[:messages].any?
# TODO: Handle multiple messages, only if needed in the future # TODO: Handle multiple messages, only if needed in the future
if skip_hash[:status] == "skipped" if skip_hash[:status] == "skipped"
puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{skip_hash[:messages][0]}" puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{skip_hash[:messages][0]}"

View File

@ -12,7 +12,7 @@ class XcodeRequirement < Requirement
satisfy(build_env: false) do satisfy(build_env: false) do
T.bind(self, XcodeRequirement) T.bind(self, XcodeRequirement)
xcode_installed_version xcode_installed_version!
end end
sig { params(tags: T::Array[String]).void } sig { params(tags: T::Array[String]).void }
@ -23,7 +23,7 @@ class XcodeRequirement < Requirement
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def xcode_installed_version def xcode_installed_version!
return false unless MacOS::Xcode.installed? return false unless MacOS::Xcode.installed?
return true unless @version return true unless @version

View File

@ -228,13 +228,13 @@ module RuboCop
rescue JSON::ParserError rescue JSON::ParserError
nil nil
end end
next if list_contents.nil? || list_contents.count.zero? next if list_contents.nil? || list_contents.none?
@tap_style_exceptions[list_name] = list_contents @tap_style_exceptions[list_name] = list_contents
end end
end end
return false if @tap_style_exceptions.nil? || @tap_style_exceptions.count.zero? return false if @tap_style_exceptions.nil? || @tap_style_exceptions.none?
return false unless @tap_style_exceptions.key? list return false unless @tap_style_exceptions.key? list
T.must(@tap_style_exceptions[list]).include?(formula || @formula_name) T.must(@tap_style_exceptions[list]).include?(formula || @formula_name)

View File

@ -42,7 +42,7 @@ module Homebrew
end end
# Check if formula has been found. # Check if formula has been found.
def self.check(targets) def self.check!(targets)
raise UsageError, "Formula(e) missing, please provide a formula name or use --all" if targets.empty? raise UsageError, "Formula(e) missing, please provide a formula name or use --all" if targets.empty?
true true

View File

@ -17,7 +17,7 @@ module Homebrew
).void ).void
} }
def self.run(targets, verbose:, json:) def self.run(targets, verbose:, json:)
Services::Cli.check(targets) Services::Cli.check!(targets)
output = targets.map(&:to_hash) output = targets.map(&:to_hash)

View File

@ -11,7 +11,7 @@ module Homebrew
sig { params(targets: T::Array[Services::FormulaWrapper], verbose: T::Boolean).void } sig { params(targets: T::Array[Services::FormulaWrapper], verbose: T::Boolean).void }
def self.run(targets, verbose:) def self.run(targets, verbose:)
Services::Cli.check(targets) Services::Cli.check!(targets)
Services::Cli.kill(targets, verbose:) Services::Cli.kill(targets, verbose:)
end end
end end

View File

@ -22,7 +22,7 @@ module Homebrew
).void ).void
} }
def self.run(targets, custom_plist, verbose:) def self.run(targets, custom_plist, verbose:)
Services::Cli.check(targets) Services::Cli.check!(targets)
ran = [] ran = []
started = [] started = []

View File

@ -17,7 +17,7 @@ module Homebrew
).void ).void
} }
def self.run(targets, custom_plist, verbose:) def self.run(targets, custom_plist, verbose:)
Services::Cli.check(targets) Services::Cli.check!(targets)
Services::Cli.run(targets, custom_plist, verbose:) Services::Cli.run(targets, custom_plist, verbose:)
end end
end end

View File

@ -17,7 +17,7 @@ module Homebrew
).void ).void
} }
def self.run(targets, custom_plist, verbose:) def self.run(targets, custom_plist, verbose:)
Services::Cli.check(targets) Services::Cli.check!(targets)
Services::Cli.start(targets, custom_plist, verbose:) Services::Cli.start(targets, custom_plist, verbose:)
end end
end end

View File

@ -19,7 +19,7 @@ module Homebrew
).void ).void
} }
def self.run(targets, verbose:, no_wait:, max_wait:, keep:) def self.run(targets, verbose:, no_wait:, max_wait:, keep:)
Services::Cli.check(targets) Services::Cli.check!(targets)
Services::Cli.stop(targets, verbose:, no_wait:, max_wait:, keep:) Services::Cli.stop(targets, verbose:, no_wait:, max_wait:, keep:)
end end
end end

View File

@ -915,14 +915,29 @@ class CSV
# end # end
# end # end
# #
# source://csv//lib/csv.rb#2507 # source://csv//lib/csv.rb#2511
def add_row(row); end def add_row(row); end
# source://csv//lib/csv.rb#2389
def binmode(*args, **_arg1, &block); end
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv.rb#2396 # source://csv//lib/csv.rb#2396
def binmode?; end def binmode?; end
# source://csv//lib/csv.rb#2389
def close(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def close_read(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def close_write(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def closed?(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.col_sep -> string # csv.col_sep -> string
# #
@ -1075,7 +1090,7 @@ class CSV
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv.rb#2432 # source://csv//lib/csv.rb#2444
def eof; end def eof; end
# @return [Boolean] # @return [Boolean]
@ -1083,6 +1098,12 @@ class CSV
# source://csv//lib/csv.rb#2432 # source://csv//lib/csv.rb#2432
def eof?; end def eof?; end
# source://csv//lib/csv.rb#2389
def external_encoding(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def fcntl(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.field_size_limit -> integer or nil # csv.field_size_limit -> integer or nil
# #
@ -1095,11 +1116,17 @@ class CSV
# source://csv//lib/csv.rb#2176 # source://csv//lib/csv.rb#2176
def field_size_limit; end def field_size_limit; end
# source://csv//lib/csv.rb#2389
def fileno(*args, **_arg1, &block); end
# @raise [NotImplementedError] # @raise [NotImplementedError]
# #
# source://csv//lib/csv.rb#2404 # source://csv//lib/csv.rb#2404
def flock(*args); end def flock(*args); end
# source://csv//lib/csv.rb#2389
def flush(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.force_quotes? -> true or false # csv.force_quotes? -> true or false
# #
@ -1113,6 +1140,9 @@ class CSV
# source://csv//lib/csv.rb#2307 # source://csv//lib/csv.rb#2307
def force_quotes?; end def force_quotes?; end
# source://csv//lib/csv.rb#2389
def fsync(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.shift -> array, csv_row, or nil # csv.shift -> array, csv_row, or nil
# #
@ -1147,7 +1177,7 @@ class CSV
# # Raises IOError (not opened for reading) # # Raises IOError (not opened for reading)
# csv.shift # csv.shift
# #
# source://csv//lib/csv.rb#2803 # source://csv//lib/csv.rb#2814
def gets; end def gets; end
# The block need not return a \String object: # The block need not return a \String object:
@ -1240,11 +1270,17 @@ class CSV
# source://csv//lib/csv.rb#2825 # source://csv//lib/csv.rb#2825
def inspect; end def inspect; end
# source://csv//lib/csv.rb#2389
def internal_encoding(*args, **_arg1, &block); end
# @raise [NotImplementedError] # @raise [NotImplementedError]
# #
# source://csv//lib/csv.rb#2409 # source://csv//lib/csv.rb#2409
def ioctl(*args); end def ioctl(*args); end
# source://csv//lib/csv.rb#2389
def isatty(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.liberal_parsing? -> true or false # csv.liberal_parsing? -> true or false
# #
@ -1325,6 +1361,15 @@ class CSV
# source://csv//lib/csv.rb#2414 # source://csv//lib/csv.rb#2414
def path; end def path; end
# source://csv//lib/csv.rb#2389
def pid(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def pos(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def pos=(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv << row -> self # csv << row -> self
# #
@ -1376,7 +1421,7 @@ class CSV
# end # end
# end # end
# #
# source://csv//lib/csv.rb#2507 # source://csv//lib/csv.rb#2512
def puts(row); end def puts(row); end
# :call-seq: # :call-seq:
@ -1458,7 +1503,7 @@ class CSV
# # Raises IOError (not opened for reading) # # Raises IOError (not opened for reading)
# csv.shift # csv.shift
# #
# source://csv//lib/csv.rb#2803 # source://csv//lib/csv.rb#2815
def readline; end def readline; end
# :call-seq: # :call-seq:
@ -1493,9 +1538,12 @@ class CSV
# # Raises IOError (not opened for reading) # # Raises IOError (not opened for reading)
# csv.read # csv.read
# #
# source://csv//lib/csv.rb#2730 # source://csv//lib/csv.rb#2738
def readlines; end def readlines; end
# source://csv//lib/csv.rb#2389
def reopen(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.return_headers? -> true or false # csv.return_headers? -> true or false
# #
@ -1523,6 +1571,9 @@ class CSV
# source://csv//lib/csv.rb#2154 # source://csv//lib/csv.rb#2154
def row_sep; end def row_sep; end
# source://csv//lib/csv.rb#2389
def seek(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.shift -> array, csv_row, or nil # csv.shift -> array, csv_row, or nil
# #
@ -1587,6 +1638,18 @@ class CSV
# source://csv//lib/csv.rb#2418 # source://csv//lib/csv.rb#2418
def stat(*args); end def stat(*args); end
# source://csv//lib/csv.rb#2389
def string(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def sync(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def sync=(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def tell(*args, **_arg1, &block); end
# @raise [NotImplementedError] # @raise [NotImplementedError]
# #
# source://csv//lib/csv.rb#2423 # source://csv//lib/csv.rb#2423
@ -1595,6 +1658,12 @@ class CSV
# source://csv//lib/csv.rb#2428 # source://csv//lib/csv.rb#2428
def to_io; end def to_io; end
# source://csv//lib/csv.rb#2389
def truncate(*args, **_arg1, &block); end
# source://csv//lib/csv.rb#2389
def tty?(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# csv.unconverted_fields? -> object # csv.unconverted_fields? -> object
# #
@ -2500,16 +2569,6 @@ end
# source://csv//lib/csv.rb#895 # source://csv//lib/csv.rb#895
CSV::ConverterEncoding = T.let(T.unsafe(nil), Encoding) CSV::ConverterEncoding = T.let(T.unsafe(nil), Encoding)
# A \Hash containing the names and \Procs for the built-in field converters.
# See {Built-In Field Converters}[#class-CSV-label-Built-In+Field+Converters].
#
# This \Hash is intentionally left unfrozen, and may be extended with
# custom field converters.
# See {Custom Field Converters}[#class-CSV-label-Custom+Field+Converters].
#
# source://csv//lib/csv.rb#903
CSV::Converters = T.let(T.unsafe(nil), Hash)
# A Regexp used to find and convert some common Date formats. # A Regexp used to find and convert some common Date formats.
# #
# source://csv//lib/csv.rb#884 # source://csv//lib/csv.rb#884
@ -2520,6 +2579,88 @@ CSV::DateMatcher = T.let(T.unsafe(nil), Regexp)
# source://csv//lib/csv.rb#887 # source://csv//lib/csv.rb#887
CSV::DateTimeMatcher = T.let(T.unsafe(nil), Regexp) CSV::DateTimeMatcher = T.let(T.unsafe(nil), Regexp)
# A FieldInfo Struct contains details about a field's position in the data
# source it was read from. CSV will pass this Struct to some blocks that make
# decisions based on field structure. See CSV.convert_fields() for an
# example.
#
# <b><tt>index</tt></b>:: The zero-based index of the field in its row.
# <b><tt>line</tt></b>:: The line of the data source this row is from.
# <b><tt>header</tt></b>:: The header for the column, when available.
# <b><tt>quoted?</tt></b>:: True or false, whether the original value is quoted or not.
#
# source://csv//lib/csv.rb#881
class CSV::FieldInfo < ::Struct
# Returns the value of attribute header
#
# @return [Object] the current value of header
#
# source://csv//lib/csv.rb#881
def header; end
# Sets the attribute header
#
# @param value [Object] the value to set the attribute header to.
# @return [Object] the newly set value
#
# source://csv//lib/csv.rb#881
def header=(_); end
# Returns the value of attribute index
#
# @return [Object] the current value of index
#
# source://csv//lib/csv.rb#881
def index; end
# Sets the attribute index
#
# @param value [Object] the value to set the attribute index to.
# @return [Object] the newly set value
#
# source://csv//lib/csv.rb#881
def index=(_); end
# Returns the value of attribute line
#
# @return [Object] the current value of line
#
# source://csv//lib/csv.rb#881
def line; end
# Sets the attribute line
#
# @param value [Object] the value to set the attribute line to.
# @return [Object] the newly set value
#
# source://csv//lib/csv.rb#881
def line=(_); end
# Returns the value of attribute quoted?
#
# @return [Object] the current value of quoted?
#
# source://csv//lib/csv.rb#881
def quoted?; end
class << self
# source://csv//lib/csv.rb#881
def [](*_arg0); end
# source://csv//lib/csv.rb#881
def inspect; end
# source://csv//lib/csv.rb#881
def keyword_init?; end
# source://csv//lib/csv.rb#881
def members; end
# source://csv//lib/csv.rb#881
def new(*_arg0); end
end
end
# Note: Don't use this class directly. This is an internal class. # Note: Don't use this class directly. This is an internal class.
# #
# source://csv//lib/csv/fields_converter.rb#5 # source://csv//lib/csv/fields_converter.rb#5
@ -2617,7 +2758,7 @@ class CSV::MalformedCSVError < ::RuntimeError
# Returns the value of attribute line_number. # Returns the value of attribute line_number.
# #
# source://csv//lib/csv.rb#853 # source://csv//lib/csv.rb#854
def lineno; end def lineno; end
end end
@ -2912,7 +3053,7 @@ CSV::Parser::STRING_SCANNER_SCAN_ACCEPT_STRING = T.let(T.unsafe(nil), TrueClass)
# Uses StringScanner (the official strscan gem). Strscan provides lexical # Uses StringScanner (the official strscan gem). Strscan provides lexical
# scanning operations on a String. We inherit its object and take advantage # scanning operations on a String. We inherit its object and take advantage
# on the methods. For more information, please visit: # on the methods. For more information, please visit:
# https://ruby-doc.org/stdlib-2.6.1/libdoc/strscan/rdoc/StringScanner.html # https://docs.ruby-lang.org/en/master/StringScanner.html
# #
# source://csv//lib/csv/parser.rb#52 # source://csv//lib/csv/parser.rb#52
class CSV::Parser::Scanner < ::StringScanner class CSV::Parser::Scanner < ::StringScanner
@ -2936,6 +3077,7 @@ class CSV::Parser::Scanner < ::StringScanner
# source://csv//lib/csv/parser.rb#69 # source://csv//lib/csv/parser.rb#69
def keep_start; end def keep_start; end
# source://csv//lib/csv/parser.rb#53
def scan_all(_arg0); end def scan_all(_arg0); end
end end
@ -3162,7 +3304,7 @@ class CSV::Row
# #
# Returns +nil+ if the header does not exist. # Returns +nil+ if the header does not exist.
# #
# source://csv//lib/csv/row.rb#203 # source://csv//lib/csv/row.rb#215
def [](header_or_index, minimum_index = T.unsafe(nil)); end def [](header_or_index, minimum_index = T.unsafe(nil)); end
# :call-seq: # :call-seq:
@ -3350,9 +3492,12 @@ class CSV::Row
# If no block is given, returns a new Enumerator: # If no block is given, returns a new Enumerator:
# row.each # => #<Enumerator: #<CSV::Row "Name":"Foo" "Name":"Bar" "Name":"Baz">:each> # row.each # => #<Enumerator: #<CSV::Row "Name":"Foo" "Name":"Bar" "Name":"Baz">:each>
# #
# source://csv//lib/csv/row.rb#610 # source://csv//lib/csv/row.rb#618
def each_pair(&block); end def each_pair(&block); end
# source://csv//lib/csv/row.rb#124
def empty?(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# fetch(header) -> value # fetch(header) -> value
# fetch(header, default) -> value # fetch(header, default) -> value
@ -3536,7 +3681,7 @@ class CSV::Row
# #
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv/row.rb#279 # source://csv//lib/csv/row.rb#285
def header?(header); end def header?(header); end
# :call-seq: # :call-seq:
@ -3569,7 +3714,7 @@ class CSV::Row
# #
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv/row.rb#279 # source://csv//lib/csv/row.rb#282
def include?(header); end def include?(header); end
# :call-seq: # :call-seq:
@ -3619,9 +3764,12 @@ class CSV::Row
# #
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv/row.rb#279 # source://csv//lib/csv/row.rb#283
def key?(header); end def key?(header); end
# source://csv//lib/csv/row.rb#124
def length(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# row.has_key?(header) -> true or false # row.has_key?(header) -> true or false
# #
@ -3630,7 +3778,7 @@ class CSV::Row
# #
# @return [Boolean] # @return [Boolean]
# #
# source://csv//lib/csv/row.rb#279 # source://csv//lib/csv/row.rb#284
def member?(header); end def member?(header); end
# :call-seq: # :call-seq:
@ -3646,6 +3794,12 @@ class CSV::Row
# source://csv//lib/csv/row.rb#410 # source://csv//lib/csv/row.rb#410
def push(*args); end def push(*args); end
# source://csv//lib/csv/row.rb#124
def size(*args, **_arg1, &block); end
# source://csv//lib/csv/row.rb#675
def to_ary(*_arg0); end
# :call-seq: # :call-seq:
# row.to_csv -> csv_string # row.to_csv -> csv_string
# #
@ -3693,7 +3847,7 @@ class CSV::Row
# row = table[0] # row = table[0]
# row.to_h # => {"Name"=>"Foo"} # row.to_h # => {"Name"=>"Foo"}
# #
# source://csv//lib/csv/row.rb#653 # source://csv//lib/csv/row.rb#660
def to_hash; end def to_hash; end
# :call-seq: # :call-seq:
@ -3705,7 +3859,7 @@ class CSV::Row
# row = table[0] # row = table[0]
# row.to_csv # => "foo,0\n" # row.to_csv # => "foo,0\n"
# #
# source://csv//lib/csv/row.rb#694 # source://csv//lib/csv/row.rb#697
def to_s(**options); end def to_s(**options); end
# :call-seq: # :call-seq:
@ -3755,7 +3909,7 @@ class CSV::Row
# Returns all fields if no argument given: # Returns all fields if no argument given:
# row.fields # => ["Foo", "Bar", "Baz"] # row.fields # => ["Foo", "Bar", "Baz"]
# #
# source://csv//lib/csv/row.rb#530 # source://csv//lib/csv/row.rb#551
def values_at(*headers_and_or_indices); end def values_at(*headers_and_or_indices); end
protected protected
@ -4533,6 +4687,9 @@ class CSV::Table
# source://csv//lib/csv/table.rb#930 # source://csv//lib/csv/table.rb#930
def each(&block); end def each(&block); end
# source://csv//lib/csv/table.rb#223
def empty?(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# table.headers -> array_of_headers # table.headers -> array_of_headers
# #
@ -4574,6 +4731,9 @@ class CSV::Table
# source://csv//lib/csv/table.rb#1048 # source://csv//lib/csv/table.rb#1048
def inspect; end def inspect; end
# source://csv//lib/csv/table.rb#223
def length(*args, **_arg1, &block); end
# The current access mode for indexing and iteration. # The current access mode for indexing and iteration.
# #
# source://csv//lib/csv/table.rb#214 # source://csv//lib/csv/table.rb#214
@ -4598,6 +4758,9 @@ class CSV::Table
# source://csv//lib/csv/table.rb#788 # source://csv//lib/csv/table.rb#788
def push(*rows); end def push(*rows); end
# source://csv//lib/csv/table.rb#223
def size(*args, **_arg1, &block); end
# :call-seq: # :call-seq:
# table.to_a -> array_of_arrays # table.to_a -> array_of_arrays
# #
@ -4649,7 +4812,7 @@ class CSV::Table
# Limit rows if option +limit+ is given like +2+: # Limit rows if option +limit+ is given like +2+:
# table.to_csv(limit: 2) # => "Name,Value\nfoo,0\nbar,1\n" # table.to_csv(limit: 2) # => "Name,Value\nfoo,0\nbar,1\n"
# #
# source://csv//lib/csv/table.rb#1004 # source://csv//lib/csv/table.rb#1015
def to_s(write_headers: T.unsafe(nil), limit: T.unsafe(nil), **options); end def to_s(write_headers: T.unsafe(nil), limit: T.unsafe(nil), **options); end
# :call-seq: # :call-seq:

View File

@ -78,36 +78,39 @@ class ParallelTests::CLI
# source://parallel_tests//lib/parallel_tests/cli.rb#189 # source://parallel_tests//lib/parallel_tests/cli.rb#189
def any_test_failed?(test_results); end def any_test_failed?(test_results); end
# source://parallel_tests//lib/parallel_tests/cli.rb#375 # source://parallel_tests//lib/parallel_tests/cli.rb#401
def append_test_options(options, argv); end def append_test_options(options, argv); end
# source://parallel_tests//lib/parallel_tests/cli.rb#416 # source://parallel_tests//lib/parallel_tests/cli.rb#442
def detailed_duration(seconds); end def detailed_duration(seconds); end
# source://parallel_tests//lib/parallel_tests/cli.rb#390 # source://parallel_tests//lib/parallel_tests/cli.rb#416
def execute_command_in_parallel(command, num_processes, options); end def execute_command_in_parallel(command, num_processes, options); end
# source://parallel_tests//lib/parallel_tests/cli.rb#56 # source://parallel_tests//lib/parallel_tests/cli.rb#56
def execute_in_parallel(items, num_processes, options); end def execute_in_parallel(items, num_processes, options); end
# source://parallel_tests//lib/parallel_tests/cli.rb#364 # source://parallel_tests//lib/parallel_tests/cli.rb#390
def extract_file_paths(argv); end def extract_file_paths(argv); end
# source://parallel_tests//lib/parallel_tests/cli.rb#370 # source://parallel_tests//lib/parallel_tests/cli.rb#396
def extract_test_options(argv); end def extract_test_options(argv); end
# source://parallel_tests//lib/parallel_tests/cli.rb#423 # source://parallel_tests//lib/parallel_tests/cli.rb#449
def final_fail_message; end def final_fail_message; end
# @return [Boolean] # @return [Boolean]
# #
# source://parallel_tests//lib/parallel_tests/cli.rb#433 # source://parallel_tests//lib/parallel_tests/cli.rb#459
def first_is_1?; end def first_is_1?; end
# source://parallel_tests//lib/parallel_tests/cli.rb#31 # source://parallel_tests//lib/parallel_tests/cli.rb#31
def handle_interrupt; end def handle_interrupt; end
# source://parallel_tests//lib/parallel_tests/cli.rb#383 # source://parallel_tests//lib/parallel_tests/cli.rb#482
def heredoc(text, newline_padding); end
# source://parallel_tests//lib/parallel_tests/cli.rb#409
def load_runner(type); end def load_runner(type); end
# source://parallel_tests//lib/parallel_tests/cli.rb#138 # source://parallel_tests//lib/parallel_tests/cli.rb#138
@ -128,7 +131,7 @@ class ParallelTests::CLI
# source://parallel_tests//lib/parallel_tests/cli.rb#148 # source://parallel_tests//lib/parallel_tests/cli.rb#148
def report_results(test_results, options); end def report_results(test_results, options); end
# source://parallel_tests//lib/parallel_tests/cli.rb#411 # source://parallel_tests//lib/parallel_tests/cli.rb#437
def report_time_taken(&block); end def report_time_taken(&block); end
# source://parallel_tests//lib/parallel_tests/cli.rb#130 # source://parallel_tests//lib/parallel_tests/cli.rb#130
@ -142,12 +145,12 @@ class ParallelTests::CLI
# CI systems often fail when there is no output for a long time, so simulate some output # CI systems often fail when there is no output for a long time, so simulate some output
# #
# source://parallel_tests//lib/parallel_tests/cli.rb#439 # source://parallel_tests//lib/parallel_tests/cli.rb#465
def simulate_output_for_ci(simulate); end def simulate_output_for_ci(simulate); end
# @return [Boolean] # @return [Boolean]
# #
# source://parallel_tests//lib/parallel_tests/cli.rb#429 # source://parallel_tests//lib/parallel_tests/cli.rb#455
def use_colors?; end def use_colors?; end
end end

View File

@ -0,0 +1,113 @@
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `require-hooks` gem.
# Please instead update this file by running `bin/tapioca gem require-hooks`.
# source://require-hooks//lib/require-hooks/api.rb#3
module RequireHooks
class << self
# Define a block to wrap the code loading.
# The return value MUST be a result of calling the passed block.
# For example, you can use such hooks for instrumentation, debugging purposes.
#
# RequireHooks.around_load do |path, &block|
# puts "Loading #{path}"
# block.call.tap { puts "Loaded #{path}" }
# end
#
# source://require-hooks//lib/require-hooks/api.rb#71
def around_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end
# source://require-hooks//lib/require-hooks/api.rb#107
def context_for(path); end
# This hook should be used to manually compile byte code to be loaded by the VM.
# The arguments are (path, source = nil), where source is only defined if transformations took place.
# Otherwise, you MUST read the source code from the file yourself.
#
# The return value MUST be either nil (continue to the next hook or default behavior) or a platform-specific bytecode object (e.g., RubyVM::InstructionSequence).
#
# RequireHooks.hijack_load do |path, source|
# source ||= File.read(path)
# if defined?(RubyVM::InstructionSequence)
# RubyVM::InstructionSequence.compile(source)
# elsif defined?(JRUBY_VERSION)
# JRuby.compile(source)
# end
# end
#
# source://require-hooks//lib/require-hooks/api.rb#103
def hijack_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end
# Returns the value of attribute print_warnings.
#
# source://require-hooks//lib/require-hooks/api.rb#61
def print_warnings; end
# Sets the attribute print_warnings
#
# @param value the value to set the attribute print_warnings to.
#
# source://require-hooks//lib/require-hooks/api.rb#61
def print_warnings=(_arg0); end
# Define hooks to perform source-to-source transformations.
# The return value MUST be either String (new source code) or nil (indicating that no transformations were performed).
#
# NOTE: The second argument (`source`) MAY be nil, indicating that no transformer tried to transform the source code.
#
#
# RequireHooks.source_transform do |path, source|
# end
#
# source://require-hooks//lib/require-hooks/api.rb#85
def source_transform(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end
end
end
# source://require-hooks//lib/require-hooks/api.rb#8
class RequireHooks::Context
# @return [Context] a new instance of Context
#
# source://require-hooks//lib/require-hooks/api.rb#9
def initialize(around_load, source_transform, hijack_load); end
# @return [Boolean]
#
# source://require-hooks//lib/require-hooks/api.rb#15
def empty?; end
# @return [Boolean]
#
# source://require-hooks//lib/require-hooks/api.rb#23
def hijack?; end
# source://require-hooks//lib/require-hooks/api.rb#37
def perform_source_transform(path); end
# source://require-hooks//lib/require-hooks/api.rb#27
def run_around_load_callbacks(path); end
# @return [Boolean]
#
# source://require-hooks//lib/require-hooks/api.rb#19
def source_transform?; end
# source://require-hooks//lib/require-hooks/api.rb#49
def try_hijack_load(path, source); end
end
# source://require-hooks//lib/require-hooks/mode/load_iseq.rb#4
module RequireHooks::LoadIseq
# source://require-hooks//lib/require-hooks/mode/load_iseq.rb#5
def load_iseq(path); end
end
# source://require-hooks//lib/require-hooks/version.rb#4
RequireHooks::VERSION = T.let(T.unsafe(nil), String)
class RubyVM::InstructionSequence
extend ::RequireHooks::LoadIseq
end

View File

@ -9,75 +9,7 @@
# in the `RSpec::Expectations` and `RSpec::Matchers` namespaces. # in the `RSpec::Expectations` and `RSpec::Matchers` namespaces.
# #
# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#1 # source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#1
module RSpec module RSpec; end
class << self
# source://rspec-core/3.13.3/lib/rspec/core.rb#70
def clear_examples; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#85
def configuration; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#49
def configuration=(_arg0); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#97
def configure; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#194
def const_missing(name); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def context(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#122
def current_example; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#128
def current_example=(example); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#154
def current_scope; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#134
def current_scope=(scope); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def describe(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def example_group(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def fcontext(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def fdescribe(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#58
def reset; end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_context(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_examples(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_examples_for(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#160
def world; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#49
def world=(_arg0); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def xcontext(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def xdescribe(*args, &example_group_block); end
end
end
# RSpec::Expectations provides a simple, readable API to express # RSpec::Expectations provides a simple, readable API to express
# the expected outcomes in a code example. To express an expected # the expected outcomes in a code example. To express an expected
@ -164,7 +96,7 @@ class RSpec::Expectations::BlockExpectationTarget < ::RSpec::Expectations::Expec
# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#137 # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#137
def to(matcher, message = T.unsafe(nil), &block); end def to(matcher, message = T.unsafe(nil), &block); end
# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#146
def to_not(matcher, message = T.unsafe(nil), &block); end def to_not(matcher, message = T.unsafe(nil), &block); end
private private
@ -249,12 +181,16 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct
# Returns the value of attribute beginning_line_number # Returns the value of attribute beginning_line_number
# #
# @return [Object] the current value of beginning_line_number # @return [Object] the current value of beginning_line_number
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def beginning_line_number; end def beginning_line_number; end
# Sets the attribute beginning_line_number # Sets the attribute beginning_line_number
# #
# @param value [Object] the value to set the attribute beginning_line_number to. # @param value [Object] the value to set the attribute beginning_line_number to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def beginning_line_number=(_); end def beginning_line_number=(_); end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#205 # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#205
@ -266,23 +202,31 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct
# Returns the value of attribute method_name # Returns the value of attribute method_name
# #
# @return [Object] the current value of method_name # @return [Object] the current value of method_name
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def method_name; end def method_name; end
# Sets the attribute method_name # Sets the attribute method_name
# #
# @param value [Object] the value to set the attribute method_name to. # @param value [Object] the value to set the attribute method_name to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def method_name=(_); end def method_name=(_); end
# Returns the value of attribute source # Returns the value of attribute source
# #
# @return [Object] the current value of source # @return [Object] the current value of source
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def source; end def source; end
# Sets the attribute source # Sets the attribute source
# #
# @param value [Object] the value to set the attribute source to. # @param value [Object] the value to set the attribute source to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def source=(_); end def source=(_); end
private private
@ -308,10 +252,19 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct
def method_ident_node?(node); end def method_ident_node?(node); end
class << self class << self
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def [](*_arg0); end def [](*_arg0); end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def inspect; end def inspect; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def keyword_init?; end def keyword_init?; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def members; end def members; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -331,12 +284,16 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct
# Returns the value of attribute beginning_line_number # Returns the value of attribute beginning_line_number
# #
# @return [Object] the current value of beginning_line_number # @return [Object] the current value of beginning_line_number
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def beginning_line_number; end def beginning_line_number; end
# Sets the attribute beginning_line_number # Sets the attribute beginning_line_number
# #
# @param value [Object] the value to set the attribute beginning_line_number to. # @param value [Object] the value to set the attribute beginning_line_number to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def beginning_line_number=(_); end def beginning_line_number=(_); end
# Returns the value of attribute body_tokens. # Returns the value of attribute body_tokens.
@ -347,23 +304,31 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct
# Returns the value of attribute method_name # Returns the value of attribute method_name
# #
# @return [Object] the current value of method_name # @return [Object] the current value of method_name
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def method_name; end def method_name; end
# Sets the attribute method_name # Sets the attribute method_name
# #
# @param value [Object] the value to set the attribute method_name to. # @param value [Object] the value to set the attribute method_name to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def method_name=(_); end def method_name=(_); end
# Returns the value of attribute source # Returns the value of attribute source
# #
# @return [Object] the current value of source # @return [Object] the current value of source
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def source; end def source; end
# Sets the attribute source # Sets the attribute source
# #
# @param value [Object] the value to set the attribute source to. # @param value [Object] the value to set the attribute source to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def source=(_); end def source=(_); end
# Returns the value of attribute state. # Returns the value of attribute state.
@ -434,10 +399,19 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct
def pipe_token?(token); end def pipe_token?(token); end
class << self class << self
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def [](*_arg0); end def [](*_arg0); end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def inspect; end def inspect; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def keyword_init?; end def keyword_init?; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def members; end def members; end
# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -773,7 +747,7 @@ module RSpec::Expectations::ExpectationTarget::InstanceMethods
# @return [Boolean] false if the negative expectation succeeds (else raises) # @return [Boolean] false if the negative expectation succeeds (else raises)
# @see RSpec::Matchers # @see RSpec::Matchers
# #
# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#76 # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#80
def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end
private private
@ -1558,7 +1532,7 @@ module RSpec::Matchers
# @param receiver [Object] # @param receiver [Object]
# @param message [Symbol] the message to send the receiver # @param message [Symbol] the message to send the receiver
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_changing(*args, **_arg1, &block); end def a_block_changing(*args, **_arg1, &block); end
# With no arg, passes if the block outputs `to_stdout` or `to_stderr`. # With no arg, passes if the block outputs `to_stdout` or `to_stderr`.
@ -1591,7 +1565,7 @@ module RSpec::Matchers
# @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and
# are thus significantly (~30x) slower than `to_stdout` and `to_stderr`. # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_outputting(*args, **_arg1, &block); end def a_block_outputting(*args, **_arg1, &block); end
# With no args, matches if any error is raised. # With no args, matches if any error is raised.
@ -1611,7 +1585,7 @@ module RSpec::Matchers
# #
# expect { do_something_risky }.not_to raise_error # expect { do_something_risky }.not_to raise_error
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_raising(*args, **_arg1, &block); end def a_block_raising(*args, **_arg1, &block); end
# Given no argument, matches if a proc throws any Symbol. # Given no argument, matches if a proc throws any Symbol.
@ -1630,7 +1604,7 @@ module RSpec::Matchers
# expect { do_something_risky }.not_to throw_symbol(:that_was_risky) # expect { do_something_risky }.not_to throw_symbol(:that_was_risky)
# expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit')
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_throwing(*args, **_arg1, &block); end def a_block_throwing(*args, **_arg1, &block); end
# Passes if the method called in the expect block yields, regardless # Passes if the method called in the expect block yields, regardless
@ -1642,7 +1616,7 @@ module RSpec::Matchers
# @note Your expect block must accept a parameter and pass it on to # @note Your expect block must accept a parameter and pass it on to
# the method-under-test as a block. # the method-under-test as a block.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_yielding_control(*args, **_arg1, &block); end def a_block_yielding_control(*args, **_arg1, &block); end
# Designed for use with methods that repeatedly yield (such as # Designed for use with methods that repeatedly yield (such as
@ -1660,7 +1634,7 @@ module RSpec::Matchers
# @note Your expect block must accept a parameter and pass it on to # @note Your expect block must accept a parameter and pass it on to
# the method-under-test as a block. # the method-under-test as a block.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_yielding_successive_args(*args, **_arg1, &block); end def a_block_yielding_successive_args(*args, **_arg1, &block); end
# Given no arguments, matches if the method called in the expect # Given no arguments, matches if the method called in the expect
@ -1687,7 +1661,7 @@ module RSpec::Matchers
# @note This matcher is not designed for use with methods that yield # @note This matcher is not designed for use with methods that yield
# multiple times. # multiple times.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_yielding_with_args(*args, **_arg1, &block); end def a_block_yielding_with_args(*args, **_arg1, &block); end
# Passes if the method called in the expect block yields with # Passes if the method called in the expect block yields with
@ -1702,7 +1676,7 @@ module RSpec::Matchers
# @note This matcher is not designed for use with methods that yield # @note This matcher is not designed for use with methods that yield
# multiple times. # multiple times.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_block_yielding_with_no_args(*args, **_arg1, &block); end def a_block_yielding_with_no_args(*args, **_arg1, &block); end
# Passes if actual contains all of the expected regardless of order. # Passes if actual contains all of the expected regardless of order.
@ -1716,7 +1690,7 @@ module RSpec::Matchers
# but `=~` is not supported with `expect`. # but `=~` is not supported with `expect`.
# @see #match_array # @see #match_array
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_collection_containing_exactly(*args, **_arg1, &block); end def a_collection_containing_exactly(*args, **_arg1, &block); end
# Matches if the actual value ends with the expected value(s). In the case # Matches if the actual value ends with the expected value(s). In the case
@ -1729,7 +1703,7 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 1, 2, 3, 4]).to end_with 4
# expect([0, 2, 3, 4, 4]).to end_with 3, 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_collection_ending_with(*args, **_arg1, &block); end def a_collection_ending_with(*args, **_arg1, &block); end
# Passes if actual includes expected. This works for # Passes if actual includes expected. This works for
@ -1750,7 +1724,7 @@ module RSpec::Matchers
# expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).to include(:c) # fails
# expect(:a => 1, :b => 2).not_to include(:a => 2) # expect(:a => 1, :b => 2).not_to include(:a => 2)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_collection_including(*args, **_arg1, &block); end def a_collection_including(*args, **_arg1, &block); end
# Matches if the actual value starts with the expected value(s). In the # Matches if the actual value starts with the expected value(s). In the
@ -1763,17 +1737,17 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 1, 2, 3, 4]).to start_with 0
# expect([0, 2, 3, 4, 4]).to start_with 0, 1 # expect([0, 2, 3, 4, 4]).to start_with 0, 1
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_collection_starting_with(*args, **_arg1, &block); end def a_collection_starting_with(*args, **_arg1, &block); end
# Passes if actual is falsey (false or nil) # Passes if actual is falsey (false or nil)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_falsey_value(*args, **_arg1, &block); end def a_falsey_value(*args, **_arg1, &block); end
# Passes if actual is falsey (false or nil) # Passes if actual is falsey (false or nil)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_falsy_value(*args, **_arg1, &block); end def a_falsy_value(*args, **_arg1, &block); end
# Passes if actual includes expected. This works for # Passes if actual includes expected. This works for
@ -1794,7 +1768,7 @@ module RSpec::Matchers
# expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).to include(:c) # fails
# expect(:a => 1, :b => 2).not_to include(:a => 2) # expect(:a => 1, :b => 2).not_to include(:a => 2)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_hash_including(*args, **_arg1, &block); end def a_hash_including(*args, **_arg1, &block); end
# Passes if actual.kind_of?(expected) # Passes if actual.kind_of?(expected)
@ -1804,12 +1778,12 @@ module RSpec::Matchers
# expect(5).to be_a_kind_of(Numeric) # expect(5).to be_a_kind_of(Numeric)
# expect(5).not_to be_a_kind_of(Float) # expect(5).not_to be_a_kind_of(Float)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_kind_of(*args, **_arg1, &block); end def a_kind_of(*args, **_arg1, &block); end
# Passes if actual is nil # Passes if actual is nil
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_nil_value(*args, **_arg1, &block); end def a_nil_value(*args, **_arg1, &block); end
# Passes if actual covers expected. This works for # Passes if actual covers expected. This works for
@ -1825,7 +1799,7 @@ module RSpec::Matchers
# expect(1..10).not_to cover(11) # expect(1..10).not_to cover(11)
# expect(1..10).not_to cover(5) # fails # expect(1..10).not_to cover(5) # fails
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_range_covering(*args, **_arg1, &block); end def a_range_covering(*args, **_arg1, &block); end
# Matches if the actual value ends with the expected value(s). In the case # Matches if the actual value ends with the expected value(s). In the case
@ -1838,7 +1812,7 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 1, 2, 3, 4]).to end_with 4
# expect([0, 2, 3, 4, 4]).to end_with 3, 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_string_ending_with(*args, **_arg1, &block); end def a_string_ending_with(*args, **_arg1, &block); end
# Passes if actual includes expected. This works for # Passes if actual includes expected. This works for
@ -1859,7 +1833,7 @@ module RSpec::Matchers
# expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).to include(:c) # fails
# expect(:a => 1, :b => 2).not_to include(:a => 2) # expect(:a => 1, :b => 2).not_to include(:a => 2)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_string_including(*args, **_arg1, &block); end def a_string_including(*args, **_arg1, &block); end
# Given a `Regexp` or `String`, passes if `actual.match(pattern)` # Given a `Regexp` or `String`, passes if `actual.match(pattern)`
@ -1892,7 +1866,7 @@ module RSpec::Matchers
# matchers (due to how the custom matcher DSL was evaluated in 2.x, # matchers (due to how the custom matcher DSL was evaluated in 2.x,
# `match` could not be used there), but is no longer needed in 3.x. # `match` could not be used there), but is no longer needed in 3.x.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_string_matching(*args, **_arg1, &block); end def a_string_matching(*args, **_arg1, &block); end
# Matches if the actual value starts with the expected value(s). In the # Matches if the actual value starts with the expected value(s). In the
@ -1905,12 +1879,12 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 1, 2, 3, 4]).to start_with 0
# expect([0, 2, 3, 4, 4]).to start_with 0, 1 # expect([0, 2, 3, 4, 4]).to start_with 0, 1
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_string_starting_with(*args, **_arg1, &block); end def a_string_starting_with(*args, **_arg1, &block); end
# Passes if actual is truthy (anything but false or nil) # Passes if actual is truthy (anything but false or nil)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_truthy_value(*args, **_arg1, &block); end def a_truthy_value(*args, **_arg1, &block); end
# Given true, false, or nil, will pass if actual value is true, false or # Given true, false, or nil, will pass if actual value is true, false or
@ -1934,7 +1908,7 @@ module RSpec::Matchers
# expect(actual).not_to be_nil # expect(actual).not_to be_nil
# expect(actual).not_to be_[arbitrary_predicate](*args) # expect(actual).not_to be_[arbitrary_predicate](*args)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_value(*args, **_arg1, &block); end def a_value(*args, **_arg1, &block); end
# Passes if actual.between?(min, max). Works with any Comparable object, # Passes if actual.between?(min, max). Works with any Comparable object,
@ -1949,7 +1923,7 @@ module RSpec::Matchers
# expect(11).not_to be_between(1, 10) # expect(11).not_to be_between(1, 10)
# expect(10).not_to be_between(1, 10).exclusive # expect(10).not_to be_between(1, 10).exclusive
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_value_between(*args, **_arg1, &block); end def a_value_between(*args, **_arg1, &block); end
# Passes if actual == expected +/- delta # Passes if actual == expected +/- delta
@ -1958,7 +1932,7 @@ module RSpec::Matchers
# expect(result).to be_within(0.5).of(3.0) # expect(result).to be_within(0.5).of(3.0)
# expect(result).not_to be_within(0.5).of(3.0) # expect(result).not_to be_within(0.5).of(3.0)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def a_value_within(*args, **_arg1, &block); end def a_value_within(*args, **_arg1, &block); end
# Allows multiple expectations in the provided block to fail, and then # Allows multiple expectations in the provided block to fail, and then
@ -2021,7 +1995,7 @@ module RSpec::Matchers
# expect(results).to match_array([1, 2]) # expect(results).to match_array([1, 2])
# @see #contain_exactly # @see #contain_exactly
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_array_matching(*args, **_arg1, &block); end def an_array_matching(*args, **_arg1, &block); end
# Passes if actual.instance_of?(expected) # Passes if actual.instance_of?(expected)
@ -2031,7 +2005,7 @@ module RSpec::Matchers
# expect(5).not_to be_an_instance_of(Numeric) # expect(5).not_to be_an_instance_of(Numeric)
# expect(5).not_to be_an_instance_of(Float) # expect(5).not_to be_an_instance_of(Float)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_instance_of(*args, **_arg1, &block); end def an_instance_of(*args, **_arg1, &block); end
# Passes if <tt>actual == expected</tt>. # Passes if <tt>actual == expected</tt>.
@ -2043,7 +2017,7 @@ module RSpec::Matchers
# expect(5).to eq(5) # expect(5).to eq(5)
# expect(5).not_to eq(3) # expect(5).not_to eq(3)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_eq_to(*args, **_arg1, &block); end def an_object_eq_to(*args, **_arg1, &block); end
# Passes if `actual.eql?(expected)` # Passes if `actual.eql?(expected)`
@ -2055,7 +2029,7 @@ module RSpec::Matchers
# expect(5).to eql(5) # expect(5).to eql(5)
# expect(5).not_to eql(3) # expect(5).not_to eql(3)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_eql_to(*args, **_arg1, &block); end def an_object_eql_to(*args, **_arg1, &block); end
# Passes if <tt>actual.equal?(expected)</tt> (object identity). # Passes if <tt>actual.equal?(expected)</tt> (object identity).
@ -2067,7 +2041,7 @@ module RSpec::Matchers
# expect(5).to equal(5) # Integers are equal # expect(5).to equal(5) # Integers are equal
# expect("5").not_to equal("5") # Strings that look the same are not the same object # expect("5").not_to equal("5") # Strings that look the same are not the same object
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_equal_to(*args, **_arg1, &block); end def an_object_equal_to(*args, **_arg1, &block); end
# Passes if `actual.exist?` or `actual.exists?` # Passes if `actual.exist?` or `actual.exists?`
@ -2075,7 +2049,7 @@ module RSpec::Matchers
# @example # @example
# expect(File).to exist("path/to/file") # expect(File).to exist("path/to/file")
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_existing(*args, **_arg1, &block); end def an_object_existing(*args, **_arg1, &block); end
# Passes if actual's attribute values match the expected attributes hash. # Passes if actual's attribute values match the expected attributes hash.
@ -2091,7 +2065,7 @@ module RSpec::Matchers
# expect(person).to have_attributes(:color => "red") # expect(person).to have_attributes(:color => "red")
# @note It will fail if actual doesn't respond to any of the expected attributes. # @note It will fail if actual doesn't respond to any of the expected attributes.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_having_attributes(*args, **_arg1, &block); end def an_object_having_attributes(*args, **_arg1, &block); end
# Given a `Regexp` or `String`, passes if `actual.match(pattern)` # Given a `Regexp` or `String`, passes if `actual.match(pattern)`
@ -2124,7 +2098,7 @@ module RSpec::Matchers
# matchers (due to how the custom matcher DSL was evaluated in 2.x, # matchers (due to how the custom matcher DSL was evaluated in 2.x,
# `match` could not be used there), but is no longer needed in 3.x. # `match` could not be used there), but is no longer needed in 3.x.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_matching(*args, **_arg1, &block); end def an_object_matching(*args, **_arg1, &block); end
# Matches if the target object responds to all of the names # Matches if the target object responds to all of the names
@ -2133,7 +2107,7 @@ module RSpec::Matchers
# @example # @example
# expect("string").to respond_to(:length) # expect("string").to respond_to(:length)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_responding_to(*args, **_arg1, &block); end def an_object_responding_to(*args, **_arg1, &block); end
# Passes if the submitted block returns true. Yields target to the # Passes if the submitted block returns true. Yields target to the
@ -2151,7 +2125,7 @@ module RSpec::Matchers
# expect(5).to satisfy("be greater than 3") { |n| n > 3 } # expect(5).to satisfy("be greater than 3") { |n| n > 3 }
# @param description [String] optional description to be used for this matcher. # @param description [String] optional description to be used for this matcher.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def an_object_satisfying(*args, **_arg1, &block); end def an_object_satisfying(*args, **_arg1, &block); end
# Given true, false, or nil, will pass if actual value is true, false or # Given true, false, or nil, will pass if actual value is true, false or
@ -2195,7 +2169,7 @@ module RSpec::Matchers
# passes if target.kind_of?(klass) # passes if target.kind_of?(klass)
# #
# source://rspec-expectations//lib/rspec/matchers.rb#355 # source://rspec-expectations//lib/rspec/matchers.rb#358
def be_an(klass); end def be_an(klass); end
# Passes if actual.instance_of?(expected) # Passes if actual.instance_of?(expected)
@ -2230,7 +2204,7 @@ module RSpec::Matchers
# Passes if actual is falsey (false or nil) # Passes if actual is falsey (false or nil)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def be_falsy(*args, **_arg1, &block); end def be_falsy(*args, **_arg1, &block); end
# Passes if actual.instance_of?(expected) # Passes if actual.instance_of?(expected)
@ -2240,7 +2214,7 @@ module RSpec::Matchers
# expect(5).not_to be_an_instance_of(Numeric) # expect(5).not_to be_an_instance_of(Numeric)
# expect(5).not_to be_an_instance_of(Float) # expect(5).not_to be_an_instance_of(Float)
# #
# source://rspec-expectations//lib/rspec/matchers.rb#366 # source://rspec-expectations//lib/rspec/matchers.rb#369
def be_instance_of(expected); end def be_instance_of(expected); end
# Passes if actual.kind_of?(expected) # Passes if actual.kind_of?(expected)
@ -2250,7 +2224,7 @@ module RSpec::Matchers
# expect(5).to be_a_kind_of(Numeric) # expect(5).to be_a_kind_of(Numeric)
# expect(5).not_to be_a_kind_of(Float) # expect(5).not_to be_a_kind_of(Float)
# #
# source://rspec-expectations//lib/rspec/matchers.rb#378 # source://rspec-expectations//lib/rspec/matchers.rb#381
def be_kind_of(expected); end def be_kind_of(expected); end
# Passes if actual is nil # Passes if actual is nil
@ -2437,7 +2411,7 @@ module RSpec::Matchers
# @param receiver [Object] # @param receiver [Object]
# @param message [Symbol] the message to send the receiver # @param message [Symbol] the message to send the receiver
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def changing(*args, **_arg1, &block); end def changing(*args, **_arg1, &block); end
# Passes if actual contains all of the expected regardless of order. # Passes if actual contains all of the expected regardless of order.
@ -2465,7 +2439,7 @@ module RSpec::Matchers
# but `=~` is not supported with `expect`. # but `=~` is not supported with `expect`.
# @see #match_array # @see #match_array
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def containing_exactly(*args, **_arg1, &block); end def containing_exactly(*args, **_arg1, &block); end
# Passes if actual covers expected. This works for # Passes if actual covers expected. This works for
@ -2497,7 +2471,7 @@ module RSpec::Matchers
# expect(1..10).not_to cover(11) # expect(1..10).not_to cover(11)
# expect(1..10).not_to cover(5) # fails # expect(1..10).not_to cover(5) # fails
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def covering(*args, **_arg1, &block); end def covering(*args, **_arg1, &block); end
# Matches if the actual value ends with the expected value(s). In the case # Matches if the actual value ends with the expected value(s). In the case
@ -2523,7 +2497,7 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 1, 2, 3, 4]).to end_with 4
# expect([0, 2, 3, 4, 4]).to end_with 3, 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def ending_with(*args, **_arg1, &block); end def ending_with(*args, **_arg1, &block); end
# Passes if <tt>actual == expected</tt>. # Passes if <tt>actual == expected</tt>.
@ -2547,7 +2521,7 @@ module RSpec::Matchers
# expect(5).to eq(5) # expect(5).to eq(5)
# expect(5).not_to eq(3) # expect(5).not_to eq(3)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def eq_to(*args, **_arg1, &block); end def eq_to(*args, **_arg1, &block); end
# Passes if `actual.eql?(expected)` # Passes if `actual.eql?(expected)`
@ -2571,7 +2545,7 @@ module RSpec::Matchers
# expect(5).to eql(5) # expect(5).to eql(5)
# expect(5).not_to eql(3) # expect(5).not_to eql(3)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def eql_to(*args, **_arg1, &block); end def eql_to(*args, **_arg1, &block); end
# Passes if <tt>actual.equal?(expected)</tt> (object identity). # Passes if <tt>actual.equal?(expected)</tt> (object identity).
@ -2595,7 +2569,7 @@ module RSpec::Matchers
# expect(5).to equal(5) # Integers are equal # expect(5).to equal(5) # Integers are equal
# expect("5").not_to equal("5") # Strings that look the same are not the same object # expect("5").not_to equal("5") # Strings that look the same are not the same object
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def equal_to(*args, **_arg1, &block); end def equal_to(*args, **_arg1, &block); end
# Passes if `actual.exist?` or `actual.exists?` # Passes if `actual.exist?` or `actual.exists?`
@ -2611,7 +2585,7 @@ module RSpec::Matchers
# @example # @example
# expect(File).to exist("path/to/file") # expect(File).to exist("path/to/file")
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def existing(*args, **_arg1, &block); end def existing(*args, **_arg1, &block); end
# Supports `expect(actual).to matcher` syntax by wrapping `actual` in an # Supports `expect(actual).to matcher` syntax by wrapping `actual` in an
@ -2624,7 +2598,7 @@ module RSpec::Matchers
# @see Expectations::ExpectationTarget#to # @see Expectations::ExpectationTarget#to
# @see Expectations::ExpectationTarget#not_to # @see Expectations::ExpectationTarget#not_to
# #
# source://rspec-expectations//lib/rspec/expectations/syntax.rb#72 # source://rspec-expectations//lib/rspec/expectations/configuration.rb#48
def expect(value = T.unsafe(nil), &block); end def expect(value = T.unsafe(nil), &block); end
# Passes if actual's attribute values match the expected attributes hash. # Passes if actual's attribute values match the expected attributes hash.
@ -2656,7 +2630,7 @@ module RSpec::Matchers
# expect(person).to have_attributes(:color => "red") # expect(person).to have_attributes(:color => "red")
# @note It will fail if actual doesn't respond to any of the expected attributes. # @note It will fail if actual doesn't respond to any of the expected attributes.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def having_attributes(*args, **_arg1, &block); end def having_attributes(*args, **_arg1, &block); end
# Passes if actual includes expected. This works for # Passes if actual includes expected. This works for
@ -2698,7 +2672,7 @@ module RSpec::Matchers
# expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).to include(:c) # fails
# expect(:a => 1, :b => 2).not_to include(:a => 2) # expect(:a => 1, :b => 2).not_to include(:a => 2)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def including(*args, **_arg1, &block); end def including(*args, **_arg1, &block); end
# Given a `Regexp` or `String`, passes if `actual.match(pattern)` # Given a `Regexp` or `String`, passes if `actual.match(pattern)`
@ -2777,7 +2751,7 @@ module RSpec::Matchers
# matchers (due to how the custom matcher DSL was evaluated in 2.x, # matchers (due to how the custom matcher DSL was evaluated in 2.x,
# `match` could not be used there), but is no longer needed in 3.x. # `match` could not be used there), but is no longer needed in 3.x.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def match_regex(*args, **_arg1, &block); end def match_regex(*args, **_arg1, &block); end
# Given a `Regexp` or `String`, passes if `actual.match(pattern)` # Given a `Regexp` or `String`, passes if `actual.match(pattern)`
@ -2810,7 +2784,7 @@ module RSpec::Matchers
# matchers (due to how the custom matcher DSL was evaluated in 2.x, # matchers (due to how the custom matcher DSL was evaluated in 2.x,
# `match` could not be used there), but is no longer needed in 3.x. # `match` could not be used there), but is no longer needed in 3.x.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def matching(*args, **_arg1, &block); end def matching(*args, **_arg1, &block); end
# With no arg, passes if the block outputs `to_stdout` or `to_stderr`. # With no arg, passes if the block outputs `to_stdout` or `to_stderr`.
@ -2883,7 +2857,7 @@ module RSpec::Matchers
# #
# expect { do_something_risky }.not_to raise_error # expect { do_something_risky }.not_to raise_error
# #
# source://rspec-expectations//lib/rspec/matchers.rb#773 # source://rspec-expectations//lib/rspec/matchers.rb#776
def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); end def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); end
# With no args, matches if any error is raised. # With no args, matches if any error is raised.
@ -2903,7 +2877,7 @@ module RSpec::Matchers
# #
# expect { do_something_risky }.not_to raise_error # expect { do_something_risky }.not_to raise_error
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def raising(*args, **_arg1, &block); end def raising(*args, **_arg1, &block); end
# Matches if the target object responds to all of the names # Matches if the target object responds to all of the names
@ -2921,7 +2895,7 @@ module RSpec::Matchers
# @example # @example
# expect("string").to respond_to(:length) # expect("string").to respond_to(:length)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def responding_to(*args, **_arg1, &block); end def responding_to(*args, **_arg1, &block); end
# Passes if the submitted block returns true. Yields target to the # Passes if the submitted block returns true. Yields target to the
@ -2957,7 +2931,7 @@ module RSpec::Matchers
# expect(5).to satisfy("be greater than 3") { |n| n > 3 } # expect(5).to satisfy("be greater than 3") { |n| n > 3 }
# @param description [String] optional description to be used for this matcher. # @param description [String] optional description to be used for this matcher.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def satisfying(*args, **_arg1, &block); end def satisfying(*args, **_arg1, &block); end
# Matches if the actual value starts with the expected value(s). In the # Matches if the actual value starts with the expected value(s). In the
@ -2983,7 +2957,7 @@ module RSpec::Matchers
# expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 1, 2, 3, 4]).to start_with 0
# expect([0, 2, 3, 4, 4]).to start_with 0, 1 # expect([0, 2, 3, 4, 4]).to start_with 0, 1
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def starting_with(*args, **_arg1, &block); end def starting_with(*args, **_arg1, &block); end
# Given no argument, matches if a proc throws any Symbol. # Given no argument, matches if a proc throws any Symbol.
@ -3021,7 +2995,7 @@ module RSpec::Matchers
# expect { do_something_risky }.not_to throw_symbol(:that_was_risky) # expect { do_something_risky }.not_to throw_symbol(:that_was_risky)
# expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit')
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def throwing(*args, **_arg1, &block); end def throwing(*args, **_arg1, &block); end
# Passes if actual == expected +/- delta # Passes if actual == expected +/- delta
@ -3030,7 +3004,7 @@ module RSpec::Matchers
# expect(result).to be_within(0.5).of(3.0) # expect(result).to be_within(0.5).of(3.0)
# expect(result).not_to be_within(0.5).of(3.0) # expect(result).not_to be_within(0.5).of(3.0)
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def within(*args, **_arg1, &block); end def within(*args, **_arg1, &block); end
# Passes if the method called in the expect block yields, regardless # Passes if the method called in the expect block yields, regardless
@ -3114,7 +3088,7 @@ module RSpec::Matchers
# @note Your expect block must accept a parameter and pass it on to # @note Your expect block must accept a parameter and pass it on to
# the method-under-test as a block. # the method-under-test as a block.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def yielding_control(*args, **_arg1, &block); end def yielding_control(*args, **_arg1, &block); end
# Designed for use with methods that repeatedly yield (such as # Designed for use with methods that repeatedly yield (such as
@ -3132,7 +3106,7 @@ module RSpec::Matchers
# @note Your expect block must accept a parameter and pass it on to # @note Your expect block must accept a parameter and pass it on to
# the method-under-test as a block. # the method-under-test as a block.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def yielding_successive_args(*args, **_arg1, &block); end def yielding_successive_args(*args, **_arg1, &block); end
# Given no arguments, matches if the method called in the expect # Given no arguments, matches if the method called in the expect
@ -3159,7 +3133,7 @@ module RSpec::Matchers
# @note This matcher is not designed for use with methods that yield # @note This matcher is not designed for use with methods that yield
# multiple times. # multiple times.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def yielding_with_args(*args, **_arg1, &block); end def yielding_with_args(*args, **_arg1, &block); end
# Passes if the method called in the expect block yields with # Passes if the method called in the expect block yields with
@ -3174,7 +3148,7 @@ module RSpec::Matchers
# @note This matcher is not designed for use with methods that yield # @note This matcher is not designed for use with methods that yield
# multiple times. # multiple times.
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 # source://rspec-expectations//lib/rspec/matchers.rb#251
def yielding_with_no_args(*args, **_arg1, &block); end def yielding_with_no_args(*args, **_arg1, &block); end
private private
@ -3693,7 +3667,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting
# #
# @api private # @api private
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#138 # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#141
def improve_hash_formatting(inspect_string); end def improve_hash_formatting(inspect_string); end
end end
end end
@ -3731,7 +3705,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting
# @param _value [String] # @param _value [String]
# @return [nil] nil as the curent Ruby version does not support String encoding # @return [nil] nil as the curent Ruby version does not support String encoding
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#172 # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#186
def format_encoding(value); end def format_encoding(value); end
# :nocov: # :nocov:
@ -3739,7 +3713,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting
# @api private # @api private
# @return [Boolean] False always as the curent Ruby version does not support String encoding # @return [Boolean] False always as the curent Ruby version does not support String encoding
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#153 # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#165
def string_encoding_differs?; end def string_encoding_differs?; end
end end
end end
@ -5074,45 +5048,61 @@ class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < ::
# Returns the value of attribute indeterminate_actual_indexes # Returns the value of attribute indeterminate_actual_indexes
# #
# @return [Object] the current value of indeterminate_actual_indexes # @return [Object] the current value of indeterminate_actual_indexes
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def indeterminate_actual_indexes; end def indeterminate_actual_indexes; end
# Sets the attribute indeterminate_actual_indexes # Sets the attribute indeterminate_actual_indexes
# #
# @param value [Object] the value to set the attribute indeterminate_actual_indexes to. # @param value [Object] the value to set the attribute indeterminate_actual_indexes to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def indeterminate_actual_indexes=(_); end def indeterminate_actual_indexes=(_); end
# Returns the value of attribute indeterminate_expected_indexes # Returns the value of attribute indeterminate_expected_indexes
# #
# @return [Object] the current value of indeterminate_expected_indexes # @return [Object] the current value of indeterminate_expected_indexes
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def indeterminate_expected_indexes; end def indeterminate_expected_indexes; end
# Sets the attribute indeterminate_expected_indexes # Sets the attribute indeterminate_expected_indexes
# #
# @param value [Object] the value to set the attribute indeterminate_expected_indexes to. # @param value [Object] the value to set the attribute indeterminate_expected_indexes to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def indeterminate_expected_indexes=(_); end def indeterminate_expected_indexes=(_); end
# Returns the value of attribute unmatched_actual_indexes # Returns the value of attribute unmatched_actual_indexes
# #
# @return [Object] the current value of unmatched_actual_indexes # @return [Object] the current value of unmatched_actual_indexes
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def unmatched_actual_indexes; end def unmatched_actual_indexes; end
# Sets the attribute unmatched_actual_indexes # Sets the attribute unmatched_actual_indexes
# #
# @param value [Object] the value to set the attribute unmatched_actual_indexes to. # @param value [Object] the value to set the attribute unmatched_actual_indexes to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def unmatched_actual_indexes=(_); end def unmatched_actual_indexes=(_); end
# Returns the value of attribute unmatched_expected_indexes # Returns the value of attribute unmatched_expected_indexes
# #
# @return [Object] the current value of unmatched_expected_indexes # @return [Object] the current value of unmatched_expected_indexes
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def unmatched_expected_indexes; end def unmatched_expected_indexes; end
# Sets the attribute unmatched_expected_indexes # Sets the attribute unmatched_expected_indexes
# #
# @param value [Object] the value to set the attribute unmatched_expected_indexes to. # @param value [Object] the value to set the attribute unmatched_expected_indexes to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def unmatched_expected_indexes=(_); end def unmatched_expected_indexes=(_); end
# @api private # @api private
@ -5127,10 +5117,19 @@ class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < ::
def worse_than?(other); end def worse_than?(other); end
class << self class << self
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def [](*_arg0); end def [](*_arg0); end
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def inspect; end def inspect; end
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def keyword_init?; end def keyword_init?; end
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def members; end def members; end
# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -6510,7 +6509,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc
# @example # @example
# expect(obj).to respond_to(:message).with_any_keywords # expect(obj).to respond_to(:message).with_any_keywords
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#52
def and_any_keywords; end def and_any_keywords; end
# Specifies keyword arguments, if any. # Specifies keyword arguments, if any.
@ -6521,7 +6520,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc
# @example with an expected number of arguments # @example with an expected number of arguments
# expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape) # expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape)
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#40
def and_keywords(*keywords); end def and_keywords(*keywords); end
# Specifies that the number of arguments has no upper limit, i.e. the # Specifies that the number of arguments has no upper limit, i.e. the
@ -6531,7 +6530,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc
# @example # @example
# expect(obj).to respond_to(:message).with_unlimited_arguments # expect(obj).to respond_to(:message).with_unlimited_arguments
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#64
def and_unlimited_arguments; end def and_unlimited_arguments; end
# No-op. Intended to be used as syntactic sugar when using `with`. # No-op. Intended to be used as syntactic sugar when using `with`.
@ -6549,7 +6548,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc
# @example # @example
# expect(obj).to respond_to(:message).with(3).arguments # expect(obj).to respond_to(:message).with(3).arguments
# #
# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#74
def arguments; end def arguments; end
# @api private # @api private
@ -7372,7 +7371,7 @@ module RSpec::Matchers::Composable
# @note The negative form (`expect(...).not_to matcher.and other`) # @note The negative form (`expect(...).not_to matcher.and other`)
# is not supported at this time. # is not supported at this time.
# #
# source://rspec-expectations//lib/rspec/matchers/composable.rb#22 # source://rspec-expectations//lib/rspec/matchers/composable.rb#25
def &(matcher); end def &(matcher); end
# Delegates to `#matches?`. Allows matchers to be used in composable # Delegates to `#matches?`. Allows matchers to be used in composable
@ -7425,7 +7424,7 @@ module RSpec::Matchers::Composable
# @note The negative form (`expect(...).not_to matcher.or other`) # @note The negative form (`expect(...).not_to matcher.or other`)
# is not supported at this time. # is not supported at this time.
# #
# source://rspec-expectations//lib/rspec/matchers/composable.rb#38 # source://rspec-expectations//lib/rspec/matchers/composable.rb#41
def |(matcher); end def |(matcher); end
private private
@ -7522,7 +7521,7 @@ module RSpec::Matchers::Composable
# @api private # @api private
# @return [Boolean] # @return [Boolean]
# #
# source://rspec-expectations//lib/rspec/matchers/composable.rb#142 # source://rspec-expectations//lib/rspec/matchers/composable.rb#154
def should_enumerate?(item); end def should_enumerate?(item); end
# Transforms the given data structure (typically a hash or array) # Transforms the given data structure (typically a hash or array)
@ -7538,13 +7537,13 @@ module RSpec::Matchers::Composable
# #
# @api public # @api public
# #
# source://rspec-expectations//lib/rspec/matchers/composable.rb#98 # source://rspec-expectations//lib/rspec/matchers/composable.rb#154
def surface_descriptions_in(item); end def surface_descriptions_in(item); end
# @api private # @api private
# @return [Boolean] # @return [Boolean]
# #
# source://rspec-expectations//lib/rspec/matchers/composable.rb#147 # source://rspec-expectations//lib/rspec/matchers/composable.rb#154
def unreadable_io?(object); end def unreadable_io?(object); end
end end
end end
@ -7565,12 +7564,16 @@ class RSpec::Matchers::Composable::DescribableItem < ::Struct
# Returns the value of attribute item # Returns the value of attribute item
# #
# @return [Object] the current value of item # @return [Object] the current value of item
#
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def item; end def item; end
# Sets the attribute item # Sets the attribute item
# #
# @param value [Object] the value to set the attribute item to. # @param value [Object] the value to set the attribute item to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def item=(_); end def item=(_); end
# A pretty printed version of the item description. # A pretty printed version of the item description.
@ -7581,10 +7584,19 @@ class RSpec::Matchers::Composable::DescribableItem < ::Struct
def pretty_print(pp); end def pretty_print(pp); end
class << self class << self
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def [](*_arg0); end def [](*_arg0); end
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def inspect; end def inspect; end
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def keyword_init?; end def keyword_init?; end
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def members; end def members; end
# source://rspec-expectations//lib/rspec/matchers/composable.rb#158
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -7659,7 +7671,7 @@ module RSpec::Matchers::DSL
# When args are passed to your matcher, they will be yielded here, # When args are passed to your matcher, they will be yielded here,
# usually representing the expected value(s). # usually representing the expected value(s).
# #
# source://rspec-expectations//lib/rspec/matchers/dsl.rb#73 # source://rspec-expectations//lib/rspec/matchers/dsl.rb#79
def matcher(name, &declarations); end def matcher(name, &declarations); end
private private

View File

@ -8,74 +8,6 @@
# source://rspec-support//lib/rspec/support.rb#3 # source://rspec-support//lib/rspec/support.rb#3
module RSpec module RSpec
extend ::RSpec::Support::Warnings extend ::RSpec::Support::Warnings
class << self
# source://rspec-core/3.13.3/lib/rspec/core.rb#70
def clear_examples; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#85
def configuration; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#49
def configuration=(_arg0); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#97
def configure; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#194
def const_missing(name); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def context(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#122
def current_example; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#128
def current_example=(example); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#154
def current_scope; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#134
def current_scope=(scope); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def describe(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def example_group(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def fcontext(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def fdescribe(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#58
def reset; end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_context(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_examples(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110
def shared_examples_for(name, *args, &block); end
# source://rspec-core/3.13.3/lib/rspec/core.rb#160
def world; end
# source://rspec-core/3.13.3/lib/rspec/core.rb#49
def world=(_arg0); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def xcontext(*args, &example_group_block); end
# source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42
def xdescribe(*args, &example_group_block); end
end
end end
# Consistent implementation for "cleaning" the caller method to strip out # Consistent implementation for "cleaning" the caller method to strip out
@ -185,18 +117,6 @@ module RSpec::Support
# source://rspec-support//lib/rspec/support/matcher_definition.rb#16 # source://rspec-support//lib/rspec/support/matcher_definition.rb#16
def register_matcher_definition(&block); end def register_matcher_definition(&block); end
# source://rspec-support//lib/rspec/support.rb#25
def require_rspec_core(f); end
# source://rspec-support//lib/rspec/support.rb#25
def require_rspec_expectations(f); end
# source://rspec-support//lib/rspec/support.rb#25
def require_rspec_matchers(f); end
# source://rspec-support//lib/rspec/support.rb#25
def require_rspec_mocks(f); end
# source://rspec-support//lib/rspec/support.rb#25 # source://rspec-support//lib/rspec/support.rb#25
def require_rspec_support(f); end def require_rspec_support(f); end
@ -467,7 +387,7 @@ class RSpec::Support::EncodedString
# source://rspec-support//lib/rspec/support/encoded_string.rb#46 # source://rspec-support//lib/rspec/support/encoded_string.rb#46
def to_s; end def to_s; end
# source://rspec-support//lib/rspec/support/encoded_string.rb#46 # source://rspec-support//lib/rspec/support/encoded_string.rb#49
def to_str; end def to_str; end
private private
@ -1055,12 +975,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct
# Returns the value of attribute formatter # Returns the value of attribute formatter
# #
# @return [Object] the current value of formatter # @return [Object] the current value of formatter
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def formatter; end def formatter; end
# Sets the attribute formatter # Sets the attribute formatter
# #
# @param value [Object] the value to set the attribute formatter to. # @param value [Object] the value to set the attribute formatter to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def formatter=(_); end def formatter=(_); end
# @api private # @api private
@ -1072,12 +996,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct
# Returns the value of attribute object # Returns the value of attribute object
# #
# @return [Object] the current value of object # @return [Object] the current value of object
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def object; end def object; end
# Sets the attribute object # Sets the attribute object
# #
# @param value [Object] the value to set the attribute object to. # @param value [Object] the value to set the attribute object to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def object=(_); end def object=(_); end
# @api private # @api private
@ -1086,6 +1014,7 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct
def pretty_print(pp); end def pretty_print(pp); end
class << self class << self
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def [](*_arg0); end def [](*_arg0); end
# @api private # @api private
@ -1095,9 +1024,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct
# source://rspec-support//lib/rspec/support/object_formatter.rb#130 # source://rspec-support//lib/rspec/support/object_formatter.rb#130
def can_inspect?(_object); end def can_inspect?(_object); end
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def inspect; end def inspect; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def keyword_init?; end def keyword_init?; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def members; end def members; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#129
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -1209,19 +1145,32 @@ class RSpec::Support::ObjectFormatter::InspectableItem < ::Struct
# Returns the value of attribute text # Returns the value of attribute text
# #
# @return [Object] the current value of text # @return [Object] the current value of text
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def text; end def text; end
# Sets the attribute text # Sets the attribute text
# #
# @param value [Object] the value to set the attribute text to. # @param value [Object] the value to set the attribute text to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def text=(_); end def text=(_); end
class << self class << self
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def [](*_arg0); end def [](*_arg0); end
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def inspect; end def inspect; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def keyword_init?; end def keyword_init?; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def members; end def members; end
# source://rspec-support//lib/rspec/support/object_formatter.rb#119
def new(*_arg0); end def new(*_arg0); end
end end
end end

View File

@ -381,19 +381,32 @@ class RuboCop::CLI::Command::ShowCops::ExactMatcher < ::Struct
# Returns the value of attribute pattern # Returns the value of attribute pattern
# #
# @return [Object] the current value of pattern # @return [Object] the current value of pattern
#
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def pattern; end def pattern; end
# Sets the attribute pattern # Sets the attribute pattern
# #
# @param value [Object] the value to set the attribute pattern to. # @param value [Object] the value to set the attribute pattern to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def pattern=(_); end def pattern=(_); end
class << self class << self
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def [](*_arg0); end def [](*_arg0); end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def inspect; end def inspect; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def keyword_init?; end def keyword_init?; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def members; end def members; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -408,19 +421,32 @@ class RuboCop::CLI::Command::ShowCops::WildcardMatcher < ::Struct
# Returns the value of attribute pattern # Returns the value of attribute pattern
# #
# @return [Object] the current value of pattern # @return [Object] the current value of pattern
#
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def pattern; end def pattern; end
# Sets the attribute pattern # Sets the attribute pattern
# #
# @param value [Object] the value to set the attribute pattern to. # @param value [Object] the value to set the attribute pattern to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def pattern=(_); end def pattern=(_); end
class << self class << self
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def [](*_arg0); end def [](*_arg0); end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def inspect; end def inspect; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def keyword_init?; end def keyword_init?; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def members; end def members; end
# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -603,10 +629,10 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#31 # source://rubocop//lib/rubocop/config.rb#31
def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def [](*_arg0, **_arg1, &_arg2); end def [](*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def []=(*_arg0, **_arg1, &_arg2); end def []=(*_arg0, **_arg1, &_arg2); end
# @return [Boolean] # @return [Boolean]
@ -650,13 +676,13 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#200 # source://rubocop//lib/rubocop/config.rb#200
def cop_enabled?(name); end def cop_enabled?(name); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def delete(*_arg0, **_arg1, &_arg2); end def delete(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#139 # source://rubocop//lib/rubocop/config.rb#139
def deprecation_check; end def deprecation_check; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def dig(*_arg0, **_arg1, &_arg2); end def dig(*_arg0, **_arg1, &_arg2); end
# @return [Boolean] # @return [Boolean]
@ -664,10 +690,10 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#204 # source://rubocop//lib/rubocop/config.rb#204
def disabled_new_cops?; end def disabled_new_cops?; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def each(*_arg0, **_arg1, &_arg2); end def each(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def each_key(*_arg0, **_arg1, &_arg2); end def each_key(*_arg0, **_arg1, &_arg2); end
# @return [Boolean] # @return [Boolean]
@ -675,7 +701,7 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#208 # source://rubocop//lib/rubocop/config.rb#208
def enabled_new_cops?; end def enabled_new_cops?; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def fetch(*_arg0, **_arg1, &_arg2); end def fetch(*_arg0, **_arg1, &_arg2); end
# @return [Boolean] # @return [Boolean]
@ -737,10 +763,10 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#110 # source://rubocop//lib/rubocop/config.rb#110
def internal?; end def internal?; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def key?(*_arg0, **_arg1, &_arg2); end def key?(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def keys(*_arg0, **_arg1, &_arg2); end def keys(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#81 # source://rubocop//lib/rubocop/config.rb#81
@ -757,10 +783,10 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#115 # source://rubocop//lib/rubocop/config.rb#115
def make_excludes_absolute; end def make_excludes_absolute; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def map(*_arg0, **_arg1, &_arg2); end def map(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def merge(*_arg0, **_arg1, &_arg2); end def merge(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#293 # source://rubocop//lib/rubocop/config.rb#293
@ -786,7 +812,7 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#253 # source://rubocop//lib/rubocop/config.rb#253
def possibly_include_hidden?; end def possibly_include_hidden?; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def replace(*_arg0, **_arg1, &_arg2); end def replace(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#105 # source://rubocop//lib/rubocop/config.rb#105
@ -803,22 +829,22 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#297 # source://rubocop//lib/rubocop/config.rb#297
def target_rails_version; end def target_rails_version; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#99
def target_ruby_version(*_arg0, **_arg1, &_arg2); end def target_ruby_version(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def to_h(*_arg0, **_arg1, &_arg2); end def to_h(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def to_hash(*_arg0, **_arg1, &_arg2); end def to_hash(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#101 # source://rubocop//lib/rubocop/config.rb#101
def to_s; end def to_s; end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#97
def transform_values(*_arg0, **_arg1, &_arg2); end def transform_values(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config.rb#99
def validate(*_arg0, **_arg1, &_arg2); end def validate(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#92 # source://rubocop//lib/rubocop/config.rb#92
@ -863,30 +889,47 @@ class RuboCop::Config::CopConfig < ::Struct
# Returns the value of attribute metadata # Returns the value of attribute metadata
# #
# @return [Object] the current value of metadata # @return [Object] the current value of metadata
#
# source://rubocop//lib/rubocop/config.rb#17
def metadata; end def metadata; end
# Sets the attribute metadata # Sets the attribute metadata
# #
# @param value [Object] the value to set the attribute metadata to. # @param value [Object] the value to set the attribute metadata to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/config.rb#17
def metadata=(_); end def metadata=(_); end
# Returns the value of attribute name # Returns the value of attribute name
# #
# @return [Object] the current value of name # @return [Object] the current value of name
#
# source://rubocop//lib/rubocop/config.rb#17
def name; end def name; end
# Sets the attribute name # Sets the attribute name
# #
# @param value [Object] the value to set the attribute name to. # @param value [Object] the value to set the attribute name to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/config.rb#17
def name=(_); end def name=(_); end
class << self class << self
# source://rubocop//lib/rubocop/config.rb#17
def [](*_arg0); end def [](*_arg0); end
# source://rubocop//lib/rubocop/config.rb#17
def inspect; end def inspect; end
# source://rubocop//lib/rubocop/config.rb#17
def keyword_init?; end def keyword_init?; end
# source://rubocop//lib/rubocop/config.rb#17
def members; end def members; end
# source://rubocop//lib/rubocop/config.rb#17
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -1014,7 +1057,7 @@ class RuboCop::ConfigLoader
# Returns the value of attribute debug. # Returns the value of attribute debug.
# #
# source://rubocop//lib/rubocop/config_loader.rb#33 # source://rubocop//lib/rubocop/config_loader.rb#38
def debug?; end def debug?; end
# source://rubocop//lib/rubocop/config_loader.rb#162 # source://rubocop//lib/rubocop/config_loader.rb#162
@ -1065,7 +1108,7 @@ class RuboCop::ConfigLoader
# Returns the value of attribute ignore_parent_exclusion. # Returns the value of attribute ignore_parent_exclusion.
# #
# source://rubocop//lib/rubocop/config_loader.rb#33 # source://rubocop//lib/rubocop/config_loader.rb#39
def ignore_parent_exclusion?; end def ignore_parent_exclusion?; end
# Returns the value of attribute ignore_unrecognized_cops. # Returns the value of attribute ignore_unrecognized_cops.
@ -1851,7 +1894,7 @@ class RuboCop::ConfigStore
# Returns the value of attribute validated. # Returns the value of attribute validated.
# #
# source://rubocop//lib/rubocop/config_store.rb#7 # source://rubocop//lib/rubocop/config_store.rb#8
def validated?; end def validated?; end
end end
@ -1863,10 +1906,10 @@ class RuboCop::ConfigValidator
# source://rubocop//lib/rubocop/config_validator.rb#28 # source://rubocop//lib/rubocop/config_validator.rb#28
def initialize(config); end def initialize(config); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config_validator.rb#26
def for_all_cops(*_arg0, **_arg1, &_arg2); end def for_all_cops(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 # source://rubocop//lib/rubocop/config_validator.rb#26
def smart_loaded_path(*_arg0, **_arg1, &_arg2); end def smart_loaded_path(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config_validator.rb#65 # source://rubocop//lib/rubocop/config_validator.rb#65
@ -2082,19 +2125,32 @@ module RuboCop::Cop::AutocorrectLogic
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#51 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#51
def disable_offense(offense_range); end def disable_offense(offense_range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#135
def disable_offense_at_end_of_line(range, eol_comment); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#139 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#139
def disable_offense_at_end_of_line(range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#147
def disable_offense_before_and_after(range_by_lines); end def disable_offense_before_and_after(range_by_lines); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#77 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#77
def disable_offense_with_eol_or_surround_comment(range); end def disable_offense_with_eol_or_surround_comment(range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#96 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#143
def eol_comment; end
# @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#85
def eol_comment_would_be_inside_literal?(offense_range, literal_range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#100
def heredoc_range(node); end def heredoc_range(node); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#131 # @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#92
def line_with_eol_comment_too_long?(range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#135
def max_line_length; end def max_line_length; end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63
@ -2102,36 +2158,31 @@ module RuboCop::Cop::AutocorrectLogic
# @return [Boolean] # @return [Boolean]
# #
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#108 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#112
def multiline_string?(node); end def multiline_string?(node); end
# Expand the given range to include all of any lines it covers. Does not # Expand the given range to include all of any lines it covers. Does not
# include newline at end of the last line. # include newline at end of the last line.
# #
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#121 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#125
def range_by_lines(range); end def range_by_lines(range); end
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#112 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#116
def range_of_first_line(range); end def range_of_first_line(range); end
# @return [Boolean] # @return [Boolean]
# #
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#88 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#108
def range_overlaps_offense?(offense_range, range); end
# @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#104
def string_continuation?(node); end def string_continuation?(node); end
# @return [Boolean] # @return [Boolean]
# #
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#92 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#96
def surrounding_heredoc?(node); end def surrounding_heredoc?(node); end
# @return [Boolean] # @return [Boolean]
# #
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#100 # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#104
def surrounding_percent_array?(node); end def surrounding_percent_array?(node); end
end end
@ -2246,7 +2297,7 @@ class RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/base.rb#183 # source://rubocop//lib/rubocop/cop/base.rb#183
def message(_range = T.unsafe(nil)); end def message(_range = T.unsafe(nil)); end
# source://rubocop//lib/rubocop/cop/base.rb#238 # source://rubocop//lib/rubocop/cop/base.rb#242
def name; end def name; end
# @deprecated Make potential errors with previous API more obvious # @deprecated Make potential errors with previous API more obvious
@ -2520,52 +2571,77 @@ class RuboCop::Cop::Base::InvestigationReport < ::Struct
# Returns the value of attribute cop # Returns the value of attribute cop
# #
# @return [Object] the current value of cop # @return [Object] the current value of cop
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def cop; end def cop; end
# Sets the attribute cop # Sets the attribute cop
# #
# @param value [Object] the value to set the attribute cop to. # @param value [Object] the value to set the attribute cop to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def cop=(_); end def cop=(_); end
# Returns the value of attribute corrector # Returns the value of attribute corrector
# #
# @return [Object] the current value of corrector # @return [Object] the current value of corrector
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def corrector; end def corrector; end
# Sets the attribute corrector # Sets the attribute corrector
# #
# @param value [Object] the value to set the attribute corrector to. # @param value [Object] the value to set the attribute corrector to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def corrector=(_); end def corrector=(_); end
# Returns the value of attribute offenses # Returns the value of attribute offenses
# #
# @return [Object] the current value of offenses # @return [Object] the current value of offenses
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def offenses; end def offenses; end
# Sets the attribute offenses # Sets the attribute offenses
# #
# @param value [Object] the value to set the attribute offenses to. # @param value [Object] the value to set the attribute offenses to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def offenses=(_); end def offenses=(_); end
# Returns the value of attribute processed_source # Returns the value of attribute processed_source
# #
# @return [Object] the current value of processed_source # @return [Object] the current value of processed_source
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def processed_source; end def processed_source; end
# Sets the attribute processed_source # Sets the attribute processed_source
# #
# @param value [Object] the value to set the attribute processed_source to. # @param value [Object] the value to set the attribute processed_source to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/base.rb#48
def processed_source=(_); end def processed_source=(_); end
class << self class << self
# source://rubocop//lib/rubocop/cop/base.rb#48
def [](*_arg0); end def [](*_arg0); end
# source://rubocop//lib/rubocop/cop/base.rb#48
def inspect; end def inspect; end
# source://rubocop//lib/rubocop/cop/base.rb#48
def keyword_init?; end def keyword_init?; end
# source://rubocop//lib/rubocop/cop/base.rb#48
def members; end def members; end
# source://rubocop//lib/rubocop/cop/base.rb#48
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -2735,7 +2811,7 @@ class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter
# Legacy # Legacy
# #
# source://parser/3.3.8.0/lib/parser/source/tree_rewriter.rb#252 # source://rubocop//lib/rubocop/cop/corrector.rb#45
def rewrite; end def rewrite; end
# Swaps sources at the given ranges. # Swaps sources at the given ranges.
@ -2785,6 +2861,8 @@ RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Gemspec::AttributeAssignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Gemspec::DependencyVersion::ADD_DEPENDENCY_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Gemspec::DependencyVersion::ADD_DEPENDENCY_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String)
@ -3343,6 +3421,8 @@ RuboCop::Cop::Lint::FloatComparison::FLOAT_INSTANCE_METHODS = T.let(T.unsafe(nil
RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Lint::FloatComparison::MSG_CASE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::FloatComparison::MSG_EQUALITY = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::FloatComparison::MSG_EQUALITY = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::FloatComparison::MSG_INEQUALITY = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::FloatComparison::MSG_INEQUALITY = T.let(T.unsafe(nil), String)
@ -3739,6 +3819,10 @@ RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessConstantScoping::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::UselessConstantScoping::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessDefaultValueArgument::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessDefaultValueArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Lint::UselessDefined::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::UselessDefined::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessDefined::TYPES = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Lint::UselessDefined::TYPES = T.let(T.unsafe(nil), Hash)
@ -3751,6 +3835,10 @@ RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Lint::UselessOr::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessOr::TRUTHY_RETURN_VALUE_METHODS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Lint::UselessRescue::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::UselessRescue::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String)
@ -3910,6 +3998,10 @@ RuboCop::Cop::Naming::MethodName::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::MethodName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) RuboCop::Cop::Naming::MethodName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::PredicateMethod::MSG_NON_PREDICATE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::PredicateMethod::MSG_PREDICATE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String)
@ -4003,7 +4095,7 @@ class RuboCop::Cop::Offense
# @api public # @api public
# @return [Boolean] returns `true` if two offenses contain same attributes # @return [Boolean] returns `true` if two offenses contain same attributes
# #
# source://rubocop//lib/rubocop/cop/offense.rb#210 # source://rubocop//lib/rubocop/cop/offense.rb#216
def eql?(other); end def eql?(other); end
# @api private # @api private
@ -4091,23 +4183,31 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# Returns the value of attribute begin_pos # Returns the value of attribute begin_pos
# #
# @return [Object] the current value of begin_pos # @return [Object] the current value of begin_pos
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def begin_pos; end def begin_pos; end
# Sets the attribute begin_pos # Sets the attribute begin_pos
# #
# @param value [Object] the value to set the attribute begin_pos to. # @param value [Object] the value to set the attribute begin_pos to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def begin_pos=(_); end def begin_pos=(_); end
# Returns the value of attribute column # Returns the value of attribute column
# #
# @return [Object] the current value of column # @return [Object] the current value of column
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def column; end def column; end
# Sets the attribute column # Sets the attribute column
# #
# @param value [Object] the value to set the attribute column to. # @param value [Object] the value to set the attribute column to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def column=(_); end def column=(_); end
# source://rubocop//lib/rubocop/cop/offense.rb#69 # source://rubocop//lib/rubocop/cop/offense.rb#69
@ -4116,41 +4216,55 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# Returns the value of attribute end_pos # Returns the value of attribute end_pos
# #
# @return [Object] the current value of end_pos # @return [Object] the current value of end_pos
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def end_pos; end def end_pos; end
# Sets the attribute end_pos # Sets the attribute end_pos
# #
# @param value [Object] the value to set the attribute end_pos to. # @param value [Object] the value to set the attribute end_pos to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def end_pos=(_); end def end_pos=(_); end
# Returns the value of attribute line # Returns the value of attribute line
# #
# @return [Object] the current value of line # @return [Object] the current value of line
#
# source://rubocop//lib/rubocop/cop/offense.rb#65
def first_line; end def first_line; end
# Returns the value of attribute column # Returns the value of attribute column
# #
# @return [Object] the current value of column # @return [Object] the current value of column
#
# source://rubocop//lib/rubocop/cop/offense.rb#67
def last_column; end def last_column; end
# Returns the value of attribute line # Returns the value of attribute line
# #
# @return [Object] the current value of line # @return [Object] the current value of line
#
# source://rubocop//lib/rubocop/cop/offense.rb#66
def last_line; end def last_line; end
# source://rubocop//lib/rubocop/cop/offense.rb#73 # source://rubocop//lib/rubocop/cop/offense.rb#76
def length; end def length; end
# Returns the value of attribute line # Returns the value of attribute line
# #
# @return [Object] the current value of line # @return [Object] the current value of line
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def line; end def line; end
# Sets the attribute line # Sets the attribute line
# #
# @param value [Object] the value to set the attribute line to. # @param value [Object] the value to set the attribute line to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def line=(_); end def line=(_); end
# source://rubocop//lib/rubocop/cop/offense.rb#73 # source://rubocop//lib/rubocop/cop/offense.rb#73
@ -4159,19 +4273,32 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# Returns the value of attribute source_line # Returns the value of attribute source_line
# #
# @return [Object] the current value of source_line # @return [Object] the current value of source_line
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def source_line; end def source_line; end
# Sets the attribute source_line # Sets the attribute source_line
# #
# @param value [Object] the value to set the attribute source_line to. # @param value [Object] the value to set the attribute source_line to.
# @return [Object] the newly set value # @return [Object] the newly set value
#
# source://rubocop//lib/rubocop/cop/offense.rb#63
def source_line=(_); end def source_line=(_); end
class << self class << self
# source://rubocop//lib/rubocop/cop/offense.rb#63
def [](*_arg0); end def [](*_arg0); end
# source://rubocop//lib/rubocop/cop/offense.rb#63
def inspect; end def inspect; end
# source://rubocop//lib/rubocop/cop/offense.rb#63
def keyword_init?; end def keyword_init?; end
# source://rubocop//lib/rubocop/cop/offense.rb#63
def members; end def members; end
# source://rubocop//lib/rubocop/cop/offense.rb#63
def new(*_arg0); end def new(*_arg0); end
end end
end end
@ -4622,6 +4749,12 @@ RuboCop::Cop::Style::CollectionCompact::TO_ENUM_METHODS = T.let(T.unsafe(nil), A
RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::CollectionQuerying::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::CollectionQuerying::REPLACEMENTS = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::Style::CollectionQuerying::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::ColonMethodCall::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::ColonMethodCall::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String)
@ -4780,6 +4913,10 @@ RuboCop::Cop::Style::EmptyMethod::MSG_COMPACT = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::EmptyMethod::MSG_EXPANDED = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::EmptyMethod::MSG_EXPANDED = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::EmptyStringInsideInterpolation::MSG_TERNARY = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::EmptyStringInsideInterpolation::MSG_TRAILING_CONDITIONAL = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::Encoding::ENCODING_PATTERN = T.let(T.unsafe(nil), Regexp) RuboCop::Cop::Style::Encoding::ENCODING_PATTERN = T.let(T.unsafe(nil), Regexp)
RuboCop::Cop::Style::Encoding::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::Encoding::MSG = T.let(T.unsafe(nil), String)
@ -4832,7 +4969,9 @@ RuboCop::Cop::Style::ExplicitBlockArgument::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::Style::FetchEnvVar::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::FetchEnvVar::MSG_WITHOUT_NIL = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::FetchEnvVar::MSG_WITH_NIL = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::FetchEnvVar::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::FetchEnvVar::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
@ -4982,9 +5121,11 @@ RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ItAssignment::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::ItAssignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_BLOCK_PARAMETER = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_PARAMETER = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ItBlockParameter::MSG_USE_IT_BLOCK_PARAMETER = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_PARAMETER_MULTILINE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::ItBlockParameter::MSG_USE_IT_PARAMETER = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String)
@ -5056,9 +5197,9 @@ RuboCop::Cop::Style::MethodDefParentheses::MSG_PRESENT = T.let(T.unsafe(nil), St
RuboCop::Cop::Style::MinMax::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::MinMax::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::MinMaxComparison::COMPARISON_OPERATORS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::MinMaxComparison::COMPARISON_OPERATORS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Style::MinMaxComparison::GRATER_OPERATORS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::MinMaxComparison::GREATER_OPERATORS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::MinMaxComparison::LESS_OPERATORS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::MinMaxComparison::LESS_OPERATORS = T.let(T.unsafe(nil), Array)
@ -5254,6 +5395,10 @@ RuboCop::Cop::Style::RedundantArrayConstructor::MSG = T.let(T.unsafe(nil), Strin
RuboCop::Cop::Style::RedundantArrayConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::RedundantArrayConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::RedundantArrayFlatten::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::RedundantArrayFlatten::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::RedundantBegin::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::RedundantBegin::MSG = T.let(T.unsafe(nil), String)
@ -6407,9 +6552,9 @@ RuboCop::Formatter::PacmanFormatter::FALLBACK_TERMINAL_WIDTH = T.let(T.unsafe(ni
RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String) RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String)
RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::Presenter) RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::NullPresenter)
RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::Presenter) RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::NullPresenter)
RuboCop::Formatter::ProgressFormatter::DOT = T.let(T.unsafe(nil), String) RuboCop::Formatter::ProgressFormatter::DOT = T.let(T.unsafe(nil), String)
@ -6924,13 +7069,13 @@ class RuboCop::Runner
# source://rubocop//lib/rubocop/runner.rb#56 # source://rubocop//lib/rubocop/runner.rb#56
def errors; end def errors; end
# source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#50 # source://rubocop//lib/rubocop/runner.rb#248
def file_finished(file, offenses); end def file_finished(file, offenses); end
# source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#44 # source://rubocop//lib/rubocop/runner.rb#177
def file_offense_cache(file); end def file_offense_cache(file); end
# source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#36 # source://rubocop//lib/rubocop/runner.rb#485
def get_processed_source(*args); end def get_processed_source(*args); end
# source://rubocop//lib/rubocop/runner.rb#67 # source://rubocop//lib/rubocop/runner.rb#67
@ -7143,7 +7288,7 @@ class RuboCop::TargetFinder
# @api private # @api private
# @return [Boolean] # @return [Boolean]
# #
# source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#78 # source://rubocop//lib/rubocop/target_finder.rb#154
def ruby_file?(file); end def ruby_file?(file); end
# Finds all Ruby source files under the current or other supplied directory. A Ruby source file # Finds all Ruby source files under the current or other supplied directory. A Ruby source file

View File

@ -8,24 +8,25 @@
# source://vernier//lib/vernier/version.rb#3 # source://vernier//lib/vernier/version.rb#3
module Vernier module Vernier
class << self class << self
# source://vernier//lib/vernier/marker.rb#3
def memory_rss; end def memory_rss; end
# source://vernier//lib/vernier.rb#20 # source://vernier//lib/vernier.rb#21
def profile(mode: T.unsafe(nil), **collector_options); end def profile(mode: T.unsafe(nil), **collector_options); end
# source://vernier//lib/vernier.rb#20 # source://vernier//lib/vernier.rb#37
def run(mode: T.unsafe(nil), **collector_options); end def run(mode: T.unsafe(nil), **collector_options); end
# source://vernier//lib/vernier.rb#41 # source://vernier//lib/vernier.rb#42
def start_profile(mode: T.unsafe(nil), **collector_options); end def start_profile(mode: T.unsafe(nil), **collector_options); end
# source://vernier//lib/vernier.rb#53 # source://vernier//lib/vernier.rb#54
def stop_profile; end def stop_profile; end
# source://vernier//lib/vernier.rb#20 # source://vernier//lib/vernier.rb#36
def trace(mode: T.unsafe(nil), **collector_options); end def trace(mode: T.unsafe(nil), **collector_options); end
# source://vernier//lib/vernier.rb#62 # source://vernier//lib/vernier.rb#63
def trace_retained(**profile_options, &block); end def trace_retained(**profile_options, &block); end
end end
end end
@ -37,7 +38,7 @@ class Vernier::Collector
# source://vernier//lib/vernier/collector.rb#8 # source://vernier//lib/vernier/collector.rb#8
def initialize(mode, options = T.unsafe(nil)); end def initialize(mode, options = T.unsafe(nil)); end
# source://vernier//lib/vernier/collector.rb#53 # source://vernier//lib/vernier/collector.rb#54
def add_marker(name:, start:, finish:, thread: T.unsafe(nil), phase: T.unsafe(nil), data: T.unsafe(nil)); end def add_marker(name:, start:, finish:, thread: T.unsafe(nil), phase: T.unsafe(nil), data: T.unsafe(nil)); end
# Get the current time. # Get the current time.
@ -46,38 +47,45 @@ class Vernier::Collector
# integer nanoseconds. It's the same time used by Vernier internals and # integer nanoseconds. It's the same time used by Vernier internals and
# can be used to generate timestamps for custom markers. # can be used to generate timestamps for custom markers.
# #
# source://vernier//lib/vernier/collector.rb#49 # source://vernier//lib/vernier/collector.rb#50
def current_time; end def current_time; end
# Record an interval with a category and name. Yields to a block and # Record an interval with a category and name. Yields to a block and
# records the amount of time spent in the block as an interval marker. # records the amount of time spent in the block as an interval marker.
# #
# source://vernier//lib/vernier/collector.rb#65 # source://vernier//lib/vernier/collector.rb#66
def record_interval(category, name = T.unsafe(nil)); end def record_interval(category, name = T.unsafe(nil)); end
# source://vernier//lib/vernier/marker.rb#3
def sample; end def sample; end
# source://vernier//lib/vernier/marker.rb#3
def stack_table; end def stack_table; end
# source://vernier//lib/vernier/marker.rb#3
def start; end def start; end
# source://vernier//lib/vernier/collector.rb#78 # source://vernier//lib/vernier/collector.rb#79
def stop; end def stop; end
private private
# source://vernier//lib/vernier/collector.rb#32 # source://vernier//lib/vernier/collector.rb#33
def add_hook(hook); end def add_hook(hook); end
# source://vernier//lib/vernier/marker.rb#3
def finish; end def finish; end
class << self class << self
# source://vernier//lib/vernier/marker.rb#3
def _new(_arg0, _arg1); end def _new(_arg0, _arg1); end
# source://vernier//lib/vernier.rb#67 # source://vernier//lib/vernier.rb#68
def new(mode, options = T.unsafe(nil)); end def new(mode, options = T.unsafe(nil)); end
end end
end end
# source://vernier//lib/vernier.rb#16 # source://vernier//lib/vernier.rb#17
class Vernier::Error < ::StandardError; end class Vernier::Error < ::StandardError; end
# source://vernier//lib/vernier/hooks.rb#4 # source://vernier//lib/vernier/hooks.rb#4
@ -160,9 +168,16 @@ Vernier::Marker::Type::THREAD_STALLED = T.let(T.unsafe(nil), Integer)
Vernier::Marker::Type::THREAD_SUSPENDED = T.let(T.unsafe(nil), Integer) Vernier::Marker::Type::THREAD_SUSPENDED = T.let(T.unsafe(nil), Integer)
class Vernier::MemoryTracker class Vernier::MemoryTracker
# source://vernier//lib/vernier/marker.rb#3
def record; end def record; end
# source://vernier//lib/vernier/marker.rb#3
def results; end def results; end
# source://vernier//lib/vernier/marker.rb#3
def start; end def start; end
# source://vernier//lib/vernier/marker.rb#3
def stop; end def stop; end
end end
@ -180,6 +195,48 @@ end
# source://vernier//lib/vernier/output/filename_filter.rb#4 # source://vernier//lib/vernier/output/filename_filter.rb#4
module Vernier::Output; end module Vernier::Output; end
# source://vernier//lib/vernier/output/cpuprofile.rb#5
class Vernier::Output::Cpuprofile
# @return [Cpuprofile] a new instance of Cpuprofile
#
# source://vernier//lib/vernier/output/cpuprofile.rb#6
def initialize(profile); end
# source://vernier//lib/vernier/output/cpuprofile.rb#10
def output; end
private
# source://vernier//lib/vernier/output/cpuprofile.rb#53
def build_nodes; end
# source://vernier//lib/vernier/output/cpuprofile.rb#128
def calculate_time_deltas(timestamps); end
# source://vernier//lib/vernier/output/cpuprofile.rb#85
def create_node_for_stack(stack_idx, nodes, stack_table); end
# source://vernier//lib/vernier/output/cpuprofile.rb#22
def data; end
# source://vernier//lib/vernier/output/cpuprofile.rb#43
def empty_profile; end
# source://vernier//lib/vernier/output/cpuprofile.rb#18
def ns_to_us(timestamp); end
# Returns the value of attribute profile.
#
# source://vernier//lib/vernier/output/cpuprofile.rb#16
def profile; end
# source://vernier//lib/vernier/output/cpuprofile.rb#70
def root_node; end
# source://vernier//lib/vernier/output/cpuprofile.rb#124
def stack_to_node_id(stack_idx); end
end
# source://vernier//lib/vernier/output/file_listing.rb#8 # source://vernier//lib/vernier/output/file_listing.rb#8
class Vernier::Output::FileListing class Vernier::Output::FileListing
# @return [FileListing] a new instance of FileListing # @return [FileListing] a new instance of FileListing
@ -573,13 +630,13 @@ end
class Vernier::Result class Vernier::Result
# Returns the value of attribute stack_table. # Returns the value of attribute stack_table.
# #
# source://vernier//lib/vernier/result.rb#3 # source://vernier//lib/vernier/result.rb#4
def _stack_table; end def _stack_table; end
# source://vernier//lib/vernier/result.rb#49 # source://vernier//lib/vernier/result.rb#61
def each_sample; end def each_sample; end
# source://vernier//lib/vernier/result.rb#41 # source://vernier//lib/vernier/result.rb#53
def elapsed_seconds; end def elapsed_seconds; end
# Returns the value of attribute end_time. # Returns the value of attribute end_time.
@ -611,7 +668,7 @@ class Vernier::Result
# source://vernier//lib/vernier/result.rb#8 # source://vernier//lib/vernier/result.rb#8
def hooks=(_arg0); end def hooks=(_arg0); end
# source://vernier//lib/vernier/result.rb#45 # source://vernier//lib/vernier/result.rb#57
def inspect; end def inspect; end
# source://vernier//lib/vernier/result.rb#15 # source://vernier//lib/vernier/result.rb#15
@ -659,7 +716,7 @@ class Vernier::Result
# source://vernier//lib/vernier/result.rb#21 # source://vernier//lib/vernier/result.rb#21
def samples; end def samples; end
# source://vernier//lib/vernier/result.rb#58 # source://vernier//lib/vernier/result.rb#70
def stack(idx); end def stack(idx); end
# Returns the value of attribute stack_table. # Returns the value of attribute stack_table.
@ -691,10 +748,16 @@ class Vernier::Result
# source://vernier//lib/vernier/result.rb#11 # source://vernier//lib/vernier/result.rb#11
def threads=(_arg0); end def threads=(_arg0); end
# source://vernier//lib/vernier/result.rb#37
def to_cpuprofile; end
# source://vernier//lib/vernier/result.rb#32 # source://vernier//lib/vernier/result.rb#32
def to_firefox(gzip: T.unsafe(nil)); end
# source://vernier//lib/vernier/result.rb#35
def to_gecko(gzip: T.unsafe(nil)); end def to_gecko(gzip: T.unsafe(nil)); end
# source://vernier//lib/vernier/result.rb#62 # source://vernier//lib/vernier/result.rb#74
def total_bytes; end def total_bytes; end
# TODO: remove these # TODO: remove these
@ -702,28 +765,52 @@ class Vernier::Result
# source://vernier//lib/vernier/result.rb#20 # source://vernier//lib/vernier/result.rb#20
def weights; end def weights; end
# source://vernier//lib/vernier/result.rb#36 # source://vernier//lib/vernier/result.rb#41
def write(out:); end def write(out:, format: T.unsafe(nil)); end
end end
# source://vernier//lib/vernier/stack_table.rb#4 # source://vernier//lib/vernier/stack_table.rb#4
class Vernier::StackTable class Vernier::StackTable
include ::Vernier::StackTableHelpers include ::Vernier::StackTableHelpers
# source://vernier//lib/vernier/marker.rb#3
def convert(_arg0, _arg1); end def convert(_arg0, _arg1); end
# source://vernier//lib/vernier/marker.rb#3
def current_stack(*_arg0); end def current_stack(*_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def frame_count; end def frame_count; end
# source://vernier//lib/vernier/marker.rb#3
def frame_func_idx(_arg0); end def frame_func_idx(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def frame_line_no(_arg0); end def frame_line_no(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def func_count; end def func_count; end
# source://vernier//lib/vernier/marker.rb#3
def func_filename(_arg0); end def func_filename(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def func_first_lineno(_arg0); end def func_first_lineno(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def func_name(_arg0); end def func_name(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def stack_count; end def stack_count; end
# source://vernier//lib/vernier/marker.rb#3
def stack_frame_idx(_arg0); end def stack_frame_idx(_arg0); end
# source://vernier//lib/vernier/marker.rb#3
def stack_parent_idx(_arg0); end def stack_parent_idx(_arg0); end
class << self class << self
# source://vernier//lib/vernier/marker.rb#3
def new; end def new; end
end end
end end
@ -781,7 +868,7 @@ class Vernier::StackTableHelpers::Frame < ::Vernier::StackTableHelpers::BaseType
# source://vernier//lib/vernier/stack_table_helpers.rb#83 # source://vernier//lib/vernier/stack_table_helpers.rb#83
def line; end def line; end
# source://vernier//lib/vernier/stack_table_helpers.rb#74 # source://vernier//lib/vernier/stack_table_helpers.rb#76
def name; end def name; end
# source://vernier//lib/vernier/stack_table_helpers.rb#87 # source://vernier//lib/vernier/stack_table_helpers.rb#87
@ -796,7 +883,7 @@ class Vernier::StackTableHelpers::Func < ::Vernier::StackTableHelpers::BaseType
# source://vernier//lib/vernier/stack_table_helpers.rb#59 # source://vernier//lib/vernier/stack_table_helpers.rb#59
def label; end def label; end
# source://vernier//lib/vernier/stack_table_helpers.rb#59 # source://vernier//lib/vernier/stack_table_helpers.rb#62
def name; end def name; end
# source://vernier//lib/vernier/stack_table_helpers.rb#68 # source://vernier//lib/vernier/stack_table_helpers.rb#68
@ -813,7 +900,7 @@ class Vernier::StackTableHelpers::Stack < ::Vernier::StackTableHelpers::BaseType
# source://vernier//lib/vernier/stack_table_helpers.rb#93 # source://vernier//lib/vernier/stack_table_helpers.rb#93
def each; end def each; end
# source://vernier//lib/vernier/stack_table_helpers.rb#93 # source://vernier//lib/vernier/stack_table_helpers.rb#103
def each_frame; end def each_frame; end
# source://vernier//lib/vernier/stack_table_helpers.rb#123 # source://vernier//lib/vernier/stack_table_helpers.rb#123

View File

@ -86,7 +86,7 @@ module Homebrew
end end
shfmt_result = files.present? && shell_files.empty? shfmt_result = files.present? && shell_files.empty?
shfmt_result ||= run_shfmt(shell_files, fix:) shfmt_result ||= run_shfmt!(shell_files, fix:)
actionlint_files = github_workflow_files if files.blank? && actionlint_files.blank? actionlint_files = github_workflow_files if files.blank? && actionlint_files.blank?
has_actionlint_workflow = actionlint_files.any? do |path| has_actionlint_workflow = actionlint_files.any? do |path|
@ -94,7 +94,7 @@ module Homebrew
end end
odebug "actionlint workflow detected. Skipping actionlint checks." if has_actionlint_workflow odebug "actionlint workflow detected. Skipping actionlint checks." if has_actionlint_workflow
actionlint_result = files.present? && (has_actionlint_workflow || actionlint_files.empty?) actionlint_result = files.present? && (has_actionlint_workflow || actionlint_files.empty?)
actionlint_result ||= run_actionlint(actionlint_files) actionlint_result ||= run_actionlint!(actionlint_files)
if output_type == :json if output_type == :json
Offenses.new(rubocop_result + shellcheck_result) Offenses.new(rubocop_result + shellcheck_result)
@ -176,7 +176,7 @@ module Homebrew
# Don't show the default formatter's progress dots # Don't show the default formatter's progress dots
# on CI or if only checking a single file. # on CI or if only checking a single file.
args << "--format" << "clang" if ENV["CI"] || files.count { |f| !f.directory? } == 1 args << "--format" << "clang" if ENV["CI"] || files.one? { |f| !f.directory? }
args << "--color" if Tty.color? args << "--color" if Tty.color?
@ -264,7 +264,7 @@ module Homebrew
end end
end end
def self.run_shfmt(files, fix: false) def self.run_shfmt!(files, fix: false)
files = shell_scripts if files.blank? files = shell_scripts if files.blank?
# Do not format completions and Dockerfile # Do not format completions and Dockerfile
files.delete(HOMEBREW_REPOSITORY/"completions/bash/brew") files.delete(HOMEBREW_REPOSITORY/"completions/bash/brew")
@ -277,7 +277,7 @@ module Homebrew
$CHILD_STATUS.success? $CHILD_STATUS.success?
end end
def self.run_actionlint(files) def self.run_actionlint!(files)
files = github_workflow_files if files.blank? files = github_workflow_files if files.blank?
# the ignore is to avoid false positives in e.g. actions, homebrew-test-bot # the ignore is to avoid false positives in e.g. actions, homebrew-test-bot
system actionlint, "-shellcheck", shellcheck, system actionlint, "-shellcheck", shellcheck,

View File

@ -55,7 +55,7 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
it "skips" do it "skips" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(described_class.preinstall("google-chrome")).to be(false) expect(described_class.preinstall!("google-chrome")).to be(false)
end end
end end
@ -69,8 +69,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "google-chrome", verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "google-chrome", verbose: false)
.and_return(true) .and_return(true)
expect(described_class.preinstall("google-chrome")).to be(true) expect(described_class.preinstall!("google-chrome")).to be(true)
expect(described_class.install("google-chrome")).to be(true) expect(described_class.install!("google-chrome")).to be(true)
end end
end end
@ -85,8 +85,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "opera", verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "opera", verbose: false)
.and_return(true) .and_return(true)
expect(described_class.preinstall("opera", greedy: true)).to be(true) expect(described_class.preinstall!("opera", greedy: true)).to be(true)
expect(described_class.install("opera", greedy: true)).to be(true) expect(described_class.install!("opera", greedy: true)).to be(true)
end end
end end
@ -99,8 +99,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt", expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt",
verbose: false) verbose: false)
.and_return(true) .and_return(true)
expect(described_class.preinstall("google-chrome")).to be(true) expect(described_class.preinstall!("google-chrome")).to be(true)
expect(described_class.install("google-chrome")).to be(true) expect(described_class.install!("google-chrome")).to be(true)
end end
it "installs cask with arguments" do it "installs cask with arguments" do
@ -109,16 +109,16 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
verbose: false) verbose: false)
.and_return(true), .and_return(true),
) )
expect(described_class.preinstall("firefox", args: { appdir: "/Applications" })).to be(true) expect(described_class.preinstall!("firefox", args: { appdir: "/Applications" })).to be(true)
expect(described_class.install("firefox", args: { appdir: "/Applications" })).to be(true) expect(described_class.install!("firefox", args: { appdir: "/Applications" })).to be(true)
end end
it "reports a failure" do it "reports a failure" do
expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt", expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt",
verbose: false) verbose: false)
.and_return(false) .and_return(false)
expect(described_class.preinstall("google-chrome")).to be(true) expect(described_class.preinstall!("google-chrome")).to be(true)
expect(described_class.install("google-chrome")).to be(false) expect(described_class.install!("google-chrome")).to be(false)
end end
context "with boolean arguments" do context "with boolean arguments" do
@ -126,15 +126,15 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--force", expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--force",
verbose: false) verbose: false)
.and_return(true) .and_return(true)
expect(described_class.preinstall("iterm", args: { force: true })).to be(true) expect(described_class.preinstall!("iterm", args: { force: true })).to be(true)
expect(described_class.install("iterm", args: { force: true })).to be(true) expect(described_class.install!("iterm", args: { force: true })).to be(true)
end end
it "does not include a flag if false" do it "does not include a flag if false" do
expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--adopt", verbose: false) expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--adopt", verbose: false)
.and_return(true) .and_return(true)
expect(described_class.preinstall("iterm", args: { force: false })).to be(true) expect(described_class.preinstall!("iterm", args: { force: false })).to be(true)
expect(described_class.install("iterm", args: { force: false })).to be(true) expect(described_class.install!("iterm", args: { force: false })).to be(true)
end end
end end
end end
@ -150,14 +150,14 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do
it "runs the postinstall command" do it "runs the postinstall command" do
expect(Kernel).to receive(:system).with("custom command").and_return(true) expect(Kernel).to receive(:system).with("custom command").and_return(true)
expect(described_class.preinstall("google-chrome", postinstall: "custom command")).to be(true) expect(described_class.preinstall!("google-chrome", postinstall: "custom command")).to be(true)
expect(described_class.install("google-chrome", postinstall: "custom command")).to be(true) expect(described_class.install!("google-chrome", postinstall: "custom command")).to be(true)
end end
it "reports a failure when postinstall fails" do it "reports a failure when postinstall fails" do
expect(Kernel).to receive(:system).with("custom command").and_return(false) expect(Kernel).to receive(:system).with("custom command").and_return(false)
expect(described_class.preinstall("google-chrome", postinstall: "custom command")).to be(true) expect(described_class.preinstall!("google-chrome", postinstall: "custom command")).to be(true)
expect(described_class.install("google-chrome", postinstall: "custom command")).to be(false) expect(described_class.install!("google-chrome", postinstall: "custom command")).to be(false)
end end
end end
end end

View File

@ -28,28 +28,28 @@ RSpec.describe Homebrew::Bundle::Commands::Install do
end end
it "does not raise an error" do it "does not raise an error" do
allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall).and_return(false) allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall!).and_return(false)
allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall).and_return(false) allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall!).and_return(false)
allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true)
allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents)
expect { described_class.run }.not_to raise_error expect { described_class.run }.not_to raise_error
end end
it "#dsl returns a valid DSL" do it "#dsl returns a valid DSL" do
allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall).and_return(false) allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall!).and_return(false)
allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall).and_return(false) allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall!).and_return(false)
allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true)
allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents)
described_class.run described_class.run
expect(described_class.dsl.entries.first.name).to eql("phinze/cask") expect(described_class.dsl.entries.first.name).to eql("phinze/cask")
end end
it "does not raise an error when skippable" do it "does not raise an error when skippable" do
expect(Homebrew::Bundle::FormulaInstaller).not_to receive(:install) expect(Homebrew::Bundle::FormulaInstaller).not_to receive(:install!)
allow(Homebrew::Bundle::Skipper).to receive(:skip?).and_return(true) allow(Homebrew::Bundle::Skipper).to receive(:skip?).and_return(true)
allow_any_instance_of(Pathname).to receive(:read) allow_any_instance_of(Pathname).to receive(:read)
@ -58,22 +58,22 @@ RSpec.describe Homebrew::Bundle::Commands::Install do
end end
it "exits on failures" do it "exits on failures" do
allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: false)
allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: false)
allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: false)
allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall!: true, install!: false)
allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall!: true, install!: false)
allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents)
expect { described_class.run }.to raise_error(SystemExit) expect { described_class.run }.to raise_error(SystemExit)
end end
it "skips installs from failed taps" do it "skips installs from failed taps" do
allow(Homebrew::Bundle::CaskInstaller).to receive(:preinstall).and_return(false) allow(Homebrew::Bundle::CaskInstaller).to receive(:preinstall!).and_return(false)
allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall: true, install: false) allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall!: true, install!: false)
allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true)
allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall: true, install: true) allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall!: true, install!: true)
allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents)
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)

View File

@ -37,15 +37,15 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
context "with a successful installation" do context "with a successful installation" do
it "start service" do it "start service" do
expect(Homebrew::Bundle::BrewServices).not_to receive(:start) expect(Homebrew::Bundle::BrewServices).not_to receive(:start)
described_class.preinstall(formula_name, start_service: true) described_class.preinstall!(formula_name, start_service: true)
described_class.install(formula_name, start_service: true) described_class.install!(formula_name, start_service: true)
end end
end end
context "with a skipped installation" do context "with a skipped installation" do
it "start service" do it "start service" do
expect(Homebrew::Bundle::BrewServices).not_to receive(:start) expect(Homebrew::Bundle::BrewServices).not_to receive(:start)
described_class.install(formula_name, preinstall: false, start_service: true) described_class.install!(formula_name, preinstall: false, start_service: true)
end end
end end
end end
@ -59,8 +59,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "start service" do it "start service" do
expect(Homebrew::Bundle::BrewServices).to \ expect(Homebrew::Bundle::BrewServices).to \
receive(:start).with(formula_name, file: nil, verbose: false).and_return(true) receive(:start).with(formula_name, file: nil, verbose: false).and_return(true)
described_class.preinstall(formula_name, start_service: true) described_class.preinstall!(formula_name, start_service: true)
described_class.install(formula_name, start_service: true) described_class.install!(formula_name, start_service: true)
end end
end end
@ -68,7 +68,7 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "start service" do it "start service" do
expect(Homebrew::Bundle::BrewServices).to \ expect(Homebrew::Bundle::BrewServices).to \
receive(:start).with(formula_name, file: nil, verbose: false).and_return(true) receive(:start).with(formula_name, file: nil, verbose: false).and_return(true)
described_class.install(formula_name, preinstall: false, start_service: true) described_class.install!(formula_name, preinstall: false, start_service: true)
end end
end end
end end
@ -84,8 +84,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "restart service" do it "restart service" do
expect(Homebrew::Bundle::BrewServices).to \ expect(Homebrew::Bundle::BrewServices).to \
receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true) receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true)
described_class.preinstall(formula_name, restart_service: :always) described_class.preinstall!(formula_name, restart_service: :always)
described_class.install(formula_name, restart_service: :always) described_class.install!(formula_name, restart_service: :always)
end end
end end
@ -93,7 +93,7 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "restart service" do it "restart service" do
expect(Homebrew::Bundle::BrewServices).to \ expect(Homebrew::Bundle::BrewServices).to \
receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true) receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true)
described_class.install(formula_name, preinstall: false, restart_service: :always) described_class.install!(formula_name, preinstall: false, restart_service: :always)
end end
end end
end end
@ -107,8 +107,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
allow_any_instance_of(described_class).to receive(:linked?).and_return(false) allow_any_instance_of(described_class).to receive(:linked?).and_return(false)
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: true) described_class.preinstall!(formula_name, link: true)
described_class.install(formula_name, link: true) described_class.install!(formula_name, link: true)
end end
it "force-links keg-only formula" do it "force-links keg-only formula" do
@ -116,8 +116,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
allow_any_instance_of(described_class).to receive(:keg_only?).and_return(true) allow_any_instance_of(described_class).to receive(:keg_only?).and_return(true)
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--force", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--force", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: true) described_class.preinstall!(formula_name, link: true)
described_class.install(formula_name, link: true) described_class.install!(formula_name, link: true)
end end
end end
@ -130,8 +130,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
allow_any_instance_of(described_class).to receive(:linked?).and_return(false) allow_any_instance_of(described_class).to receive(:linked?).and_return(false)
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--overwrite", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--overwrite", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: :overwrite) described_class.preinstall!(formula_name, link: :overwrite)
described_class.install(formula_name, link: :overwrite) described_class.install!(formula_name, link: :overwrite)
end end
end end
@ -144,8 +144,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
allow_any_instance_of(described_class).to receive(:linked?).and_return(true) allow_any_instance_of(described_class).to receive(:linked?).and_return(true)
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: false) described_class.preinstall!(formula_name, link: false)
described_class.install(formula_name, link: false) described_class.install!(formula_name, link: false)
end end
end end
@ -159,8 +159,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "links formula" do it "links formula" do
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: nil) described_class.preinstall!(formula_name, link: nil)
described_class.install(formula_name, link: nil) described_class.install!(formula_name, link: nil)
end end
end end
@ -174,9 +174,9 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "unlinks formula" do it "unlinks formula" do
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql",
verbose: false).and_return(true) verbose: false).and_return(true)
described_class.preinstall(formula_name, link: nil) described_class.preinstall!(formula_name, link: nil)
described_class.install(formula_name, link: nil) described_class.install!(formula_name, link: nil)
end end
end end
@ -188,8 +188,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
conflicts_with: ["mysql55"], conflicts_with: ["mysql55"],
) )
allow(described_class).to receive(:formula_installed?).and_return(true) allow(described_class).to receive(:formula_installed?).and_return(true)
allow_any_instance_of(described_class).to receive(:install!).and_return(true) allow_any_instance_of(described_class).to receive(:install_formula!).and_return(true)
allow_any_instance_of(described_class).to receive(:upgrade!).and_return(true) allow_any_instance_of(described_class).to receive(:upgrade_formula!).and_return(true)
end end
it "unlinks conflicts and stops their services" do it "unlinks conflicts and stops their services" do
@ -203,8 +203,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true) expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true)
expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil, expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil,
verbose:).and_return(true) verbose:).and_return(true)
described_class.preinstall(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) described_class.preinstall!(formula_name, restart_service: :always, conflicts_with: ["mysql56"])
described_class.install(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) described_class.install!(formula_name, restart_service: :always, conflicts_with: ["mysql56"])
end end
it "prints a message" do it "prints a message" do
@ -219,8 +219,10 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true) expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true)
expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil, expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil,
verbose:).and_return(true) verbose:).and_return(true)
described_class.preinstall(formula_name, restart_service: :always, conflicts_with: ["mysql56"], verbose: true) described_class.preinstall!(formula_name, restart_service: :always, conflicts_with: ["mysql56"],
described_class.install(formula_name, restart_service: :always, conflicts_with: ["mysql56"], verbose: true) verbose: true)
described_class.install!(formula_name, restart_service: :always, conflicts_with: ["mysql56"],
verbose: true)
end end
end end
@ -237,14 +239,14 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "runs the postinstall command" do it "runs the postinstall command" do
expect(Kernel).to receive(:system).with("custom command").and_return(true) expect(Kernel).to receive(:system).with("custom command").and_return(true)
described_class.preinstall(formula_name, postinstall: "custom command") described_class.preinstall!(formula_name, postinstall: "custom command")
described_class.install(formula_name, postinstall: "custom command") described_class.install!(formula_name, postinstall: "custom command")
end end
it "reports a failure" do it "reports a failure" do
expect(Kernel).to receive(:system).with("custom command").and_return(false) expect(Kernel).to receive(:system).with("custom command").and_return(false)
described_class.preinstall(formula_name, postinstall: "custom command") described_class.preinstall!(formula_name, postinstall: "custom command")
expect(described_class.install(formula_name, postinstall: "custom command")).to be(false) expect(described_class.install!(formula_name, postinstall: "custom command")).to be(false)
end end
end end
@ -255,8 +257,8 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "does not run the postinstall command" do it "does not run the postinstall command" do
expect(Kernel).not_to receive(:system) expect(Kernel).not_to receive(:system)
described_class.preinstall(formula_name, postinstall: "custom command") described_class.preinstall!(formula_name, postinstall: "custom command")
described_class.install(formula_name, postinstall: "custom command") described_class.install!(formula_name, postinstall: "custom command")
end end
end end
end end
@ -281,16 +283,16 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "writes the version to the file" do it "writes the version to the file" do
expect(File).to receive(:write).with(version_file, "#{version}\n") expect(File).to receive(:write).with(version_file, "#{version}\n")
described_class.preinstall(formula_name, version_file:) described_class.preinstall!(formula_name, version_file:)
described_class.install(formula_name, version_file:) described_class.install!(formula_name, version_file:)
end end
end end
context "when using the latest formula" do context "when using the latest formula" do
it "writes the version to the file" do it "writes the version to the file" do
expect(File).to receive(:write).with(version_file, "#{version}\n") expect(File).to receive(:write).with(version_file, "#{version}\n")
described_class.preinstall(formula_name, version_file:) described_class.preinstall!(formula_name, version_file:)
described_class.install(formula_name, version_file:) described_class.install!(formula_name, version_file:)
end end
end end
end end
@ -304,7 +306,7 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "did not call restart service" do it "did not call restart service" do
expect(Homebrew::Bundle::BrewServices).not_to receive(:restart) expect(Homebrew::Bundle::BrewServices).not_to receive(:restart)
described_class.preinstall(formula_name, restart_service: true) described_class.preinstall!(formula_name, restart_service: true)
end end
end end
@ -386,16 +388,16 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
expect(Homebrew::Bundle).to receive(:system) expect(Homebrew::Bundle).to receive(:system)
.with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false) .with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false)
.and_return(true) .and_return(true)
expect(installer.preinstall).to be(true) expect(installer.preinstall!).to be(true)
expect(installer.install).to be(true) expect(installer.install!).to be(true)
end end
it "reports a failure" do it "reports a failure" do
expect(Homebrew::Bundle).to receive(:system) expect(Homebrew::Bundle).to receive(:system)
.with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false) .with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false)
.and_return(false) .and_return(false)
expect(installer.preinstall).to be(true) expect(installer.preinstall!).to be(true)
expect(installer.install).to be(false) expect(installer.install!).to be(false)
end end
end end
@ -416,16 +418,16 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false)
.and_return(true) .and_return(true)
expect(installer.preinstall).to be(true) expect(installer.preinstall!).to be(true)
expect(installer.install).to be(true) expect(installer.install!).to be(true)
end end
it "reports a failure" do it "reports a failure" do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false)
.and_return(false) .and_return(false)
expect(installer.preinstall).to be(true) expect(installer.preinstall!).to be(true)
expect(installer.install).to be(false) expect(installer.install!).to be(false)
end end
context "when formula pinned" do context "when formula pinned" do
@ -436,7 +438,7 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "does not upgrade formula" do it "does not upgrade formula" do
expect(Homebrew::Bundle).not_to \ expect(Homebrew::Bundle).not_to \
receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false)
expect(installer.preinstall).to be(false) expect(installer.preinstall!).to be(false)
end end
end end
@ -447,7 +449,7 @@ RSpec.describe Homebrew::Bundle::FormulaInstaller do
it "does not upgrade formula" do it "does not upgrade formula" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(installer.preinstall).to be(false) expect(installer.preinstall!).to be(false)
end end
end end
end end

View File

@ -30,7 +30,7 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do
it "tries to install mas" do it "tries to install mas" do
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "mas", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "mas",
verbose: false).and_return(true) verbose: false).and_return(true)
expect { described_class.preinstall("foo", 123) }.to raise_error(RuntimeError) expect { described_class.preinstall!("foo", 123) }.to raise_error(RuntimeError)
end end
describe ".outdated_app_ids" do describe ".outdated_app_ids" do
@ -62,7 +62,7 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do
it "skips" do it "skips" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(described_class.preinstall("foo", 123)).to be(false) expect(described_class.preinstall!("foo", 123)).to be(false)
end end
end end
@ -73,8 +73,8 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do
it "upgrades" do it "upgrades" do
expect(Homebrew::Bundle).to receive(:system).with("mas", "upgrade", "123", verbose: false).and_return(true) expect(Homebrew::Bundle).to receive(:system).with("mas", "upgrade", "123", verbose: false).and_return(true)
expect(described_class.preinstall("foo", 123)).to be(true) expect(described_class.preinstall!("foo", 123)).to be(true)
expect(described_class.install("foo", 123)).to be(true) expect(described_class.install!("foo", 123)).to be(true)
end end
end end
@ -85,8 +85,8 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do
it "installs app" do it "installs app" do
expect(Homebrew::Bundle).to receive(:system).with("mas", "install", "123", verbose: false).and_return(true) expect(Homebrew::Bundle).to receive(:system).with("mas", "install", "123", verbose: false).and_return(true)
expect(described_class.preinstall("foo", 123)).to be(true) expect(described_class.preinstall!("foo", 123)).to be(true)
expect(described_class.install("foo", 123)).to be(true) expect(described_class.install!("foo", 123)).to be(true)
end end
end end
end end

View File

@ -22,7 +22,7 @@ RSpec.describe Homebrew::Bundle::TapInstaller do
it "skips" do it "skips" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(described_class.preinstall("homebrew/cask")).to be(false) expect(described_class.preinstall!("homebrew/cask")).to be(false)
end end
end end
@ -34,8 +34,8 @@ RSpec.describe Homebrew::Bundle::TapInstaller do
it "taps" do it "taps" do
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask",
verbose: false).and_return(true) verbose: false).and_return(true)
expect(described_class.preinstall("homebrew/cask")).to be(true) expect(described_class.preinstall!("homebrew/cask")).to be(true)
expect(described_class.install("homebrew/cask")).to be(true) expect(described_class.install!("homebrew/cask")).to be(true)
end end
context "with clone target" do context "with clone target" do
@ -43,16 +43,16 @@ RSpec.describe Homebrew::Bundle::TapInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path", receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path",
verbose: false).and_return(true) verbose: false).and_return(true)
expect(described_class.preinstall("homebrew/cask", clone_target: "clone_target_path")).to be(true) expect(described_class.preinstall!("homebrew/cask", clone_target: "clone_target_path")).to be(true)
expect(described_class.install("homebrew/cask", clone_target: "clone_target_path")).to be(true) expect(described_class.install!("homebrew/cask", clone_target: "clone_target_path")).to be(true)
end end
it "fails" do it "fails" do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path", receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path",
verbose: false).and_return(false) verbose: false).and_return(false)
expect(described_class.preinstall("homebrew/cask", clone_target: "clone_target_path")).to be(true) expect(described_class.preinstall!("homebrew/cask", clone_target: "clone_target_path")).to be(true)
expect(described_class.install("homebrew/cask", clone_target: "clone_target_path")).to be(false) expect(described_class.install!("homebrew/cask", clone_target: "clone_target_path")).to be(false)
end end
end end
end end

View File

@ -15,7 +15,7 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(HOMEBREW_BREW_FILE, "install", "--cask", "visual-studio-code", verbose: false) receive(:system).with(HOMEBREW_BREW_FILE, "install", "--cask", "visual-studio-code", verbose: false)
.and_return(true) .and_return(true)
expect { described_class.preinstall("foo") }.to raise_error(RuntimeError) expect { described_class.preinstall!("foo") }.to raise_error(RuntimeError)
end end
end end
@ -31,12 +31,12 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do
it "skips" do it "skips" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(described_class.preinstall("foo")).to be(false) expect(described_class.preinstall!("foo")).to be(false)
end end
it "skips ignoring case" do it "skips ignoring case" do
expect(Homebrew::Bundle).not_to receive(:system) expect(Homebrew::Bundle).not_to receive(:system)
expect(described_class.preinstall("Foo")).to be(false) expect(described_class.preinstall!("Foo")).to be(false)
end end
end end
@ -48,8 +48,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do
it "installs extension" do it "installs extension" do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true)
expect(described_class.preinstall("foo")).to be(true) expect(described_class.preinstall!("foo")).to be(true)
expect(described_class.install("foo")).to be(true) expect(described_class.install!("foo")).to be(true)
end end
it "installs extension when euid != uid and Process::UID.re_exchangeable? returns true" do it "installs extension when euid != uid and Process::UID.re_exchangeable? returns true" do
@ -59,8 +59,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true)
expect(described_class.preinstall("foo")).to be(true) expect(described_class.preinstall!("foo")).to be(true)
expect(described_class.install("foo")).to be(true) expect(described_class.install!("foo")).to be(true)
end end
it "installs extension when euid != uid and Process::UID.re_exchangeable? returns false" do it "installs extension when euid != uid and Process::UID.re_exchangeable? returns false" do
@ -70,8 +70,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do
expect(Homebrew::Bundle).to \ expect(Homebrew::Bundle).to \
receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true)
expect(described_class.preinstall("foo")).to be(true) expect(described_class.preinstall!("foo")).to be(true)
expect(described_class.install("foo")).to be(true) expect(described_class.install!("foo")).to be(true)
end end
end end
end end

View File

@ -42,7 +42,7 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do
expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "--formula", "whalebrew", expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "--formula", "whalebrew",
verbose: false) verbose: false)
.and_return(true) .and_return(true)
expect { described_class.preinstall("whalebrew/wget") }.to raise_error(RuntimeError) expect { described_class.preinstall!("whalebrew/wget") }.to raise_error(RuntimeError)
end end
end end
@ -61,7 +61,7 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do
end end
it "skips" do it "skips" do
expect(described_class.preinstall("whalebrew/wget")).to be(false) expect(described_class.preinstall!("whalebrew/wget")).to be(false)
end end
end end
end end

View File

@ -59,7 +59,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(renamed_app_new_path).not_to be_a_directory expect(renamed_app_new_path).not_to be_a_directory
expect(renamed_app.installed_version).to eq "1.0.0" expect(renamed_app.installed_version).to eq "1.0.0"
described_class.upgrade_casks(dry_run: true, args:) described_class.upgrade_casks!(dry_run: true, args:)
expect(local_caffeine).to be_installed expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory expect(local_caffeine_path).to be_a_directory
@ -86,7 +86,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(local_transmission_path).to be_a_directory expect(local_transmission_path).to be_a_directory
expect(local_transmission.installed_version).to eq "2.60" expect(local_transmission.installed_version).to eq "2.60"
described_class.upgrade_casks(local_caffeine, dry_run: true, args:) described_class.upgrade_casks!(local_caffeine, dry_run: true, args:)
expect(local_caffeine).to be_installed expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory expect(local_caffeine_path).to be_a_directory
@ -113,7 +113,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(renamed_app_new_path).not_to be_a_directory expect(renamed_app_new_path).not_to be_a_directory
expect(renamed_app.installed_version).to eq "1.0.0" expect(renamed_app.installed_version).to eq "1.0.0"
described_class.upgrade_casks(local_caffeine, auto_updates, dry_run: true, args:) described_class.upgrade_casks!(local_caffeine, auto_updates, dry_run: true, args:)
expect(local_caffeine).to be_installed expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory expect(local_caffeine_path).to be_a_directory
@ -156,7 +156,7 @@ RSpec.describe Cask::Upgrade, :cask do
version_latest.download_sha_path.write("fake download sha") version_latest.download_sha_path.write("fake download sha")
expect(version_latest.outdated_download_sha?).to be(true) expect(version_latest.outdated_download_sha?).to be(true)
described_class.upgrade_casks(greedy: true, dry_run: true, args:) described_class.upgrade_casks!(greedy: true, dry_run: true, args:)
expect(local_caffeine).to be_installed expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory expect(local_caffeine_path).to be_a_directory
@ -186,7 +186,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(auto_updates_path).to be_a_directory expect(auto_updates_path).to be_a_directory
expect(auto_updates.installed_version).to eq "2.57" expect(auto_updates.installed_version).to eq "2.57"
described_class.upgrade_casks(auto_updates, dry_run: true, greedy: true, args:) described_class.upgrade_casks!(auto_updates, dry_run: true, greedy: true, args:)
expect(auto_updates).to be_installed expect(auto_updates).to be_installed
expect(auto_updates_path).to be_a_directory expect(auto_updates_path).to be_a_directory
@ -203,7 +203,7 @@ RSpec.describe Cask::Upgrade, :cask do
version_latest.download_sha_path.write("fake download sha") version_latest.download_sha_path.write("fake download sha")
expect(version_latest.outdated_download_sha?).to be(true) expect(version_latest.outdated_download_sha?).to be(true)
described_class.upgrade_casks(version_latest, dry_run: true, greedy: true, args:) described_class.upgrade_casks!(version_latest, dry_run: true, greedy: true, args:)
expect(version_latest).to be_installed expect(version_latest).to be_installed
expect(version_latest_paths).to all be_a_directory expect(version_latest_paths).to all be_a_directory
@ -234,7 +234,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(will_fail_if_upgraded.installed_version).to eq "1.2.2" expect(will_fail_if_upgraded.installed_version).to eq "1.2.2"
expect do expect do
described_class.upgrade_casks(will_fail_if_upgraded, args:) described_class.upgrade_casks!(will_fail_if_upgraded, args:)
end.to raise_error(Cask::CaskError).and output(output_reverted).to_stderr end.to raise_error(Cask::CaskError).and output(output_reverted).to_stderr
expect(will_fail_if_upgraded).to be_installed expect(will_fail_if_upgraded).to be_installed
@ -252,7 +252,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(bad_checksum.installed_version).to eq "1.2.2" expect(bad_checksum.installed_version).to eq "1.2.2"
expect do expect do
described_class.upgrade_casks(bad_checksum, args:) described_class.upgrade_casks!(bad_checksum, args:)
end.to raise_error(ChecksumMismatchError).and(not_to_output(output_reverted).to_stderr) end.to raise_error(ChecksumMismatchError).and(not_to_output(output_reverted).to_stderr)
expect(bad_checksum).to be_installed expect(bad_checksum).to be_installed
@ -291,7 +291,7 @@ RSpec.describe Cask::Upgrade, :cask do
expect(bad_checksum_2.installed_version).to eq "1.2.2" expect(bad_checksum_2.installed_version).to eq "1.2.2"
expect do expect do
described_class.upgrade_casks(args:) described_class.upgrade_casks!(args:)
end.to raise_error(Cask::MultipleCaskErrors) end.to raise_error(Cask::MultipleCaskErrors)
expect(bad_checksum).to be_installed expect(bad_checksum).to be_installed

View File

@ -5,9 +5,12 @@ require "extend/blank"
RSpec.describe Object do RSpec.describe Object do
let(:empty_true) do let(:empty_true) do
Class.new(described_class) do Class.new(described_class) do
# This API is intentionally non-ideal for testing.
# rubocop:disable Naming/PredicateMethod
def empty? def empty?
0 0
end end
# rubocop:enable Naming/PredicateMethod
end end
end end
let(:empty_false) do let(:empty_false) do

View File

@ -32,11 +32,11 @@ RSpec.describe Keg::Relocation do
expect(relocation.replacement_pair_for(:library_placeholder)).to eq [library_placeholder, library] expect(relocation.replacement_pair_for(:library_placeholder)).to eq [library_placeholder, library]
end end
specify "#replace_text" do specify "#replace_text!" do
relocation = setup_relocation relocation = setup_relocation
text = +"foo" text = +"foo"
relocation.replace_text(text) relocation.replace_text!(text)
expect(text).to eq "foo" expect(text).to eq "foo"
text = <<~TEXT text = <<~TEXT
@ -47,7 +47,7 @@ RSpec.describe Keg::Relocation do
#{repository_placeholder}/foo #{repository_placeholder}/foo
foo#{library_placeholder}/bar foo#{library_placeholder}/bar
TEXT TEXT
relocation.replace_text(text) relocation.replace_text!(text)
expect(text).to eq <<~REPLACED expect(text).to eq <<~REPLACED
#{prefix_placeholder}/foo #{prefix_placeholder}/foo
#{cellar_placeholder}/foo #{cellar_placeholder}/foo

View File

@ -42,16 +42,16 @@ RSpec.describe Homebrew::Services::Cli do
end end
end end
describe "#check" do describe "#check!" do
it "checks the input does not exist" do it "checks the input does not exist" do
expect do expect do
services_cli.check([]) services_cli.check!([])
end.to raise_error(UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all") end.to raise_error(UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all")
end end
it "checks the input exists" do it "checks the input exists" do
expect do expect do
services_cli.check("hello") services_cli.check!("hello")
end.not_to raise_error(UsageError, end.not_to raise_error(UsageError,
"Invalid usage: Formula(e) missing, please provide a formula name or use --all") "Invalid usage: Formula(e) missing, please provide a formula name or use --all")
end end

View File

@ -1,62 +0,0 @@
# frozen_string_literal: true
require "tapioca/dsl"
require "sorbet/tapioca/compilers/args"
RSpec.describe Tapioca::Compilers::Args do
let(:compiler) { described_class.new(Tapioca::Dsl::Pipeline.new(requested_constants: []), RBI::Tree.new, Homebrew) }
let(:list_parser) do
require "cmd/list"
Homebrew::Cmd::List.parser
end
# Good testing candidate because it has multiple for each of `switch`, `flag` and `comma_array` args:
let(:update_python_resources_parser) do
require "dev-cmd/update-python-resources"
Homebrew::DevCmd::UpdatePythonResources.parser
end
describe "#args_table" do
it "returns a mapping of list args to default values" do
expect(compiler.args_table(list_parser)).to contain_exactly(
:"1?", :built_from_source?, :cask?, :casks?, :d?, :debug?, :formula?, :formulae?, :full_name?, :h?, :help?,
:installed_as_dependency?, :installed_on_request?, :l?, :multiple?, :pinned?, :poured_from_bottle?, :q?,
:quiet?, :r?, :t?, :v?, :verbose?, :versions?
)
end
it "returns a mapping of update-python-resources args to default values" do
expect(compiler.args_table(update_python_resources_parser)).to contain_exactly(
:d?, :debug?, :exclude_packages, :extra_packages, :h?, :help?, :ignore_errors?, :ignore_non_pypi_packages?,
:install_dependencies?, :p?, :package_name, :print_only?, :q?, :quiet?, :s?, :silent?, :v?, :verbose?,
:version
)
end
end
describe "#comma_arrays" do
it "returns an empty list when there are no comma_array args" do
expect(compiler.comma_arrays(list_parser)).to eq([])
end
it "returns the comma_array args when they exist" do
expect(compiler.comma_arrays(update_python_resources_parser)).to eq([:extra_packages, :exclude_packages])
end
end
describe "#get_return_type" do
let(:comma_arrays) { compiler.comma_arrays(update_python_resources_parser) }
it "returns the correct type for switches" do
expect(compiler.get_return_type(:silent?, comma_arrays)).to eq("T::Boolean")
end
it "returns the correct type for flags" do
expect(compiler.get_return_type(:package_name, comma_arrays)).to eq("T.nilable(String)")
end
it "returns the correct type for comma_arrays" do
expect(compiler.get_return_type(:extra_packages, comma_arrays)).to eq("T.nilable(T::Array[String])")
end
end
end

View File

@ -48,7 +48,7 @@ module Homebrew
if rack.directory? if rack.directory?
versions = rack.subdirs.map(&:basename) versions = rack.subdirs.map(&:basename)
puts <<~EOS puts <<~EOS
#{keg.name} #{versions.to_sentence} #{(versions.count == 1) ? "is" : "are"} still installed. #{keg.name} #{versions.to_sentence} #{versions.one? ? "is" : "are"} still installed.
To remove all versions, run: To remove all versions, run:
brew uninstall --force #{keg.name} brew uninstall --force #{keg.name}
EOS EOS
@ -108,13 +108,13 @@ module Homebrew
return if ignore_dependencies return if ignore_dependencies
all_kegs = kegs_by_rack.values.flatten(1) all_kegs = kegs_by_rack.values.flatten(1)
check_for_dependents(all_kegs, casks:, named_args:) check_for_dependents!(all_kegs, casks:, named_args:)
rescue MethodDeprecatedError rescue MethodDeprecatedError
# Silently ignore deprecations when uninstalling. # Silently ignore deprecations when uninstalling.
nil nil
end end
def self.check_for_dependents(kegs, casks: [], named_args: []) def self.check_for_dependents!(kegs, casks: [], named_args: [])
return false unless (result = InstalledDependents.find_some_installed_dependents(kegs, casks:)) return false unless (result = InstalledDependents.find_some_installed_dependents(kegs, casks:))
DependentsMessage.new(*result, named_args:).output DependentsMessage.new(*result, named_args:).output
@ -133,7 +133,7 @@ module Homebrew
def output def output
ofail <<~EOS ofail <<~EOS
Refusing to uninstall #{reqs.to_sentence} Refusing to uninstall #{reqs.to_sentence}
because #{(reqs.count == 1) ? "it" : "they"} #{are_required_by_deps}. because #{reqs.one? ? "it" : "they"} #{are_required_by_deps}.
You can override this and force removal with: You can override this and force removal with:
#{sample_command} #{sample_command}
EOS EOS
@ -146,8 +146,8 @@ module Homebrew
end end
def are_required_by_deps def are_required_by_deps
"#{(reqs.count == 1) ? "is" : "are"} required by #{deps.to_sentence}, " \ "#{reqs.one? ? "is" : "are"} required by #{deps.to_sentence}, " \
"which #{(deps.count == 1) ? "is" : "are"} currently installed" "which #{deps.one? ? "is" : "are"} currently installed"
end end
end end

View File

@ -72,17 +72,17 @@ module Homebrew
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def single_app_cask? def single_app_cask?
apps.count == 1 apps.one?
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def single_qlplugin_cask? def single_qlplugin_cask?
qlplugins.count == 1 qlplugins.one?
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def single_pkg_cask? def single_pkg_cask?
pkgs.count == 1 pkgs.one?
end end
# Filter paths to `Info.plist` files so that ones belonging # Filter paths to `Info.plist` files so that ones belonging
@ -222,14 +222,14 @@ module Homebrew
unique_info_plist_versions = unique_info_plist_versions =
top_level_info_plist_paths.filter_map { |i| BundleVersion.from_info_plist(i)&.nice_version } top_level_info_plist_paths.filter_map { |i| BundleVersion.from_info_plist(i)&.nice_version }
.uniq .uniq
return unique_info_plist_versions.first if unique_info_plist_versions.count == 1 return unique_info_plist_versions.first if unique_info_plist_versions.one?
package_info_path = extract_dir/"PackageInfo" package_info_path = extract_dir/"PackageInfo"
if package_info_path.exist? if package_info_path.exist?
if (version = BundleVersion.from_package_info(package_info_path)) if (version = BundleVersion.from_package_info(package_info_path))
return version.nice_version return version.nice_version
end end
elsif packages.count == 1 elsif packages.one?
onoe "#{pkg_path.basename} does not contain a `PackageInfo` file." onoe "#{pkg_path.basename} does not contain a `PackageInfo` file."
end end

View File

@ -6,6 +6,8 @@ require "context"
module Homebrew module Homebrew
extend Context extend Context
# Need to keep this naming as-is for backwards compatibility.
# rubocop:disable Naming/PredicateMethod
def self._system(cmd, *args, **options) def self._system(cmd, *args, **options)
pid = fork do pid = fork do
yield if block_given? yield if block_given?
@ -20,6 +22,7 @@ module Homebrew
Process.wait(T.must(pid)) Process.wait(T.must(pid))
$CHILD_STATUS.success? $CHILD_STATUS.success?
end end
# rubocop:enable Naming/PredicateMethod
def self.system(cmd, *args, **options) def self.system(cmd, *args, **options)
if verbose? if verbose?

View File

@ -445,7 +445,7 @@ module Utils
format "%#{index_width}s", index_header format "%#{index_width}s", index_header
formatted_name_with_options_header = formatted_name_with_options_header =
format "%-#{name_with_options_width}s", format "%-#{name_with_options_width}s",
name_with_options_header[0..name_with_options_width-1] name_with_options_header[0..(name_with_options_width-1)]
formatted_count_header = formatted_count_header =
format "%#{count_width}s", count_header format "%#{count_width}s", count_header
formatted_percent_header = formatted_percent_header =
@ -464,7 +464,7 @@ module Utils
formatted_index = format "%-#{index_width}s", formatted_index formatted_index = format "%-#{index_width}s", formatted_index
formatted_name_with_options = formatted_name_with_options =
format "%-#{name_with_options_width}s", format "%-#{name_with_options_width}s",
name_with_options[0..name_with_options_width-1] name_with_options[0..(name_with_options_width-1)]
formatted_count = format "%#{count_width}s", format_count(count) formatted_count = format "%#{count_width}s", format_count(count)
formatted_percent = if total_count.zero? formatted_percent = if total_count.zero?
format "%#{percent_width}s", format_percent(0) format "%#{percent_width}s", format_percent(0)

View File

@ -45,7 +45,7 @@ module GitHub
line: T.nilable(Integer) line: T.nilable(Integer)
).returns(T::Boolean) ).returns(T::Boolean)
} }
def self.puts_annotation_if_env_set(type, message, file: nil, line: nil) def self.puts_annotation_if_env_set!(type, message, file: nil, line: nil)
# Don't print annotations during tests, too messy to handle these. # Don't print annotations during tests, too messy to handle these.
return false if ENV.fetch("HOMEBREW_TESTS", false) return false if ENV.fetch("HOMEBREW_TESTS", false)
return false unless env_set? return false unless env_set?

View File

@ -37,21 +37,21 @@ end
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-6.0.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-6.0.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.7/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ast-2.4.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ast-2.4.3/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}/gems/base64-0.3.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.1.9") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.2.2")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.1.9/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.2.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.5.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.5.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/csv-3.3.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/csv-3.3.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/docile-1.4.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/docile-1.4.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.3.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.3.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erubi-1.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erubi-1.13.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.12.0") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.12.2")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.12.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.12.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.10.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.10.0/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/simpleidn-0.2.3/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.4.0/lib")
@ -64,7 +64,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.25.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.25.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/netrc-0.11.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/netrc-0.11.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.27.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.27.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-5.2.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-5.3.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/racc-1.8.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/racc-1.8.1")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.8.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.8.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.3.8.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.3.8.0/lib")
@ -76,48 +76,49 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/pycall-1.5.2") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/pycall-1.5.2")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pycall-1.5.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pycall-1.5.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-3.9.4") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-4.0.0.dev.4")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-3.9.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-4.0.0.dev.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.12117/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.3.6/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.3.3/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/redcarpet-3.6.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/redcarpet-3.6.1")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/redcarpet-3.6.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/redcarpet-3.6.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.13.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/require-hooks-0.2.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.13.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.13.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.13.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.13.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-mocks-3.13.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.13.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-3.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-mocks-3.13.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-3.13.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-github-3.0.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-github-3.0.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-retry-0.6.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-retry-0.6.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.12222/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-sorbet-1.9.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-sorbet-1.9.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec_junit_formatter-0.6.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec_junit_formatter-0.6.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.44.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.45.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-emoji-4.0.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-emoji-4.0.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-3.1.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-3.1.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.75.6/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.77.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-md-2.0.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-md-2.0.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.25.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.25.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-3.6.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-3.6.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.10.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.10.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-lsp-0.23.21/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-lsp-0.24.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-4.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-4.1.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/ruby-prof-1.7.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/ruby-prof-1.7.2")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-prof-1.7.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-prof-1.7.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-html-0.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-html-0.13.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov_json_formatter-0.1.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov_json_formatter-0.1.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-0.22.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-0.22.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-cobertura-2.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-cobertura-2.1.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.12117-universal-darwin/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.12222-universal-darwin/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.12117/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.12222/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.12117/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.12222/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.3.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.3.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.6.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.7.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/stackprof-0.2.27") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/stackprof-0.2.27")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/stackprof-0.2.27/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/stackprof-0.2.27/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-0.9.37/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-0.9.37/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-sorbet-0.9.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-sorbet-0.9.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tapioca-0.16.11/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tapioca-0.17.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/vernier-1.7.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/vernier-1.8.0")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/vernier-1.7.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/vernier-1.8.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/warning-1.5.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/warning-1.5.0/lib")

View File

@ -1,22 +0,0 @@
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

View File

@ -2,7 +2,7 @@
# #
# \Module \Base64 provides methods for: # \Module \Base64 provides methods for:
# #
# - Encoding a binary string (containing non-ASCII characters) # - \Encoding a binary string (containing non-ASCII characters)
# as a string of printable ASCII characters. # as a string of printable ASCII characters.
# - Decoding such an encoded string. # - Decoding such an encoded string.
# #
@ -27,7 +27,7 @@
# #
# require 'base64' # require 'base64'
# #
# == Encoding Character Sets # == \Encoding Character Sets
# #
# A \Base64-encoded string consists only of characters from a 64-character set: # A \Base64-encoded string consists only of characters from a 64-character set:
# #
@ -140,7 +140,7 @@
# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567"
# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError
# #
# \Method Base64.urlsafe_decode64 allows padding in +str+, # \Method Base64.urlsafe_decode64 allows padding in the encoded string,
# which if present, must be correct: # which if present, must be correct:
# see {Padding}[Base64.html#module-Base64-label-Padding], above: # see {Padding}[Base64.html#module-Base64-label-Padding], above:
# #
@ -183,11 +183,14 @@
# #
module Base64 module Base64
VERSION = "0.2.0" VERSION = "0.3.0"
module_function module_function
# Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. # :call-seq:
# Base64.encode64(string) -> encoded_string
#
# Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+.
# #
# Per RFC 2045, the returned string may contain the URL-unsafe characters # Per RFC 2045, the returned string may contain the URL-unsafe characters
# <tt>+</tt> or <tt>/</tt>; # <tt>+</tt> or <tt>/</tt>;
@ -220,19 +223,22 @@ module Base64
[bin].pack("m") [bin].pack("m")
end end
# :call-seq:
# Base64.decode(encoded_string) -> decoded_string
#
# Returns a string containing the decoding of an RFC-2045-compliant # Returns a string containing the decoding of an RFC-2045-compliant
# \Base64-encoded string +str+: # \Base64-encoded string +encoded_string+:
# #
# s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
# Base64.decode64(s) # => "This is line 1\nThis is line 2\n" # Base64.decode64(s) # => "This is line 1\nThis is line 2\n"
# #
# Non-\Base64 characters in +str+ are ignored; # Non-\Base64 characters in +encoded_string+ are ignored;
# see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
# these include newline characters and characters <tt>-</tt> and <tt>/</tt>: # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
# #
# Base64.decode64("\x00\n-_") # => "" # Base64.decode64("\x00\n-_") # => ""
# #
# Padding in +str+ (even if incorrect) is ignored: # Padding in +encoded_string+ (even if incorrect) is ignored:
# #
# Base64.decode64("MDEyMzQ1Njc") # => "01234567" # Base64.decode64("MDEyMzQ1Njc") # => "01234567"
# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" # Base64.decode64("MDEyMzQ1Njc=") # => "01234567"
@ -242,7 +248,10 @@ module Base64
str.unpack1("m") str.unpack1("m")
end end
# Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. # :call-seq:
# Base64.strict_encode64(string) -> encoded_string
#
# Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+.
# #
# Per RFC 2045, the returned string may contain the URL-unsafe characters # Per RFC 2045, the returned string may contain the URL-unsafe characters
# <tt>+</tt> or <tt>/</tt>; # <tt>+</tt> or <tt>/</tt>;
@ -274,13 +283,16 @@ module Base64
[bin].pack("m0") [bin].pack("m0")
end end
# :call-seq:
# Base64.strict_decode64(encoded_string) -> decoded_string
#
# Returns a string containing the decoding of an RFC-2045-compliant # Returns a string containing the decoding of an RFC-2045-compliant
# \Base64-encoded string +str+: # \Base64-encoded string +encoded_string+:
# #
# s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK"
# Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n"
# #
# Non-\Base64 characters in +str+ not allowed; # Non-\Base64 characters in +encoded_string+ are not allowed;
# see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
# these include newline characters and characters <tt>-</tt> and <tt>/</tt>: # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
# #
@ -288,7 +300,7 @@ module Base64
# Base64.strict_decode64('-') # Raises ArgumentError # Base64.strict_decode64('-') # Raises ArgumentError
# Base64.strict_decode64('_') # Raises ArgumentError # Base64.strict_decode64('_') # Raises ArgumentError
# #
# Padding in +str+, if present, must be correct: # Padding in +encoded_string+, if present, must be correct:
# #
# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError
# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567"
@ -298,7 +310,10 @@ module Base64
str.unpack1("m0") str.unpack1("m0")
end end
# Returns the RFC-4648-compliant \Base64-encoding of +bin+. # :call-seq:
# Base64.urlsafe_encode64(string) -> encoded_string
#
# Returns the RFC-4648-compliant \Base64-encoding of +string+.
# #
# Per RFC 4648, the returned string will not contain the URL-unsafe characters # Per RFC 4648, the returned string will not contain the URL-unsafe characters
# <tt>+</tt> or <tt>/</tt>, # <tt>+</tt> or <tt>/</tt>,
@ -332,16 +347,19 @@ module Base64
str str
end end
# Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: # :call-seq:
# Base64.urlsafe_decode64(encoded_string) -> decoded_string
# #
# +str+ may not contain non-Base64 characters; # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+:
#
# +encoded_string+ may not contain non-Base64 characters;
# see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # 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('/') # Raises ArgumentError. # Base64.urlsafe_decode64('/') # Raises ArgumentError.
# Base64.urlsafe_decode64("\n") # Raises ArgumentError. # Base64.urlsafe_decode64("\n") # Raises ArgumentError.
# #
# Padding in +str+, if present, must be correct: # Padding in +encoded_string+, if present, must be correct:
# see {Padding}[Base64.html#module-Base64-label-Padding], above: # see {Padding}[Base64.html#module-Base64-label-Padding], above:
# #
# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567"

View File

@ -27,7 +27,7 @@ module T
def self.any(type_a, type_b, *types) def self.any(type_a, type_b, *types)
type_a = T::Utils.coerce(type_a) type_a = T::Utils.coerce(type_a)
type_b = T::Utils.coerce(type_b) type_b = T::Utils.coerce(type_b)
types = types.map {|t| T::Utils.coerce(t)} if !types.empty? types = types.map { |t| T::Utils.coerce(t) } if !types.empty?
T::Types::Union::Private::Pool.union_of_types(type_a, type_b, types) T::Types::Union::Private::Pool.union_of_types(type_a, type_b, types)
end end

View File

@ -4,5 +4,5 @@
module T module T
# T::Boolean is a type alias helper for the common `T.any(TrueClass, FalseClass)`. # T::Boolean is a type alias helper for the common `T.any(TrueClass, FalseClass)`.
# Defined separately from _types.rb because it has a dependency on T::Types::Union. # Defined separately from _types.rb because it has a dependency on T::Types::Union.
Boolean = T.type_alias {T.any(TrueClass, FalseClass)} Boolean = T.type_alias { T.any(TrueClass, FalseClass) }
end end

View File

@ -419,12 +419,12 @@ module T::Configuration
if values.nil? if values.nil?
@scalar_types = values @scalar_types = values
else else
bad_values = values.reject {|v| v.class == String} bad_values = values.reject { |v| v.class == String }
unless bad_values.empty? unless bad_values.empty?
raise ArgumentError.new("Provided values must all be class name strings.") raise ArgumentError.new("Provided values must all be class name strings.")
end end
@scalar_types = values.each_with_object({}) {|x, acc| acc[x] = true}.freeze @scalar_types = values.each_with_object({}) { |x, acc| acc[x] = true }.freeze
end end
end end
@ -449,9 +449,9 @@ module T::Configuration
private_constant :MODULE_NAME private_constant :MODULE_NAME
@default_module_name_mangler = if T::Configuration::AT_LEAST_RUBY_2_7 @default_module_name_mangler = if T::Configuration::AT_LEAST_RUBY_2_7
->(type) {MODULE_NAME.bind_call(type)} ->(type) { MODULE_NAME.bind_call(type) }
else else
->(type) {MODULE_NAME.bind(type).call} # rubocop:disable Performance/BindCall ->(type) { MODULE_NAME.bind(type).call } # rubocop:disable Performance/BindCall
end end
@module_name_mangler = nil @module_name_mangler = nil

View File

@ -44,11 +44,11 @@ class T::Enum
extend T::Props::CustomType extend T::Props::CustomType
# TODO(jez) Might want to restrict this, or make subclasses provide this type # TODO(jez) Might want to restrict this, or make subclasses provide this type
SerializedVal = T.type_alias {T.untyped} SerializedVal = T.type_alias { T.untyped }
private_constant :SerializedVal private_constant :SerializedVal
### Enum class methods ### ### Enum class methods ###
sig {returns(T::Array[T.attached_class])} sig { returns(T::Array[T.attached_class]) }
def self.values def self.values
if @values.nil? if @values.nil?
raise "Attempting to access values of #{self.class} before it has been initialized." \ raise "Attempting to access values of #{self.class} before it has been initialized." \
@ -59,7 +59,7 @@ class T::Enum
# This exists for compatibility with the interface of `Hash` & mostly to support # This exists for compatibility with the interface of `Hash` & mostly to support
# the HashEachMethods Rubocop. # the HashEachMethods Rubocop.
sig {params(blk: T.nilable(T.proc.params(arg0: T.attached_class).void)).returns(T.any(T::Enumerator[T.attached_class], T::Array[T.attached_class]))} sig { params(blk: T.nilable(T.proc.params(arg0: T.attached_class).void)).returns(T.any(T::Enumerator[T.attached_class], T::Array[T.attached_class])) }
def self.each_value(&blk) def self.each_value(&blk)
if blk if blk
values.each(&blk) values.each(&blk)
@ -72,7 +72,7 @@ class T::Enum
# #
# Note: It would have been nice to make this method final before people started overriding it. # Note: It would have been nice to make this method final before people started overriding it.
# Note: Failed CriticalMethodsNoRuntimeTypingTest # Note: Failed CriticalMethodsNoRuntimeTypingTest
sig {params(serialized_val: SerializedVal).returns(T.nilable(T.attached_class)).checked(:never)} sig { params(serialized_val: SerializedVal).returns(T.nilable(T.attached_class)).checked(:never) }
def self.try_deserialize(serialized_val) def self.try_deserialize(serialized_val)
if @mapping.nil? if @mapping.nil?
raise "Attempting to access serialization map of #{self.class} before it has been initialized." \ raise "Attempting to access serialization map of #{self.class} before it has been initialized." \
@ -88,7 +88,7 @@ class T::Enum
# #
# @return [self] # @return [self]
# @raise [KeyError] if serialized value does not match any instance. # @raise [KeyError] if serialized value does not match any instance.
sig {overridable.params(serialized_val: SerializedVal).returns(T.attached_class).checked(:never)} sig { overridable.params(serialized_val: SerializedVal).returns(T.attached_class).checked(:never) }
def self.from_serialized(serialized_val) def self.from_serialized(serialized_val)
res = try_deserialize(serialized_val) res = try_deserialize(serialized_val)
if res.nil? if res.nil?
@ -99,7 +99,7 @@ class T::Enum
# Note: It would have been nice to make this method final before people started overriding it. # Note: It would have been nice to make this method final before people started overriding it.
# @return [Boolean] Does the given serialized value correspond with any of this enum's values. # @return [Boolean] Does the given serialized value correspond with any of this enum's values.
sig {overridable.params(serialized_val: SerializedVal).returns(T::Boolean).checked(:never)} sig { overridable.params(serialized_val: SerializedVal).returns(T::Boolean).checked(:never) }
def self.has_serialized?(serialized_val) def self.has_serialized?(serialized_val)
if @mapping.nil? if @mapping.nil?
raise "Attempting to access serialization map of #{self.class} before it has been initialized." \ raise "Attempting to access serialization map of #{self.class} before it has been initialized." \
@ -109,7 +109,7 @@ class T::Enum
end end
# Note: Failed CriticalMethodsNoRuntimeTypingTest # Note: Failed CriticalMethodsNoRuntimeTypingTest
sig {override.params(instance: T.nilable(T::Enum)).returns(SerializedVal).checked(:never)} sig { override.params(instance: T.nilable(T::Enum)).returns(SerializedVal).checked(:never) }
def self.serialize(instance) def self.serialize(instance)
# This is needed otherwise if a Chalk::ODM::Document with a property of the shape # This is needed otherwise if a Chalk::ODM::Document with a property of the shape
# T::Hash[T.nilable(MyEnum), Integer] and a value that looks like {nil => 0} is # T::Hash[T.nilable(MyEnum), Integer] and a value that looks like {nil => 0} is
@ -126,7 +126,7 @@ class T::Enum
end end
# Note: Failed CriticalMethodsNoRuntimeTypingTest # Note: Failed CriticalMethodsNoRuntimeTypingTest
sig {override.params(mongo_value: SerializedVal).returns(T.attached_class).checked(:never)} sig { override.params(mongo_value: SerializedVal).returns(T.attached_class).checked(:never) }
def self.deserialize(mongo_value) def self.deserialize(mongo_value)
if self == T::Enum if self == T::Enum
raise "Cannot call T::Enum.deserialize directly. You must call on a specific child class." raise "Cannot call T::Enum.deserialize directly. You must call on a specific child class."
@ -136,46 +136,46 @@ class T::Enum
### Enum instance methods ### ### Enum instance methods ###
sig {returns(T.self_type)} sig { returns(T.self_type) }
def dup def dup
self self
end end
sig {returns(T.self_type).checked(:tests)} sig { returns(T.self_type).checked(:tests) }
def clone def clone
self self
end end
# Note: Failed CriticalMethodsNoRuntimeTypingTest # Note: Failed CriticalMethodsNoRuntimeTypingTest
sig {returns(SerializedVal).checked(:never)} sig { returns(SerializedVal).checked(:never) }
def serialize def serialize
assert_bound! assert_bound!
@serialized_val @serialized_val
end end
sig {params(args: T.untyped).returns(T.untyped)} sig { params(args: T.untyped).returns(T.untyped) }
def to_json(*args) def to_json(*args)
serialize.to_json(*args) serialize.to_json(*args)
end end
sig {params(args: T.untyped).returns(T.untyped)} sig { params(args: T.untyped).returns(T.untyped) }
def as_json(*args) def as_json(*args)
serialized_val = serialize serialized_val = serialize
return serialized_val unless serialized_val.respond_to?(:as_json) return serialized_val unless serialized_val.respond_to?(:as_json)
serialized_val.as_json(*args) serialized_val.as_json(*args)
end end
sig {returns(String)} sig { returns(String) }
def to_s def to_s
inspect inspect
end end
sig {returns(String)} sig { returns(String) }
def inspect def inspect
"#<#{self.class.name}::#{@const_name || '__UNINITIALIZED__'}>" "#<#{self.class.name}::#{@const_name || '__UNINITIALIZED__'}>"
end end
sig {params(other: BasicObject).returns(T.nilable(Integer))} sig { params(other: BasicObject).returns(T.nilable(Integer)) }
def <=>(other) def <=>(other)
case other case other
when self.class when self.class
@ -192,7 +192,7 @@ class T::Enum
# responds to the `to_str` method. It does not actually call `to_str` however. # responds to the `to_str` method. It does not actually call `to_str` however.
# #
# See https://ruby-doc.org/core-2.4.0/String.html#method-i-3D-3D # See https://ruby-doc.org/core-2.4.0/String.html#method-i-3D-3D
T::Sig::WithoutRuntime.sig {returns(String)} T::Sig::WithoutRuntime.sig { returns(String) }
def to_str def to_str
msg = 'Implicit conversion of Enum instances to strings is not allowed. Call #serialize instead.' msg = 'Implicit conversion of Enum instances to strings is not allowed. Call #serialize instead.'
if T::Configuration.legacy_t_enum_migration_mode? if T::Configuration.legacy_t_enum_migration_mode?
@ -200,7 +200,7 @@ class T::Enum
msg, msg,
storytime: { storytime: {
class: self.class.name, class: self.class.name,
caller_location: Kernel.caller_locations(1..1)&.[](0)&.then {"#{_1.path}:#{_1.lineno}"}, caller_location: Kernel.caller_locations(1..1)&.[](0)&.then { "#{_1.path}:#{_1.lineno}" },
}, },
) )
serialize.to_s serialize.to_s
@ -217,12 +217,12 @@ class T::Enum
if T.unsafe(false) if T.unsafe(false)
# Declare to the type system that the `serialize` method for sure exists # Declare to the type system that the `serialize` method for sure exists
# on whatever we mix this into. # on whatever we mix this into.
T::Sig::WithoutRuntime.sig {abstract.returns(T.untyped)} T::Sig::WithoutRuntime.sig { abstract.returns(T.untyped) }
def serialize; end def serialize; end
end end
# WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth # WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth
T::Sig::WithoutRuntime.sig {params(other: BasicObject).returns(T::Boolean)} T::Sig::WithoutRuntime.sig { params(other: BasicObject).returns(T::Boolean) }
def ==(other) def ==(other)
case other case other
when String when String
@ -238,7 +238,7 @@ class T::Enum
end end
# WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth # WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth
T::Sig::WithoutRuntime.sig {params(other: BasicObject).returns(T::Boolean)} T::Sig::WithoutRuntime.sig { params(other: BasicObject).returns(T::Boolean) }
def ===(other) def ===(other)
case other case other
when String when String
@ -255,7 +255,7 @@ class T::Enum
# WithoutRuntime so that caller_locations can assume a constant stack depth # WithoutRuntime so that caller_locations can assume a constant stack depth
# (Otherwise, the first call would be the method with the wrapping, which would have a different stack depth.) # (Otherwise, the first call would be the method with the wrapping, which would have a different stack depth.)
T::Sig::WithoutRuntime.sig {params(method: Symbol, other: T.untyped).void} T::Sig::WithoutRuntime.sig { params(method: Symbol, other: T.untyped).void }
private def comparison_assertion_failed(method, other) private def comparison_assertion_failed(method, other)
T::Configuration.soft_assert_handler( T::Configuration.soft_assert_handler(
'Enum to string comparison not allowed. Compare to the Enum instance directly instead. See go/enum-migration', 'Enum to string comparison not allowed. Compare to the Enum instance directly instead. See go/enum-migration',
@ -265,7 +265,7 @@ class T::Enum
other: other, other: other,
other_class: other.class.name, other_class: other.class.name,
method: method, method: method,
caller_location: Kernel.caller_locations(2..2)&.[](0)&.then {"#{_1.path}:#{_1.lineno}"}, caller_location: Kernel.caller_locations(2..2)&.[](0)&.then { "#{_1.path}:#{_1.lineno}" },
} }
) )
end end
@ -276,7 +276,7 @@ class T::Enum
UNSET = T.let(Module.new.freeze, Module) UNSET = T.let(Module.new.freeze, Module)
private_constant :UNSET private_constant :UNSET
sig {params(serialized_val: SerializedVal).void} sig { params(serialized_val: SerializedVal).void }
def initialize(serialized_val=UNSET) def initialize(serialized_val=UNSET)
raise 'T::Enum is abstract' if self.class == T::Enum raise 'T::Enum is abstract' if self.class == T::Enum
if !self.class.started_initializing? if !self.class.started_initializing?
@ -292,7 +292,7 @@ class T::Enum
self.class._register_instance(self) self.class._register_instance(self)
end end
sig {returns(NilClass).checked(:never)} sig { returns(NilClass).checked(:never) }
private def assert_bound! private def assert_bound!
if @const_name.nil? if @const_name.nil?
raise "Attempting to access Enum value on #{self.class} before it has been initialized." \ raise "Attempting to access Enum value on #{self.class} before it has been initialized." \
@ -300,14 +300,14 @@ class T::Enum
end end
end end
sig {params(const_name: Symbol).void} sig { params(const_name: Symbol).void }
def _bind_name(const_name) def _bind_name(const_name)
@const_name = const_name @const_name = const_name
@serialized_val = const_to_serialized_val(const_name) if @serialized_val.equal?(UNSET) @serialized_val = const_to_serialized_val(const_name) if @serialized_val.equal?(UNSET)
freeze freeze
end end
sig {params(const_name: Symbol).returns(String)} sig { params(const_name: Symbol).returns(String) }
private def const_to_serialized_val(const_name) private def const_to_serialized_val(const_name)
# Historical note: We convert to lowercase names because the majority of existing calls to # Historical note: We convert to lowercase names because the majority of existing calls to
# `make_accessible` were arrays of lowercase strings. Doing this conversion allowed for the # `make_accessible` were arrays of lowercase strings. Doing this conversion allowed for the
@ -315,7 +315,7 @@ class T::Enum
-const_name.to_s.downcase.freeze -const_name.to_s.downcase.freeze
end end
sig {returns(T::Boolean)} sig { returns(T::Boolean) }
def self.started_initializing? def self.started_initializing?
unless defined?(@started_initializing) unless defined?(@started_initializing)
@started_initializing = T.let(false, T.nilable(T::Boolean)) @started_initializing = T.let(false, T.nilable(T::Boolean))
@ -323,7 +323,7 @@ class T::Enum
T.must(@started_initializing) T.must(@started_initializing)
end end
sig {returns(T::Boolean)} sig { returns(T::Boolean) }
def self.fully_initialized? def self.fully_initialized?
unless defined?(@fully_initialized) unless defined?(@fully_initialized)
@fully_initialized = T.let(false, T.nilable(T::Boolean)) @fully_initialized = T.let(false, T.nilable(T::Boolean))
@ -332,7 +332,7 @@ class T::Enum
end end
# Maintains the order in which values are defined # Maintains the order in which values are defined
sig {params(instance: T.untyped).void} sig { params(instance: T.untyped).void }
def self._register_instance(instance) def self._register_instance(instance)
@values ||= [] @values ||= []
@values << T.cast(instance, T.attached_class) @values << T.cast(instance, T.attached_class)
@ -340,7 +340,7 @@ class T::Enum
# Entrypoint for allowing people to register new enum values. # Entrypoint for allowing people to register new enum values.
# All enum values must be defined within this block. # All enum values must be defined within this block.
sig {params(blk: T.proc.void).void} sig { params(blk: T.proc.void).void }
def self.enums(&blk) def self.enums(&blk)
raise "enums cannot be defined for T::Enum" if self == T::Enum raise "enums cannot be defined for T::Enum" if self == T::Enum
raise "Enum #{self} was already initialized" if fully_initialized? raise "Enum #{self} was already initialized" if fully_initialized?
@ -375,13 +375,13 @@ class T::Enum
orphaned_instances = T.must(@values) - @mapping.values orphaned_instances = T.must(@values) - @mapping.values
if !orphaned_instances.empty? if !orphaned_instances.empty?
raise "Enum values must be assigned to constants: #{orphaned_instances.map {|v| v.instance_variable_get('@serialized_val')}}" raise "Enum values must be assigned to constants: #{orphaned_instances.map { |v| v.instance_variable_get('@serialized_val') }}"
end end
@fully_initialized = true @fully_initialized = true
end end
sig {params(child_class: T::Class[T.anything]).void} sig { params(child_class: T::Class[T.anything]).void }
def self.inherited(child_class) def self.inherited(child_class)
super super
@ -394,12 +394,12 @@ class T::Enum
end end
# Marshal support # Marshal support
sig {params(_level: Integer).returns(String)} sig { params(_level: Integer).returns(String) }
def _dump(_level) def _dump(_level)
Marshal.dump(serialize) Marshal.dump(serialize)
end end
sig {params(args: String).returns(T.attached_class)} sig { params(args: String).returns(T.attached_class) }
def self._load(args) def self._load(args)
deserialize(Marshal.load(args)) # rubocop:disable Security/MarshalLoad deserialize(Marshal.load(args)) # rubocop:disable Security/MarshalLoad
end end

View File

@ -4,7 +4,7 @@
module T::NonForcingConstants module T::NonForcingConstants
# NOTE: This method is documented on the RBI in Sorbet's payload, so that it # NOTE: This method is documented on the RBI in Sorbet's payload, so that it
# shows up in the hover/completion documentation via LSP. # shows up in the hover/completion documentation via LSP.
T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String).returns(T::Boolean)} T::Sig::WithoutRuntime.sig { params(val: BasicObject, klass: String).returns(T::Boolean) }
def self.non_forcing_is_a?(val, klass) def self.non_forcing_is_a?(val, klass)
method_name = "T::NonForcingConstants.non_forcing_is_a?" method_name = "T::NonForcingConstants.non_forcing_is_a?"
if klass.empty? if klass.empty?

Some files were not shown because too many files have changed in this diff Show More