Merge pull request #19371 from Homebrew/no-attr_predicate
refactor: inline use of attr_predicate
This commit is contained in:
commit
de5b6e0f3d
@ -1,21 +0,0 @@
|
|||||||
# typed: strict
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
# This module provides methods to define specialized attributes.
|
|
||||||
# Method stubs are generated by the {Tapioca::Compilers::Attrables} compiler.
|
|
||||||
# @note The compiler is fragile, and must be updated if the filename changes, if methods are added or removed,
|
|
||||||
# or if a method's arity changes.
|
|
||||||
module Attrable
|
|
||||||
extend T::Helpers
|
|
||||||
|
|
||||||
requires_ancestor { Module }
|
|
||||||
|
|
||||||
sig { params(attrs: Symbol).void }
|
|
||||||
def attr_predicate(*attrs)
|
|
||||||
attrs.each do |attr|
|
|
||||||
define_method attr do
|
|
||||||
instance_variable_get("@#{attr.to_s.sub(/\?$/, "")}") == true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "extend/object/deep_dup"
|
require "extend/object/deep_dup"
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "cask/denylist"
|
require "cask/denylist"
|
||||||
require "cask/download"
|
require "cask/download"
|
||||||
require "digest"
|
require "digest"
|
||||||
@ -19,7 +18,6 @@ module Cask
|
|||||||
class Audit
|
class Audit
|
||||||
include SystemCommand::Mixin
|
include SystemCommand::Mixin
|
||||||
include ::Utils::Curl
|
include ::Utils::Curl
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
sig { returns(Cask) }
|
sig { returns(Cask) }
|
||||||
attr_reader :cask
|
attr_reader :cask
|
||||||
@ -27,11 +25,16 @@ module Cask
|
|||||||
sig { returns(T.nilable(Download)) }
|
sig { returns(T.nilable(Download)) }
|
||||||
attr_reader :download
|
attr_reader :download
|
||||||
|
|
||||||
attr_predicate :new_cask?, :strict?, :signing?, :online?, :token_conflicts?
|
sig {
|
||||||
|
params(
|
||||||
|
cask: ::Cask::Cask, download: T::Boolean, quarantine: T::Boolean, token_conflicts: T.nilable(T::Boolean),
|
||||||
|
online: T.nilable(T::Boolean), strict: T.nilable(T::Boolean), signing: T.nilable(T::Boolean),
|
||||||
|
new_cask: T.nilable(T::Boolean), only: T::Array[String], except: T::Array[String]
|
||||||
|
).void
|
||||||
|
}
|
||||||
def initialize(
|
def initialize(
|
||||||
cask,
|
cask,
|
||||||
download: nil, quarantine: nil,
|
download: false, quarantine: false,
|
||||||
token_conflicts: nil, online: nil, strict: nil, signing: nil,
|
token_conflicts: nil, online: nil, strict: nil, signing: nil,
|
||||||
new_cask: nil, only: [], except: []
|
new_cask: nil, only: [], except: []
|
||||||
)
|
)
|
||||||
@ -42,7 +45,7 @@ module Cask
|
|||||||
token_conflicts = new_cask if token_conflicts.nil?
|
token_conflicts = new_cask if token_conflicts.nil?
|
||||||
|
|
||||||
# `online` and `signing` imply `download`
|
# `online` and `signing` imply `download`
|
||||||
download = online || signing if download.nil?
|
download ||= online || signing
|
||||||
|
|
||||||
@cask = cask
|
@cask = cask
|
||||||
@download = Download.new(cask, quarantine:) if download
|
@download = Download.new(cask, quarantine:) if download
|
||||||
@ -51,18 +54,34 @@ module Cask
|
|||||||
@signing = signing
|
@signing = signing
|
||||||
@new_cask = new_cask
|
@new_cask = new_cask
|
||||||
@token_conflicts = token_conflicts
|
@token_conflicts = token_conflicts
|
||||||
@only = only || []
|
@only = only
|
||||||
@except = except || []
|
@except = except
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def new_cask? = !!@new_cask
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def online? =!!@online
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def signing? = !!@signing
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def strict? = !!@strict
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def token_conflicts? = !!@token_conflicts
|
||||||
|
|
||||||
|
sig { returns(::Cask::Audit) }
|
||||||
def run!
|
def run!
|
||||||
only_audits = @only
|
only_audits = @only
|
||||||
except_audits = @except
|
except_audits = @except
|
||||||
|
|
||||||
private_methods.map(&:to_s).grep(/^audit_/).each do |audit_method_name|
|
private_methods.map(&:to_s).grep(/^audit_/).each do |audit_method_name|
|
||||||
name = audit_method_name.delete_prefix("audit_")
|
name = audit_method_name.delete_prefix("audit_")
|
||||||
next if !only_audits.empty? && only_audits&.exclude?(name)
|
next if !only_audits.empty? && only_audits.exclude?(name)
|
||||||
next if except_audits&.include?(name)
|
next if except_audits.include?(name)
|
||||||
|
|
||||||
send(audit_method_name)
|
send(audit_method_name)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask/audit"
|
require "cask/audit"
|
||||||
@ -6,22 +6,50 @@ require "cask/audit"
|
|||||||
module Cask
|
module Cask
|
||||||
# Helper class for auditing all available languages of a cask.
|
# Helper class for auditing all available languages of a cask.
|
||||||
class Auditor
|
class Auditor
|
||||||
def self.audit(cask, **options)
|
# TODO: use argument forwarding (...) when Sorbet supports it in strict mode
|
||||||
new(cask, **options).audit
|
sig {
|
||||||
|
params(
|
||||||
|
cask: ::Cask::Cask, audit_download: T::Boolean, audit_online: T.nilable(T::Boolean),
|
||||||
|
audit_strict: T.nilable(T::Boolean), audit_signing: T.nilable(T::Boolean),
|
||||||
|
audit_token_conflicts: T.nilable(T::Boolean), audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean,
|
||||||
|
any_named_args: T::Boolean, language: T.nilable(String), only: T::Array[String], except: T::Array[String]
|
||||||
|
).returns(T::Set[String])
|
||||||
|
}
|
||||||
|
def self.audit(
|
||||||
|
cask, audit_download: false, audit_online: nil, audit_strict: nil, audit_signing: nil,
|
||||||
|
audit_token_conflicts: nil, audit_new_cask: nil, quarantine: false, any_named_args: false, language: nil,
|
||||||
|
only: [], except: []
|
||||||
|
)
|
||||||
|
new(
|
||||||
|
cask, audit_download:, audit_online:, audit_strict:, audit_signing:, audit_token_conflicts:,
|
||||||
|
audit_new_cask:, quarantine:, any_named_args:, language:, only:, except:
|
||||||
|
).audit
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :cask, :language
|
sig { returns(::Cask::Cask) }
|
||||||
|
attr_reader :cask
|
||||||
|
|
||||||
|
sig { returns(T.nilable(String)) }
|
||||||
|
attr_reader :language
|
||||||
|
|
||||||
|
sig {
|
||||||
|
params(
|
||||||
|
cask: ::Cask::Cask, audit_download: T::Boolean, audit_online: T.nilable(T::Boolean),
|
||||||
|
audit_strict: T.nilable(T::Boolean), audit_signing: T.nilable(T::Boolean),
|
||||||
|
audit_token_conflicts: T.nilable(T::Boolean), audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean,
|
||||||
|
any_named_args: T::Boolean, language: T.nilable(String), only: T::Array[String], except: T::Array[String]
|
||||||
|
).void
|
||||||
|
}
|
||||||
def initialize(
|
def initialize(
|
||||||
cask,
|
cask,
|
||||||
audit_download: nil,
|
audit_download: false,
|
||||||
audit_online: nil,
|
audit_online: nil,
|
||||||
audit_strict: nil,
|
audit_strict: nil,
|
||||||
audit_signing: nil,
|
audit_signing: nil,
|
||||||
audit_token_conflicts: nil,
|
audit_token_conflicts: nil,
|
||||||
audit_new_cask: nil,
|
audit_new_cask: nil,
|
||||||
quarantine: nil,
|
quarantine: false,
|
||||||
any_named_args: nil,
|
any_named_args: false,
|
||||||
language: nil,
|
language: nil,
|
||||||
only: [],
|
only: [],
|
||||||
except: []
|
except: []
|
||||||
@ -42,17 +70,18 @@ module Cask
|
|||||||
|
|
||||||
LANGUAGE_BLOCK_LIMIT = 10
|
LANGUAGE_BLOCK_LIMIT = 10
|
||||||
|
|
||||||
|
sig { returns(T::Set[String]) }
|
||||||
def audit
|
def audit
|
||||||
errors = Set.new
|
errors = Set.new
|
||||||
|
|
||||||
if !language && language_blocks
|
if !language && (blocks = language_blocks)
|
||||||
sample_languages = if language_blocks.length > LANGUAGE_BLOCK_LIMIT && !@audit_new_cask
|
sample_languages = if blocks.length > LANGUAGE_BLOCK_LIMIT && !@audit_new_cask
|
||||||
sample_keys = language_blocks.keys.sample(LANGUAGE_BLOCK_LIMIT)
|
sample_keys = T.must(blocks.keys.sample(LANGUAGE_BLOCK_LIMIT))
|
||||||
ohai "Auditing a sample of available languages for #{cask}: " \
|
ohai "Auditing a sample of available languages for #{cask}: " \
|
||||||
"#{sample_keys.map { |lang| lang[0].to_s }.to_sentence}"
|
"#{sample_keys.map { |lang| lang[0].to_s }.to_sentence}"
|
||||||
language_blocks.select { |k| sample_keys.include?(k) }
|
blocks.select { |k| sample_keys.include?(k) }
|
||||||
else
|
else
|
||||||
language_blocks
|
blocks
|
||||||
end
|
end
|
||||||
|
|
||||||
sample_languages.each_key do |l|
|
sample_languages.each_key do |l|
|
||||||
@ -74,14 +103,16 @@ module Cask
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
sig { params(audit: T.nilable(Audit)).returns(T::Boolean) }
|
||||||
def output_summary?(audit = nil)
|
def output_summary?(audit = nil)
|
||||||
return true if @any_named_args.present?
|
return true if @any_named_args
|
||||||
return true if @audit_strict.present?
|
return true if @audit_strict
|
||||||
return false if audit.blank?
|
return false if audit.nil?
|
||||||
|
|
||||||
audit.errors?
|
audit.errors?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(languages: T::Array[String]).returns(::Cask::Audit) }
|
||||||
def audit_languages(languages)
|
def audit_languages(languages)
|
||||||
original_config = cask.config
|
original_config = cask.config
|
||||||
localized_config = original_config.merge(Config.new(explicit: { languages: }))
|
localized_config = original_config.merge(Config.new(explicit: { languages: }))
|
||||||
@ -92,6 +123,7 @@ module Cask
|
|||||||
cask.config = original_config
|
cask.config = original_config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(cask: ::Cask::Cask).returns(::Cask::Audit) }
|
||||||
def audit_cask_instance(cask)
|
def audit_cask_instance(cask)
|
||||||
audit = Audit.new(
|
audit = Audit.new(
|
||||||
cask,
|
cask,
|
||||||
@ -108,6 +140,7 @@ module Cask
|
|||||||
audit.run!
|
audit.run!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T.nilable(T::Hash[T::Array[String], T.proc.returns(T.untyped)])) }
|
||||||
def language_blocks
|
def language_blocks
|
||||||
cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks)
|
cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "bundle_version"
|
require "bundle_version"
|
||||||
require "cask/cask_loader"
|
require "cask/cask_loader"
|
||||||
require "cask/config"
|
require "cask/config"
|
||||||
@ -15,7 +14,6 @@ module Cask
|
|||||||
# An instance of a cask.
|
# An instance of a cask.
|
||||||
class Cask
|
class Cask
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
extend Attrable
|
|
||||||
extend APIHashable
|
extend APIHashable
|
||||||
include Metadata
|
include Metadata
|
||||||
|
|
||||||
@ -32,8 +30,6 @@ module Cask
|
|||||||
attr_reader :sourcefile_path, :source, :default_config, :loader
|
attr_reader :sourcefile_path, :source, :default_config, :loader
|
||||||
attr_accessor :download, :allow_reassignment
|
attr_accessor :download, :allow_reassignment
|
||||||
|
|
||||||
attr_predicate :loaded_from_api?
|
|
||||||
|
|
||||||
def self.all(eval_all: false)
|
def self.all(eval_all: false)
|
||||||
if !eval_all && !Homebrew::EnvConfig.eval_all?
|
if !eval_all && !Homebrew::EnvConfig.eval_all?
|
||||||
raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL"
|
raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL"
|
||||||
@ -92,6 +88,9 @@ module Cask
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def loaded_from_api? = @loaded_from_api
|
||||||
|
|
||||||
# An old name for the cask.
|
# An old name for the cask.
|
||||||
sig { returns(T::Array[String]) }
|
sig { returns(T::Array[String]) }
|
||||||
def old_tokens
|
def old_tokens
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "locale"
|
require "locale"
|
||||||
require "lazy_object"
|
require "lazy_object"
|
||||||
require "livecheck"
|
require "livecheck"
|
||||||
@ -105,19 +104,36 @@ module Cask
|
|||||||
*ARTIFACT_BLOCK_CLASSES.flat_map { |klass| [klass.dsl_key, klass.uninstall_dsl_key] },
|
*ARTIFACT_BLOCK_CLASSES.flat_map { |klass| [klass.dsl_key, klass.uninstall_dsl_key] },
|
||||||
]).freeze
|
]).freeze
|
||||||
|
|
||||||
extend Attrable
|
|
||||||
include OnSystem::MacOSAndLinux
|
include OnSystem::MacOSAndLinux
|
||||||
|
|
||||||
attr_reader :cask, :token, :deprecation_date, :deprecation_reason, :deprecation_replacement, :disable_date,
|
attr_reader :cask, :token, :deprecation_date, :deprecation_reason, :deprecation_replacement, :disable_date,
|
||||||
:disable_reason, :disable_replacement, :on_system_block_min_os
|
:disable_reason, :disable_replacement, :on_system_block_min_os
|
||||||
|
|
||||||
attr_predicate :deprecated?, :disabled?, :livecheck_defined?, :on_system_blocks_exist?, :depends_on_set_in_block?
|
|
||||||
|
|
||||||
def initialize(cask)
|
def initialize(cask)
|
||||||
@cask = cask
|
@cask = cask
|
||||||
|
@depends_on_set_in_block = T.let(false, T::Boolean)
|
||||||
|
@deprecated = T.let(false, T::Boolean)
|
||||||
|
@disabled = T.let(false, T::Boolean)
|
||||||
|
@livecheck_defined = T.let(false, T::Boolean)
|
||||||
|
@on_system_blocks_exist = T.let(false, T::Boolean)
|
||||||
@token = cask.token
|
@token = cask.token
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def depends_on_set_in_block? = @depends_on_set_in_block
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def deprecated? = @deprecated
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def disabled? = @disabled
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def livecheck_defined? = @livecheck_defined
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def on_system_blocks_exist? = @on_system_blocks_exist
|
||||||
|
|
||||||
# Specifies the cask's name.
|
# Specifies the cask's name.
|
||||||
#
|
#
|
||||||
# NOTE: Multiple names can be specified.
|
# NOTE: Multiple names can be specified.
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
class DSL
|
class DSL
|
||||||
# Class corresponding to the `caveats` stanza.
|
# Class corresponding to the `caveats` stanza.
|
||||||
@ -15,10 +13,6 @@ module Cask
|
|||||||
# to the output by the caller, but that feature is only for the
|
# to the output by the caller, but that feature is only for the
|
||||||
# convenience of cask authors.
|
# convenience of cask authors.
|
||||||
class Caveats < Base
|
class Caveats < Base
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
attr_predicate :discontinued?
|
|
||||||
|
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
super
|
super
|
||||||
@built_in_caveats = {}
|
@built_in_caveats = {}
|
||||||
@ -37,6 +31,9 @@ module Cask
|
|||||||
|
|
||||||
private_class_method :caveat
|
private_class_method :caveat
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def discontinued? = @discontinued
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
(@custom_caveats + @built_in_caveats.values).join("\n")
|
(@custom_caveats + @built_in_caveats.values).join("\n")
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "formula_installer"
|
require "formula_installer"
|
||||||
require "unpack_strategy"
|
require "unpack_strategy"
|
||||||
require "utils/topological_hash"
|
require "utils/topological_hash"
|
||||||
@ -17,8 +16,15 @@ require "cgi"
|
|||||||
module Cask
|
module Cask
|
||||||
# Installer for a {Cask}.
|
# Installer for a {Cask}.
|
||||||
class Installer
|
class Installer
|
||||||
extend Attrable
|
sig {
|
||||||
|
params(
|
||||||
|
cask: ::Cask::Cask, command: T::Class[SystemCommand], force: T::Boolean, adopt: T::Boolean,
|
||||||
|
skip_cask_deps: T::Boolean, binaries: T::Boolean, verbose: T::Boolean, zap: T::Boolean,
|
||||||
|
require_sha: T::Boolean, upgrade: T::Boolean, reinstall: T::Boolean, installed_as_dependency: T::Boolean,
|
||||||
|
installed_on_request: T::Boolean, quarantine: T::Boolean, verify_download_integrity: T::Boolean,
|
||||||
|
quiet: T::Boolean
|
||||||
|
).void
|
||||||
|
}
|
||||||
def initialize(cask, command: SystemCommand, force: false, adopt: false,
|
def initialize(cask, command: SystemCommand, force: false, adopt: false,
|
||||||
skip_cask_deps: false, binaries: true, verbose: false,
|
skip_cask_deps: false, binaries: true, verbose: false,
|
||||||
zap: false, require_sha: false, upgrade: false, reinstall: false,
|
zap: false, require_sha: false, upgrade: false, reinstall: false,
|
||||||
@ -42,9 +48,44 @@ module Cask
|
|||||||
@quiet = quiet
|
@quiet = quiet
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_predicate :binaries?, :force?, :adopt?, :skip_cask_deps?, :require_sha?,
|
sig { returns(T::Boolean) }
|
||||||
:reinstall?, :upgrade?, :verbose?, :zap?, :installed_as_dependency?, :installed_on_request?,
|
def adopt? = @adopt
|
||||||
:quarantine?, :quiet?
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def binaries? = @binaries
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def force? = @force
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def installed_as_dependency? = @installed_as_dependency
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def installed_on_request? = @installed_on_request
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def quarantine? = @quarantine
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def quiet? = @quiet
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def reinstall? = @reinstall
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def require_sha? = @require_sha
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def skip_cask_deps? = @skip_cask_deps
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def upgrade? = @upgrade
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def verbose? = @verbose
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def zap? = @zap
|
||||||
|
|
||||||
def self.caveats(cask)
|
def self.caveats(cask)
|
||||||
odebug "Printing caveats"
|
odebug "Printing caveats"
|
||||||
|
|||||||
@ -1,32 +1,32 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
class Reinstall
|
class Reinstall
|
||||||
|
sig {
|
||||||
|
params(
|
||||||
|
casks: ::Cask::Cask, verbose: T::Boolean, force: T::Boolean, skip_cask_deps: T::Boolean, binaries: T::Boolean,
|
||||||
|
require_sha: T::Boolean, quarantine: T::Boolean, zap: T::Boolean
|
||||||
|
).void
|
||||||
|
}
|
||||||
def self.reinstall_casks(
|
def self.reinstall_casks(
|
||||||
*casks,
|
*casks,
|
||||||
verbose: nil,
|
verbose: false,
|
||||||
force: nil,
|
force: false,
|
||||||
skip_cask_deps: nil,
|
skip_cask_deps: false,
|
||||||
binaries: nil,
|
binaries: false,
|
||||||
require_sha: nil,
|
require_sha: false,
|
||||||
quarantine: nil,
|
quarantine: false,
|
||||||
zap: nil
|
zap: false
|
||||||
)
|
)
|
||||||
require "cask/installer"
|
require "cask/installer"
|
||||||
|
|
||||||
quarantine = true if quarantine.nil?
|
quarantine = true if quarantine.nil?
|
||||||
|
|
||||||
casks.each do |cask|
|
casks.each do |cask|
|
||||||
Installer.new(cask,
|
Installer
|
||||||
binaries:,
|
.new(cask, binaries:, verbose:, force:, skip_cask_deps:, require_sha:, reinstall: true, quarantine:, zap:)
|
||||||
verbose:,
|
.install
|
||||||
force:,
|
|
||||||
skip_cask_deps:,
|
|
||||||
require_sha:,
|
|
||||||
reinstall: true,
|
|
||||||
quarantine:,
|
|
||||||
zap:).install
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,7 +8,7 @@ module Cask
|
|||||||
module Staged
|
module Staged
|
||||||
extend T::Helpers
|
extend T::Helpers
|
||||||
|
|
||||||
requires_ancestor { Kernel }
|
requires_ancestor { ::Cask::DSL::Base }
|
||||||
|
|
||||||
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }
|
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }
|
||||||
sig { params(paths: Paths, permissions_str: String).void }
|
sig { params(paths: Paths, permissions_str: String).void }
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
class Uninstall
|
class Uninstall
|
||||||
def self.uninstall_casks(*casks, binaries: nil, force: false, verbose: false)
|
sig { params(casks: ::Cask::Cask, binaries: T::Boolean, force: T::Boolean, verbose: T::Boolean).void }
|
||||||
|
def self.uninstall_casks(*casks, binaries: false, force: false, verbose: false)
|
||||||
require "cask/installer"
|
require "cask/installer"
|
||||||
|
|
||||||
casks.each do |cask|
|
casks.each do |cask|
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
require "utils/bottles"
|
require "utils/bottles"
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "formula"
|
require "formula"
|
||||||
require "cask/cask_loader"
|
require "cask/cask_loader"
|
||||||
|
|
||||||
@ -209,11 +208,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze
|
PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze
|
||||||
|
|
||||||
attr_predicate :dry_run?, :scrub?, :prune?
|
|
||||||
attr_reader :args, :days, :cache, :disk_cleanup_size
|
attr_reader :args, :days, :cache, :disk_cleanup_size
|
||||||
|
|
||||||
def initialize(*args, dry_run: false, scrub: false, days: nil, cache: HOMEBREW_CACHE)
|
def initialize(*args, dry_run: false, scrub: false, days: nil, cache: HOMEBREW_CACHE)
|
||||||
@ -227,6 +223,15 @@ module Homebrew
|
|||||||
@cleaned_up_paths = Set.new
|
@cleaned_up_paths = Set.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def dry_run? = @dry_run
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def prune? = @prune
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def scrub? = @scrub
|
||||||
|
|
||||||
def self.install_formula_clean!(formula, dry_run: false)
|
def self.install_formula_clean!(formula, dry_run: false)
|
||||||
return if Homebrew::EnvConfig.no_install_cleanup?
|
return if Homebrew::EnvConfig.no_install_cleanup?
|
||||||
return unless formula.latest_version_installed?
|
return unless formula.latest_version_installed?
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "mutex_m"
|
require "mutex_m"
|
||||||
require "ignorable"
|
require "ignorable"
|
||||||
|
|
||||||
@ -73,9 +72,10 @@ module Debrew
|
|||||||
@debugged_exceptions = Set.new
|
@debugged_exceptions = Set.new
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
extend Attrable
|
|
||||||
attr_predicate :active?
|
|
||||||
attr_reader :debugged_exceptions
|
attr_reader :debugged_exceptions
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def active? = @active
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.debrew
|
def self.debrew
|
||||||
|
|||||||
@ -261,8 +261,8 @@ module Homebrew
|
|||||||
audit_token_conflicts: args.token_conflicts? || nil,
|
audit_token_conflicts: args.token_conflicts? || nil,
|
||||||
quarantine: true,
|
quarantine: true,
|
||||||
any_named_args: !no_named_args,
|
any_named_args: !no_named_args,
|
||||||
only: args.only,
|
only: args.only || [],
|
||||||
except: args.except,
|
except: args.except || [],
|
||||||
).to_a
|
).to_a
|
||||||
end
|
end
|
||||||
end.uniq
|
end.uniq
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: strict
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "cache_store"
|
require "cache_store"
|
||||||
require "did_you_mean"
|
require "did_you_mean"
|
||||||
require "formula_support"
|
require "formula_support"
|
||||||
@ -79,7 +78,6 @@ class Formula
|
|||||||
include Homebrew::Livecheck::Constants
|
include Homebrew::Livecheck::Constants
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
extend Cachable
|
extend Cachable
|
||||||
extend Attrable
|
|
||||||
extend APIHashable
|
extend APIHashable
|
||||||
extend T::Helpers
|
extend T::Helpers
|
||||||
|
|
||||||
@ -3288,8 +3286,6 @@ class Formula
|
|||||||
|
|
||||||
# The methods below define the formula DSL.
|
# The methods below define the formula DSL.
|
||||||
class << self
|
class << self
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
include BuildEnvironment::DSL
|
include BuildEnvironment::DSL
|
||||||
include OnSystem::MacOSAndLinux
|
include OnSystem::MacOSAndLinux
|
||||||
|
|
||||||
@ -3307,6 +3303,7 @@ class Formula
|
|||||||
@skip_clean_paths = T.let(Set.new, T.nilable(T::Set[T.any(String, Symbol)]))
|
@skip_clean_paths = T.let(Set.new, T.nilable(T::Set[T.any(String, Symbol)]))
|
||||||
@link_overwrite_paths = T.let(Set.new, T.nilable(T::Set[String]))
|
@link_overwrite_paths = T.let(Set.new, T.nilable(T::Set[String]))
|
||||||
@loaded_from_api = T.let(false, T.nilable(T::Boolean))
|
@loaded_from_api = T.let(false, T.nilable(T::Boolean))
|
||||||
|
@on_system_blocks_exist = T.let(false, T.nilable(T::Boolean))
|
||||||
@network_access_allowed = T.let(SUPPORTED_NETWORK_ACCESS_PHASES.to_h do |phase|
|
@network_access_allowed = T.let(SUPPORTED_NETWORK_ACCESS_PHASES.to_h do |phase|
|
||||||
[phase, DEFAULT_NETWORK_ACCESS_ALLOWED]
|
[phase, DEFAULT_NETWORK_ACCESS_ALLOWED]
|
||||||
end, T.nilable(T::Hash[Symbol, T::Boolean]))
|
end, T.nilable(T::Hash[Symbol, T::Boolean]))
|
||||||
@ -3327,11 +3324,13 @@ class Formula
|
|||||||
def network_access_allowed = T.must(@network_access_allowed)
|
def network_access_allowed = T.must(@network_access_allowed)
|
||||||
|
|
||||||
# Whether this formula was loaded using the formulae.brew.sh API
|
# Whether this formula was loaded using the formulae.brew.sh API
|
||||||
attr_predicate :loaded_from_api?
|
sig { returns(T::Boolean) }
|
||||||
|
def loaded_from_api? = !!@loaded_from_api
|
||||||
|
|
||||||
# Whether this formula contains OS/arch-specific blocks
|
# Whether this formula contains OS/arch-specific blocks
|
||||||
# (e.g. `on_macos`, `on_arm`, `on_monterey :or_older`, `on_system :linux, macos: :big_sur_or_newer`).
|
# (e.g. `on_macos`, `on_arm`, `on_monterey :or_older`, `on_system :linux, macos: :big_sur_or_newer`).
|
||||||
attr_predicate :on_system_blocks_exist?
|
sig { returns(T::Boolean) }
|
||||||
|
def on_system_blocks_exist? = !!@on_system_blocks_exist
|
||||||
|
|
||||||
# The reason for why this software is not linked (by default) to {::HOMEBREW_PREFIX}.
|
# The reason for why this software is not linked (by default) to {::HOMEBREW_PREFIX}.
|
||||||
sig { returns(T.nilable(KegOnlyReason)) }
|
sig { returns(T.nilable(KegOnlyReason)) }
|
||||||
|
|||||||
@ -29,7 +29,6 @@ require "utils/fork"
|
|||||||
# Installer for a formula.
|
# Installer for a formula.
|
||||||
class FormulaInstaller
|
class FormulaInstaller
|
||||||
include FormulaCellarChecks
|
include FormulaCellarChecks
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
ETC_VAR_DIRS = T.let([HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"].freeze, T::Array[Pathname])
|
ETC_VAR_DIRS = T.let([HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"].freeze, T::Array[Pathname])
|
||||||
|
|
||||||
@ -45,12 +44,6 @@ class FormulaInstaller
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
attr_accessor :link_keg
|
attr_accessor :link_keg
|
||||||
|
|
||||||
attr_predicate :installed_as_dependency?, :installed_on_request?
|
|
||||||
attr_predicate :show_summary_heading?, :show_header?
|
|
||||||
attr_predicate :force_bottle?, :ignore_deps?, :only_deps?, :interactive?, :git?, :force?, :overwrite?, :keep_tmp?
|
|
||||||
attr_predicate :debug_symbols?
|
|
||||||
attr_predicate :verbose?, :debug?, :quiet?
|
|
||||||
|
|
||||||
sig {
|
sig {
|
||||||
params(
|
params(
|
||||||
formula: Formula,
|
formula: Formula,
|
||||||
@ -148,6 +141,54 @@ class FormulaInstaller
|
|||||||
@formula = T.let(T.must(previously_fetched_formula), Formula) if previously_fetched_formula
|
@formula = T.let(T.must(previously_fetched_formula), Formula) if previously_fetched_formula
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def debug? = @debug
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def debug_symbols? = @debug_symbols
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def force? = @force
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def force_bottle? = @force_bottle
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def git? = @git
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def ignore_deps? = @ignore_deps
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def installed_as_dependency? = @installed_as_dependency
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def installed_on_request? = @installed_on_request
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def interactive? = @interactive
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def keep_tmp? = @keep_tmp
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def only_deps? = @only_deps
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def overwrite? = @overwrite
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def quiet? = @quiet
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def show_header? = @show_header
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def show_summary_heading? = @show_summary_heading
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def verbose? = @verbose
|
||||||
|
|
||||||
sig { returns(T::Set[Formula]) }
|
sig { returns(T::Set[Formula]) }
|
||||||
def self.attempted
|
def self.attempted
|
||||||
@attempted ||= T.let(Set.new, T.nilable(T::Set[Formula]))
|
@attempted ||= T.let(Set.new, T.nilable(T::Set[Formula]))
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "dependable"
|
require "dependable"
|
||||||
require "dependency"
|
require "dependency"
|
||||||
require "dependencies"
|
require "dependencies"
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "resource"
|
require "resource"
|
||||||
require "download_strategy"
|
require "download_strategy"
|
||||||
require "checksum"
|
require "checksum"
|
||||||
|
|||||||
23
Library/Homebrew/sorbet/rbi/dsl/cask/audit.rbi
generated
23
Library/Homebrew/sorbet/rbi/dsl/cask/audit.rbi
generated
@ -1,23 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `Cask::Audit`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl Cask::Audit`.
|
|
||||||
|
|
||||||
|
|
||||||
class Cask::Audit
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def new_cask?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def online?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def signing?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def strict?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def token_conflicts?; end
|
|
||||||
end
|
|
||||||
3
Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi
generated
3
Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi
generated
@ -120,9 +120,6 @@ class Cask::Cask
|
|||||||
sig { params(args: T.untyped, block: T.untyped).returns(T::Boolean) }
|
sig { params(args: T.untyped, block: T.untyped).returns(T::Boolean) }
|
||||||
def livecheckable?(*args, &block); end
|
def livecheckable?(*args, &block); end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def loaded_from_api?; end
|
|
||||||
|
|
||||||
sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) }
|
sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) }
|
||||||
def manpage(*args, &block); end
|
def manpage(*args, &block); end
|
||||||
|
|
||||||
|
|||||||
23
Library/Homebrew/sorbet/rbi/dsl/cask/dsl.rbi
generated
23
Library/Homebrew/sorbet/rbi/dsl/cask/dsl.rbi
generated
@ -1,23 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `Cask::DSL`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl Cask::DSL`.
|
|
||||||
|
|
||||||
|
|
||||||
class Cask::DSL
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def depends_on_set_in_block?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def deprecated?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def disabled?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def livecheck_defined?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def on_system_blocks_exist?; end
|
|
||||||
end
|
|
||||||
@ -5,7 +5,4 @@
|
|||||||
# Please instead update this file by running `bin/tapioca dsl Cask::DSL::Caveats`.
|
# Please instead update this file by running `bin/tapioca dsl Cask::DSL::Caveats`.
|
||||||
|
|
||||||
|
|
||||||
class Cask::DSL::Caveats
|
class Cask::DSL::Caveats; end
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def discontinued?; end
|
|
||||||
end
|
|
||||||
|
|||||||
47
Library/Homebrew/sorbet/rbi/dsl/cask/installer.rbi
generated
47
Library/Homebrew/sorbet/rbi/dsl/cask/installer.rbi
generated
@ -1,47 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `Cask::Installer`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl Cask::Installer`.
|
|
||||||
|
|
||||||
|
|
||||||
class Cask::Installer
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def adopt?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def binaries?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def force?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def installed_as_dependency?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def installed_on_request?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def quarantine?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def quiet?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def reinstall?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def require_sha?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def skip_cask_deps?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def upgrade?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def verbose?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def zap?; end
|
|
||||||
end
|
|
||||||
13
Library/Homebrew/sorbet/rbi/dsl/debrew.rbi
generated
13
Library/Homebrew/sorbet/rbi/dsl/debrew.rbi
generated
@ -1,13 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `Debrew`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl Debrew`.
|
|
||||||
|
|
||||||
|
|
||||||
module Debrew
|
|
||||||
class << self
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def active?; end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
8
Library/Homebrew/sorbet/rbi/dsl/formula.rbi
generated
8
Library/Homebrew/sorbet/rbi/dsl/formula.rbi
generated
@ -140,12 +140,4 @@ class Formula
|
|||||||
|
|
||||||
sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) }
|
sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) }
|
||||||
def version(*args, &block); end
|
def version(*args, &block); end
|
||||||
|
|
||||||
class << self
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def loaded_from_api?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def on_system_blocks_exist?; end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,56 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `FormulaInstaller`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl FormulaInstaller`.
|
|
||||||
|
|
||||||
|
|
||||||
class FormulaInstaller
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def debug?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def debug_symbols?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def force?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def force_bottle?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def git?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def ignore_deps?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def installed_as_dependency?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def installed_on_request?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def interactive?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def keep_tmp?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def only_deps?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def overwrite?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def quiet?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def show_header?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def show_summary_heading?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def verbose?; end
|
|
||||||
end
|
|
||||||
17
Library/Homebrew/sorbet/rbi/dsl/homebrew/cleanup.rbi
generated
17
Library/Homebrew/sorbet/rbi/dsl/homebrew/cleanup.rbi
generated
@ -1,17 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `Homebrew::Cleanup`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl Homebrew::Cleanup`.
|
|
||||||
|
|
||||||
|
|
||||||
class Homebrew::Cleanup
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def dry_run?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def prune?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def scrub?; end
|
|
||||||
end
|
|
||||||
20
Library/Homebrew/sorbet/rbi/dsl/system_command.rbi
generated
20
Library/Homebrew/sorbet/rbi/dsl/system_command.rbi
generated
@ -1,20 +0,0 @@
|
|||||||
# typed: true
|
|
||||||
|
|
||||||
# DO NOT EDIT MANUALLY
|
|
||||||
# This is an autogenerated file for dynamic methods in `SystemCommand`.
|
|
||||||
# Please instead update this file by running `bin/tapioca dsl SystemCommand`.
|
|
||||||
|
|
||||||
|
|
||||||
class SystemCommand
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def must_succeed?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def reset_uid?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def sudo?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def sudo_as_root?; end
|
|
||||||
end
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
# typed: strict
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require_relative "../../../global"
|
|
||||||
require "sorbet/tapioca/utils"
|
|
||||||
require "debrew"
|
|
||||||
|
|
||||||
module Tapioca
|
|
||||||
module Compilers
|
|
||||||
class Attrables < Tapioca::Dsl::Compiler
|
|
||||||
ATTRABLE_FILENAME = "attrable.rb"
|
|
||||||
ConstantType = type_member { { fixed: Module } }
|
|
||||||
|
|
||||||
sig { override.returns(T::Enumerable[Module]) }
|
|
||||||
def self.gather_constants = Homebrew::Tapioca::Utils.named_objects_with_module(Attrable)
|
|
||||||
|
|
||||||
sig { override.void }
|
|
||||||
def decorate
|
|
||||||
root.create_path(constant) do |klass|
|
|
||||||
Homebrew::Tapioca::Utils.methods_from_file(constant, ATTRABLE_FILENAME)
|
|
||||||
.each { |method| compile_attrable_method(klass, method) }
|
|
||||||
Homebrew::Tapioca::Utils.methods_from_file(constant, ATTRABLE_FILENAME, class_methods: true)
|
|
||||||
.each { |method| compile_attrable_method(klass, method, class_method: true) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
sig { params(klass: RBI::Scope, method: T.any(Method, UnboundMethod), class_method: T::Boolean).void }
|
|
||||||
def compile_attrable_method(klass, method, class_method: false)
|
|
||||||
raise "Unsupported arity for method #{method.name} - did `Attrable` change?" unless method.arity.zero?
|
|
||||||
|
|
||||||
# attr_predicate
|
|
||||||
klass.create_method(
|
|
||||||
method.name.to_s,
|
|
||||||
return_type: "T::Boolean",
|
|
||||||
class_method:,
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "attrable"
|
|
||||||
require "plist"
|
require "plist"
|
||||||
require "shellwords"
|
require "shellwords"
|
||||||
require "uri"
|
require "uri"
|
||||||
@ -34,7 +33,6 @@ class SystemCommand
|
|||||||
end
|
end
|
||||||
|
|
||||||
include Context
|
include Context
|
||||||
extend Attrable
|
|
||||||
|
|
||||||
def self.run(executable, **options)
|
def self.run(executable, **options)
|
||||||
new(executable, **options).run!
|
new(executable, **options).run!
|
||||||
@ -154,7 +152,17 @@ class SystemCommand
|
|||||||
|
|
||||||
attr_reader :executable, :args, :input, :chdir, :env
|
attr_reader :executable, :args, :input, :chdir, :env
|
||||||
|
|
||||||
attr_predicate :sudo?, :sudo_as_root?, :must_succeed?, :reset_uid?
|
sig { returns(T::Boolean) }
|
||||||
|
def must_succeed? = @must_succeed
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def reset_uid? = @reset_uid
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def sudo? = @sudo
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def sudo_as_root? = @sudo_as_root
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def debug?
|
def debug?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user