apidoc: add/update yard tags

This commit is contained in:
EricFromCanada 2020-11-05 15:19:56 -05:00
parent 4f7719ac2e
commit dddfbf80fc
12 changed files with 44 additions and 37 deletions

View File

@ -152,8 +152,9 @@ class Bintray
end end
# Gets the SHA-256 checksum of the specified remote file. # Gets the SHA-256 checksum of the specified remote file.
# Returns the empty string if the file exists but doesn't have a checksum. #
# Returns nil if the file doesn't exist. # @return the empty string if the file exists but doesn't have a checksum.
# @return [nil] if the file doesn't exist.
def remote_checksum(repo:, remote_file:) def remote_checksum(repo:, remote_file:)
url = "https://dl.bintray.com/#{@bintray_org}/#{repo}/#{remote_file}" url = "https://dl.bintray.com/#{@bintray_org}/#{repo}/#{remote_file}"
result = curl_output "--fail", "--silent", "--head", url result = curl_output "--fail", "--silent", "--head", url

View File

@ -4,10 +4,10 @@
require "cask/artifact/moved" require "cask/artifact/moved"
module Cask module Cask
# Artifact corresponding to the `colorpicker` stanza.
#
# @api private
module Artifact module Artifact
# Artifact corresponding to the `colorpicker` stanza.
#
# @api private
class Colorpicker < Moved class Colorpicker < Moved
end end
end end

View File

@ -433,7 +433,7 @@ module Homebrew
end end
end end
# try to remove these, it's not a good user experience # TODO: try to remove these, it's not a good user experience
VERSIONED_DEPENDENCIES_CONFLICTS_ALLOWLIST = %w[ VERSIONED_DEPENDENCIES_CONFLICTS_ALLOWLIST = %w[
agda agda
anjuta anjuta

View File

@ -52,7 +52,7 @@ module Homebrew
@verbose = verbose @verbose = verbose
end end
############# HELPERS ############# @!group HELPERS
# Finds files in `HOMEBREW_PREFIX` *and* /usr/local. # Finds files in `HOMEBREW_PREFIX` *and* /usr/local.
# Specify paths relative to a prefix, e.g. "include/foo.h". # Specify paths relative to a prefix, e.g. "include/foo.h".
# Sets @found for your convenience. # Sets @found for your convenience.
@ -78,7 +78,7 @@ module Homebrew
def add_info(*args) def add_info(*args)
ohai(*args) if @verbose ohai(*args) if @verbose
end end
############# END HELPERS ############# @!endgroup END HELPERS
def fatal_preinstall_checks def fatal_preinstall_checks
%w[ %w[

View File

@ -159,12 +159,13 @@ module SharedEnvExtension
end end
# Outputs the current compiler. # Outputs the current compiler.
# @return [Symbol]
# <pre># Do something only for the system clang # <pre># Do something only for the system clang
# if ENV.compiler == :clang # if ENV.compiler == :clang
# # modify CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS in one go: # # modify CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS in one go:
# ENV.append_to_cflags "-I ./missing/includes" # ENV.append_to_cflags "-I ./missing/includes"
# end</pre> # end</pre>
#
# @return [Symbol]
def compiler def compiler
@compiler ||= if (cc = @cc) @compiler ||= if (cc = @cc)
warn_about_non_apple_gcc(cc) if cc.match?(GNU_GCC_REGEXP) warn_about_non_apple_gcc(cc) if cc.match?(GNU_GCC_REGEXP)

View File

@ -165,7 +165,7 @@ class Pathname
open("a", *open_args) { |f| f.puts(content) } open("a", *open_args) { |f| f.puts(content) }
end end
# NOTE: This always overwrites. # @note This always overwrites.
def atomic_write(content) def atomic_write(content)
old_stat = stat if exist? old_stat = stat if exist?
File.atomic_write(self) do |file| File.atomic_write(self) do |file|

View File

@ -151,6 +151,7 @@ class Formula
attr_reader :revision attr_reader :revision
# Used to change version schemes for packages # Used to change version schemes for packages
# @see .version_scheme=
attr_reader :version_scheme attr_reader :version_scheme
# The current working directory during builds. # The current working directory during builds.
@ -357,34 +358,34 @@ class Formula
end end
# The description of the software. # The description of the software.
# @method desc # @!method desc
# @see .desc= # @see .desc=
delegate desc: :"self.class" delegate desc: :"self.class"
# The SPDX ID of the software license. # The SPDX ID of the software license.
# @method license # @!method license
# @see .license= # @see .license=
delegate license: :"self.class" delegate license: :"self.class"
# The homepage for the software. # The homepage for the software.
# @method homepage # @!method homepage
# @see .homepage= # @see .homepage=
delegate homepage: :"self.class" delegate homepage: :"self.class"
# The livecheck specification for the software. # The livecheck specification for the software.
# @method livecheck # @!method livecheck
# @see .livecheck= # @see .livecheck=
delegate livecheck: :"self.class" delegate livecheck: :"self.class"
# Is a livecheck specification defined for the software? # Is a livecheck specification defined for the software?
# @method livecheckable? # @!method livecheckable?
# @see .livecheckable? # @see .livecheckable?
delegate livecheckable?: :"self.class" delegate livecheckable?: :"self.class"
# The version for the currently active {SoftwareSpec}. # The version for the currently active {SoftwareSpec}.
# The version is autodetected from the URL and/or tag so only needs to be # The version is autodetected from the URL and/or tag so only needs to be
# declared if it cannot be autodetected correctly. # declared if it cannot be autodetected correctly.
# @method version # @!method version
# @see .version # @see .version
delegate version: :active_spec delegate version: :active_spec
@ -429,7 +430,7 @@ class Formula
# Additional downloads can be defined as {#resource}s. # Additional downloads can be defined as {#resource}s.
# {Resource#stage} will create a temporary directory and yield to a block. # {Resource#stage} will create a temporary directory and yield to a block.
# <pre>resource("additional_files").stage { bin.install "my/extra/tool" }</pre> # <pre>resource("additional_files").stage { bin.install "my/extra/tool" }</pre>
# @method resource # @!method resource
delegate resource: :active_spec delegate resource: :active_spec
# An old name for the formula # An old name for the formula
@ -452,7 +453,7 @@ class Formula
end end
# The {Resource}s for the currently active {SoftwareSpec}. # The {Resource}s for the currently active {SoftwareSpec}.
# @method resources # @!method resources
def_delegator :"active_spec.resources", :values, :resources def_delegator :"active_spec.resources", :values, :resources
# The {Dependency}s for the currently active {SoftwareSpec}. # The {Dependency}s for the currently active {SoftwareSpec}.
@ -483,7 +484,7 @@ class Formula
delegate deprecated_flags: :active_spec delegate deprecated_flags: :active_spec
# If a named option is defined for the currently active {SoftwareSpec}. # If a named option is defined for the currently active {SoftwareSpec}.
# @method option_defined? # @!method option_defined?
delegate option_defined?: :active_spec delegate option_defined?: :active_spec
# All the {.fails_with} for the currently active {SoftwareSpec}. # All the {.fails_with} for the currently active {SoftwareSpec}.
@ -1071,6 +1072,7 @@ class Formula
# 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.
# @see .keg_only
def keg_only? def keg_only?
return false unless keg_only_reason return false unless keg_only_reason
@ -1135,25 +1137,25 @@ class Formula
# Whether this {Formula} is deprecated (i.e. warns on installation). # Whether this {Formula} is deprecated (i.e. warns on installation).
# Defaults to false. # Defaults to false.
# @method deprecated? # @!method deprecated?
# @return [Boolean] # @return [Boolean]
delegate deprecated?: :"self.class" delegate deprecated?: :"self.class"
# The reason this {Formula} is deprecated. # The reason this {Formula} is deprecated.
# Returns `nil` if no reason is specified or the formula is not deprecated. # Returns `nil` if no reason is specified or the formula is not deprecated.
# @method deprecation_reason # @!method deprecation_reason
# @return [String, Symbol] # @return [String, Symbol]
delegate deprecation_reason: :"self.class" delegate deprecation_reason: :"self.class"
# Whether this {Formula} is disabled (i.e. cannot be installed). # Whether this {Formula} is disabled (i.e. cannot be installed).
# Defaults to false. # Defaults to false.
# @method disabled? # @!method disabled?
# @return [Boolean] # @return [Boolean]
delegate disabled?: :"self.class" delegate disabled?: :"self.class"
# The reason this {Formula} is disabled. # The reason this {Formula} is disabled.
# Returns `nil` if no reason is specified or the formula is not disabled. # Returns `nil` if no reason is specified or the formula is not disabled.
# @method disable_reason # @!method disable_reason
# @return [String, Symbol] # @return [String, Symbol]
delegate disable_reason: :"self.class" delegate disable_reason: :"self.class"
@ -2213,7 +2215,7 @@ class Formula
# @private # @private
attr_reader :keg_only_reason attr_reader :keg_only_reason
# @!attribute [w] # @!attribute [w] desc
# A one-line description of the software. Used by users to get an overview # A one-line description of the software. Used by users to get an overview
# of the software and Homebrew maintainers. # of the software and Homebrew maintainers.
# Shows when running `brew info`. # Shows when running `brew info`.
@ -2221,7 +2223,7 @@ class Formula
# <pre>desc "Example formula"</pre> # <pre>desc "Example formula"</pre>
attr_rw :desc attr_rw :desc
# @!attribute [w] # @!attribute [w] license
# The SPDX ID of the open-source license that the formula uses. # The SPDX ID of the open-source license that the formula uses.
# Shows when running `brew info`. # Shows when running `brew info`.
# Use `:any_of`, `:all_of` or `:with` to describe complex license expressions. # Use `:any_of`, `:all_of` or `:with` to describe complex license expressions.
@ -2776,7 +2778,7 @@ class Formula
end end
# The reason for deprecation of a {Formula}. # The reason for deprecation of a {Formula}.
# Returns `nil` if no reason was provided or the formula is not deprecated. # @return [nil] if no reason was provided or the formula is not deprecated.
# @return [String, Symbol] # @return [String, Symbol]
attr_reader :deprecation_reason attr_reader :deprecation_reason

View File

@ -356,9 +356,10 @@ module Formulary
# Return a Formula instance for the given rack. # Return a Formula instance for the given rack.
# It will auto resolve formula's spec when requested spec is nil # It will auto resolve formula's spec when requested spec is nil
# #
# The :alias_path option will be used if the formula is found not to be # @param spec when nil, will auto resolve the formula's spec.
# installed, and discarded if it is installed because the alias_path used # @param :alias_path will be used if the formula is found not to be
# to install the formula will be set instead. # installed, and discarded if it is installed because the `alias_path` used
# to install the formula will be set instead.
def self.from_rack(rack, spec = nil, alias_path: nil, force_bottle: false, flags: []) def self.from_rack(rack, spec = nil, alias_path: nil, force_bottle: false, flags: [])
kegs = rack.directory? ? rack.subdirs.map { |d| Keg.new(d) } : [] kegs = rack.directory? ? rack.subdirs.map { |d| Keg.new(d) } : []
keg = kegs.find(&:linked?) || kegs.find(&:optlinked?) || kegs.max_by(&:version) keg = kegs.find(&:linked?) || kegs.find(&:optlinked?) || kegs.max_by(&:version)
@ -378,8 +379,9 @@ module Formulary
false false
end end
# Return a Formula instance for the given keg. # Return a {Formula} instance for the given keg.
# It will auto resolve formula's spec when requested spec is nil #
# @param spec when nil, will auto resolve the formula's spec.
def self.from_keg(keg, spec = nil, alias_path: nil, force_bottle: false, flags: []) def self.from_keg(keg, spec = nil, alias_path: nil, force_bottle: false, flags: [])
tab = Tab.for_keg(keg) tab = Tab.for_keg(keg)
tap = tab.tap tap = tab.tap

View File

@ -181,7 +181,7 @@ class Keg
[all_required_kegs.to_a, all_dependents.sort] [all_required_kegs.to_a, all_dependents.sort]
end end
# if path is a file in a keg then this will return the containing Keg object # @param path if this is a file in a keg, returns the containing {Keg} object.
def self.for(path) def self.for(path)
original_path = path original_path = path
if original_path.exist? && (path = original_path.realpath) if original_path.exist? && (path = original_path.realpath)

View File

@ -216,7 +216,7 @@ class SoftwareSpec
end end
end end
# TODO # TODO: ?
def add_legacy_patches(list) def add_legacy_patches(list)
list = Patch.normalize_legacy_patches(list) list = Patch.normalize_legacy_patches(list)
list.each { |p| p.owner = self } list.each { |p| p.owner = self }

View File

@ -482,9 +482,9 @@ module Kernel
# system "echo $PATH" # system "echo $PATH"
# end</pre> # end</pre>
# #
# Note that this method is *not* thread-safe - other threads # @note This method is *not* thread-safe - other threads
# which happen to be scheduled during the block will also # which happen to be scheduled during the block will also
# see these environment variables. # see these environment variables.
def with_env(hash) def with_env(hash)
old_values = {} old_values = {}
begin begin

View File

@ -583,7 +583,8 @@ class Version
end end
end end
# A formula's [HEAD version](https://docs.brew.sh/Formula-Cookbook#unstable-versions-head). # A formula's HEAD version.
# @see https://docs.brew.sh/Formula-Cookbook#unstable-versions-head Unstable versions (head)
# #
# @api private # @api private
class HeadVersion < Version class HeadVersion < Version