Reclaim some vertical real estate

This commit is contained in:
Douglas Eichelberger 2025-02-17 11:37:57 -08:00 committed by Douglas Eichelberger
parent a81239ec2d
commit beeb0b8f6d
No known key found for this signature in database
GPG Key ID: F90193CBD547EB81

View File

@ -364,14 +364,10 @@ class Formula
end end
sig { returns(T.nilable(String)) } sig { returns(T.nilable(String)) }
def installed_alias_name def installed_alias_name = installed_alias_path&.basename&.to_s
installed_alias_path&.basename&.to_s
end
sig { returns(T.nilable(String)) } sig { returns(T.nilable(String)) }
def full_installed_alias_name def full_installed_alias_name = full_name_with_optional_tap(installed_alias_name)
full_name_with_optional_tap(installed_alias_name)
end
# The path that was specified to find this formula. # The path that was specified to find this formula.
sig { returns(T.nilable(Pathname)) } sig { returns(T.nilable(Pathname)) }
@ -524,15 +520,11 @@ class Formula
# The {PkgVersion} for this formula with {version} and {#revision} information. # The {PkgVersion} for this formula with {version} and {#revision} information.
sig { returns(PkgVersion) } sig { returns(PkgVersion) }
def pkg_version def pkg_version = PkgVersion.new(version, revision)
PkgVersion.new(version, revision)
end
# If this is a `@`-versioned formula. # If this is a `@`-versioned formula.
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def versioned_formula? def versioned_formula? = name.include?("@")
name.include?("@")
end
# Returns any other `@`-versioned formulae names for any formula (including versioned formulae). # Returns any other `@`-versioned formulae names for any formula (including versioned formulae).
sig { returns(T::Array[String]) } sig { returns(T::Array[String]) }
@ -761,15 +753,11 @@ class Formula
# #
# @api internal # @api internal
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def linked? def linked? = linked_keg.symlink?
linked_keg.symlink?
end
# Is the formula linked to `opt`? # Is the formula linked to `opt`?
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def optlinked? def optlinked? = opt_prefix.symlink?
opt_prefix.symlink?
end
# If a formula's linked keg points to the prefix. # If a formula's linked keg points to the prefix.
sig { params(version: T.any(String, PkgVersion)).returns(T::Boolean) } sig { params(version: T.any(String, PkgVersion)).returns(T::Boolean) }
@ -790,9 +778,7 @@ class Formula
# The parent of the prefix; the named directory in the cellar containing all # The parent of the prefix; the named directory in the cellar containing all
# installed versions of this software. # installed versions of this software.
sig { returns(Pathname) } sig { returns(Pathname) }
def rack def rack = HOMEBREW_CELLAR/name
HOMEBREW_CELLAR/name
end
# All currently installed prefix directories. # All currently installed prefix directories.
sig { returns(T::Array[Pathname]) } sig { returns(T::Array[Pathname]) }
@ -829,9 +815,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def bin def bin = prefix/"bin"
prefix/"bin"
end
# The directory where the formula's documentation should be installed. # The directory where the formula's documentation should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -839,9 +823,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def doc def doc = share/"doc"/name
share/"doc"/name
end
# The directory where the formula's headers should be installed. # The directory where the formula's headers should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -857,9 +839,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def include def include = prefix/"include"
prefix/"include"
end
# The directory where the formula's info files should be installed. # The directory where the formula's info files should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -867,9 +847,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def info def info = share/"info"
share/"info"
end
# The directory where the formula's libraries should be installed. # The directory where the formula's libraries should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -885,9 +863,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def lib def lib = prefix/"lib"
prefix/"lib"
end
# The directory where the formula's binaries should be installed. # The directory where the formula's binaries should be installed.
# This is not symlinked into `HOMEBREW_PREFIX`. # This is not symlinked into `HOMEBREW_PREFIX`.
@ -904,9 +880,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def libexec def libexec = prefix/"libexec"
prefix/"libexec"
end
# The root directory where the formula's manual pages should be installed. # The root directory where the formula's manual pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -916,9 +890,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man def man = share/"man"
share/"man"
end
# The directory where the formula's man1 pages should be installed. # The directory where the formula's man1 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -934,9 +906,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man1 def man1 = man/"man1"
man/"man1"
end
# The directory where the formula's man2 pages should be installed. # The directory where the formula's man2 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -944,9 +914,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man2 def man2 = man/"man2"
man/"man2"
end
# The directory where the formula's man3 pages should be installed. # The directory where the formula's man3 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -962,9 +930,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man3 def man3 = man/"man3"
man/"man3"
end
# The directory where the formula's man4 pages should be installed. # The directory where the formula's man4 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -972,9 +938,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man4 def man4 = man/"man4"
man/"man4"
end
# The directory where the formula's man5 pages should be installed. # The directory where the formula's man5 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -982,9 +946,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man5 def man5 = man/"man5"
man/"man5"
end
# The directory where the formula's man6 pages should be installed. # The directory where the formula's man6 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -992,9 +954,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man6 def man6 = man/"man6"
man/"man6"
end
# The directory where the formula's man7 pages should be installed. # The directory where the formula's man7 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1002,9 +962,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man7 def man7 = man/"man7"
man/"man7"
end
# The directory where the formula's man8 pages should be installed. # The directory where the formula's man8 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1012,9 +970,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def man8 def man8 = man/"man8"
man/"man8"
end
# The directory where the formula's `sbin` binaries should be installed. # The directory where the formula's `sbin` binaries should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1023,9 +979,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def sbin def sbin = prefix/"sbin"
prefix/"sbin"
end
# The directory where the formula's shared files should be installed. # The directory where the formula's shared files should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1059,9 +1013,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def share def share = prefix/"share"
prefix/"share"
end
# The directory where the formula's shared files should be installed, # The directory where the formula's shared files should be installed,
# with the name of the formula appended to avoid linking conflicts. # with the name of the formula appended to avoid linking conflicts.
@ -1078,9 +1030,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def pkgshare def pkgshare = prefix/"share"/name
prefix/"share"/name
end
# The directory where Emacs Lisp files should be installed, with the # The directory where Emacs Lisp files should be installed, with the
# formula name appended to avoid linking conflicts. # formula name appended to avoid linking conflicts.
@ -1095,9 +1045,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def elisp def elisp = prefix/"share/emacs/site-lisp"/name
prefix/"share/emacs/site-lisp"/name
end
# The directory where the formula's Frameworks should be installed. # The directory where the formula's Frameworks should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1106,9 +1054,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def frameworks def frameworks = prefix/"Frameworks"
prefix/"Frameworks"
end
# The directory where the formula's kernel extensions should be installed. # The directory where the formula's kernel extensions should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
@ -1117,9 +1063,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def kext_prefix def kext_prefix = prefix/"Library/Extensions"
prefix/"Library/Extensions"
end
# The directory where the formula's configuration files should be installed. # The directory where the formula's configuration files should be installed.
# Anything using `etc.install` will not overwrite other files on e.g. upgrades # Anything using `etc.install` will not overwrite other files on e.g. upgrades
@ -1129,9 +1073,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def etc def etc = (HOMEBREW_PREFIX/"etc").extend(InstallRenamed)
(HOMEBREW_PREFIX/"etc").extend(InstallRenamed)
end
# A subdirectory of `etc` with the formula name suffixed. # A subdirectory of `etc` with the formula name suffixed.
# e.g. `$HOMEBREW_PREFIX/etc/openssl@1.1` # e.g. `$HOMEBREW_PREFIX/etc/openssl@1.1`
@ -1140,9 +1082,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def pkgetc def pkgetc = (HOMEBREW_PREFIX/"etc"/name).extend(InstallRenamed)
(HOMEBREW_PREFIX/"etc"/name).extend(InstallRenamed)
end
# The directory where the formula's variable files should be installed. # The directory where the formula's variable files should be installed.
# This directory is not inside the `HOMEBREW_CELLAR` so it persists # This directory is not inside the `HOMEBREW_CELLAR` so it persists
@ -1150,9 +1090,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def var def var = HOMEBREW_PREFIX/"var"
HOMEBREW_PREFIX/"var"
end
# The directory where the formula's zsh function files should be # The directory where the formula's zsh function files should be
# installed. # installed.
@ -1161,9 +1099,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def zsh_function def zsh_function = share/"zsh/site-functions"
share/"zsh/site-functions"
end
# The directory where the formula's fish function files should be # The directory where the formula's fish function files should be
# installed. # installed.
@ -1172,9 +1108,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def fish_function def fish_function = share/"fish/vendor_functions.d"
share/"fish/vendor_functions.d"
end
# The directory where the formula's Bash completion files should be # The directory where the formula's Bash completion files should be
# installed. # installed.
@ -1183,9 +1117,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def bash_completion def bash_completion = prefix/"etc/bash_completion.d"
prefix/"etc/bash_completion.d"
end
# The directory where the formula's zsh completion files should be # The directory where the formula's zsh completion files should be
# installed. # installed.
@ -1194,9 +1126,7 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def zsh_completion def zsh_completion = share/"zsh/site-functions"
share/"zsh/site-functions"
end
# The directory where the formula's fish completion files should be # The directory where the formula's fish completion files should be
# installed. # installed.
@ -1205,23 +1135,17 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def fish_completion def fish_completion = share/"fish/vendor_completions.d"
share/"fish/vendor_completions.d"
end
# The directory used for as the prefix for {#etc} and {#var} files on # The directory used for as the prefix for {#etc} and {#var} files on
# installation so, despite not being in `HOMEBREW_CELLAR`, they are installed # installation so, despite not being in `HOMEBREW_CELLAR`, they are installed
# there after pouring a bottle. # there after pouring a bottle.
sig { returns(Pathname) } sig { returns(Pathname) }
def bottle_prefix def bottle_prefix = prefix/".bottle"
prefix/".bottle"
end
# The directory where the formula's installation or test logs will be written. # The directory where the formula's installation or test logs will be written.
sig { returns(Pathname) } sig { returns(Pathname) }
def logs def logs = HOMEBREW_LOGS + name
HOMEBREW_LOGS + name
end
# The prefix, if any, to use in filenames for logging current activity. # The prefix, if any, to use in filenames for logging current activity.
sig { returns(String) } sig { returns(String) }
@ -1283,33 +1207,23 @@ class Formula
# The generated launchd {.plist} service name. # The generated launchd {.plist} service name.
sig { returns(String) } sig { returns(String) }
def plist_name def plist_name = service.plist_name
service.plist_name
end
# The generated service name. # The generated service name.
sig { returns(String) } sig { returns(String) }
def service_name def service_name = service.service_name
service.service_name
end
# The generated launchd {.service} file path. # The generated launchd {.service} file path.
sig { returns(Pathname) } sig { returns(Pathname) }
def launchd_service_path def launchd_service_path = opt_prefix/"#{plist_name}.plist"
opt_prefix/"#{plist_name}.plist"
end
# The generated systemd {.service} file path. # The generated systemd {.service} file path.
sig { returns(Pathname) } sig { returns(Pathname) }
def systemd_service_path def systemd_service_path = opt_prefix/"#{service_name}.service"
opt_prefix/"#{service_name}.service"
end
# The generated systemd {.timer} file path. # The generated systemd {.timer} file path.
sig { returns(Pathname) } sig { returns(Pathname) }
def systemd_timer_path def systemd_timer_path = opt_prefix/"#{service_name}.timer"
opt_prefix/"#{service_name}.timer"
end
# The service specification of the software. # The service specification of the software.
sig { returns(Homebrew::Service) } sig { returns(Homebrew::Service) }
@ -1332,81 +1246,61 @@ class Formula
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_prefix def opt_prefix = HOMEBREW_PREFIX/"opt"/name
HOMEBREW_PREFIX/"opt"/name
end
# Same as {#bin}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#bin}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_bin def opt_bin = opt_prefix/"bin"
opt_prefix/"bin"
end
# Same as {#include}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#include}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_include def opt_include = opt_prefix/"include"
opt_prefix/"include"
end
# Same as {#lib}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#lib}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_lib def opt_lib = opt_prefix/"lib"
opt_prefix/"lib"
end
# Same as {#libexec}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#libexec}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_libexec def opt_libexec = opt_prefix/"libexec"
opt_prefix/"libexec"
end
# Same as {#sbin}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#sbin}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_sbin def opt_sbin = opt_prefix/"sbin"
opt_prefix/"sbin"
end
# Same as {#share}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#share}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_share def opt_share = opt_prefix/"share"
opt_prefix/"share"
end
# Same as {#pkgshare}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#pkgshare}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_pkgshare def opt_pkgshare = opt_prefix/"share"/name
opt_prefix/"share"/name
end
# Same as {#elisp}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#elisp}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_elisp def opt_elisp = opt_prefix/"share/emacs/site-lisp"/name
opt_prefix/"share/emacs/site-lisp"/name
end
# Same as {#frameworks}, but relative to {#opt_prefix} instead of {#prefix}. # Same as {#frameworks}, but relative to {#opt_prefix} instead of {#prefix}.
# #
# @api public # @api public
sig { returns(Pathname) } sig { returns(Pathname) }
def opt_frameworks def opt_frameworks = opt_prefix/"Frameworks"
opt_prefix/"Frameworks"
end
# Indicates that this formula supports bottles. (Not necessarily that one # Indicates that this formula supports bottles. (Not necessarily that one
# should be used in the current installation run.) # should be used in the current installation run.)
@ -1415,9 +1309,7 @@ class Formula
# are supported. # are supported.
# Replaced by {.pour_bottle?}'s `satisfy` method if it is specified. # Replaced by {.pour_bottle?}'s `satisfy` method if it is specified.
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def pour_bottle? def pour_bottle? = true
true
end
delegate pour_bottle_check_unsatisfied_reason: :"self.class" delegate pour_bottle_check_unsatisfied_reason: :"self.class"
@ -1497,9 +1389,7 @@ class Formula
# end # end
# ``` # ```
sig { overridable.returns(T.nilable(String)) } sig { overridable.returns(T.nilable(String)) }
def caveats def caveats = nil
nil
end
# Rarely, you don't want your library symlinked into the main prefix. # Rarely, you don't want your library symlinked into the main prefix.
# See `gettext.rb` for an example. # See `gettext.rb` for an example.
@ -1617,14 +1507,10 @@ class Formula
delegate disable_replacement: :"self.class" delegate disable_replacement: :"self.class"
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def skip_cxxstdlib_check? def skip_cxxstdlib_check? = false
false
end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def require_universal_deps? def require_universal_deps? = false
false
end
sig { void } sig { void }
def patch def patch
@ -1782,9 +1668,7 @@ class Formula
# Is this formula the target of an alias used to install an old formula? # Is this formula the target of an alias used to install an old formula?
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def supersedes_an_installed_formula? def supersedes_an_installed_formula? = old_installed_formulae.any?
old_installed_formulae.any?
end
# Has the alias used to install the formula changed, or are different # Has the alias used to install the formula changed, or are different
# formulae already installed with this alias? # formulae already installed with this alias?
@ -1820,18 +1704,12 @@ class Formula
true true
end end
delegate pinnable?: :@pin def_delegators :@pin, :pinnable?, :pinned_version, :pin, :unpin
# !attr[r] pinned? # !attr[r] pinned?
# @api internal # @api internal
delegate pinned?: :@pin delegate pinned?: :@pin
delegate pinned_version: :@pin
delegate pin: :@pin
delegate unpin: :@pin
sig { params(other: T.untyped).returns(T::Boolean) } sig { params(other: T.untyped).returns(T::Boolean) }
def ==(other) def ==(other)
self.class == other.class && self.class == other.class &&
@ -1841,9 +1719,7 @@ class Formula
alias eql? == alias eql? ==
sig { returns(Integer) } sig { returns(Integer) }
def hash def hash = name.hash
name.hash
end
sig { params(other: BasicObject).returns(T.nilable(Integer)) } sig { params(other: BasicObject).returns(T.nilable(Integer)) }
def <=>(other) def <=>(other)
@ -2058,9 +1934,7 @@ class Formula
# #
# @api public # @api public
sig { returns(String) } sig { returns(String) }
def loader_path def loader_path = "@loader_path"
"@loader_path"
end
# Creates a new `Time` object for use in the formula as the build time. # Creates a new `Time` object for use in the formula as the build time.
# #
@ -3722,9 +3596,7 @@ class Formula
end end
sig { returns(T::Array[Symbol]) } sig { returns(T::Array[Symbol]) }
def spec_syms def spec_syms = [:stable, :head].freeze
[:stable, :head].freeze
end
# A list of the {.stable} and {.head} {SoftwareSpec}s. # A list of the {.stable} and {.head} {SoftwareSpec}s.
sig { returns(T::Array[SoftwareSpec]) } sig { returns(T::Array[SoftwareSpec]) }
@ -3759,9 +3631,7 @@ class Formula
# @!attribute [w] url # @!attribute [w] url
# @api public # @api public
sig { params(val: String, specs: T::Hash[Symbol, T.any(String, Symbol)]).void } sig { params(val: String, specs: T::Hash[Symbol, T.any(String, Symbol)]).void }
def url(val, specs = {}) def url(val, specs = {}) = stable.url(val, specs)
stable.url(val, specs)
end
# @!attribute [w] version # @!attribute [w] version
# The version string for the {.stable} version of the formula. # The version string for the {.stable} version of the formula.
@ -3776,9 +3646,7 @@ class Formula
# #
# @api public # @api public
sig { params(val: T.nilable(String)).void } sig { params(val: T.nilable(String)).void }
def version(val = nil) def version(val = nil) = stable.version(val)
stable.version(val)
end
# @!attribute [w] mirror # @!attribute [w] mirror
# Additional URLs for the {.stable} version of the formula. # Additional URLs for the {.stable} version of the formula.
@ -3796,9 +3664,7 @@ class Formula
# #
# @api public # @api public
sig { params(val: String).void } sig { params(val: String).void }
def mirror(val) def mirror(val) = stable.mirror(val)
stable.mirror(val)
end
# @!attribute [w] sha256 # @!attribute [w] sha256
# @scope class # @scope class
@ -3815,9 +3681,7 @@ class Formula
# #
# @api public # @api public
sig { params(val: String).void } sig { params(val: String).void }
def sha256(val) def sha256(val) = stable.sha256(val)
stable.sha256(val)
end
# Adds a {.bottle} {SoftwareSpec}. # Adds a {.bottle} {SoftwareSpec}.
# This provides a pre-built binary package built by the Homebrew maintainers for you. # This provides a pre-built binary package built by the Homebrew maintainers for you.
@ -3844,14 +3708,10 @@ class Formula
# #
# @api public # @api public
sig { params(block: T.proc.bind(BottleSpecification).void).void } sig { params(block: T.proc.bind(BottleSpecification).void).void }
def bottle(&block) def bottle(&block) = stable.bottle(&block)
stable.bottle(&block)
end
sig { returns(String) } sig { returns(String) }
def build def build = stable.build
stable.build
end
# Get the `BUILD_FLAGS` from the formula's namespace set in `Formulary::load_formula`. # Get the `BUILD_FLAGS` from the formula's namespace set in `Formulary::load_formula`.
sig { returns(T::Array[String]) } sig { returns(T::Array[String]) }
@ -4313,9 +4173,7 @@ class Formula
# @return [Boolean] # @return [Boolean]
# @api public # @api public
sig { params(block: T.proc.returns(T.untyped)).returns(T.untyped) } sig { params(block: T.proc.returns(T.untyped)).returns(T.untyped) }
def test(&block) def test(&block) = define_method(:test, &block)
define_method(:test, &block)
end
# {Livecheck} can be used to check for newer versions of the software. # {Livecheck} can be used to check for newer versions of the software.
# This method evaluates the DSL specified in the `livecheck` block of the # This method evaluates the DSL specified in the `livecheck` block of the
@ -4358,10 +4216,7 @@ class Formula
# #
# @!attribute [w] service # @!attribute [w] service
# @api public # @api public
sig { sig { params(block: T.nilable(T.proc.returns(T.untyped))).returns(T.nilable(T.proc.returns(T.untyped))) }
params(block: T.nilable(T.proc.returns(T.untyped)))
.returns(T.nilable(T.proc.returns(T.untyped)))
}
def service(&block) def service(&block)
return @service_block unless block return @service_block unless block