Minor documentation changes

This commit is contained in:
Mohammad Zain Abbas 2022-07-02 10:09:25 +02:00 committed by Nanda H Krishna
parent 7ab79e5423
commit f4197fc96e
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA
2 changed files with 15 additions and 13 deletions

View File

@ -1,9 +1,10 @@
# typed: true # typed: true
# frozen_string_literal: true # frozen_string_literal: true
# The {Livecheck} class implements the DSL methods used in a formula's or cask's # The {Livecheck} class implements the DSL methods used in a formula's, cask's
# `livecheck` block and stores related instance variables. Most of these methods # or resource's `livecheck` block and stores related instance variables. Most
# also return the related instance variable when no argument is provided. # of these methods also return the related instance variable when no argument
# is provided.
# #
# This information is used by the `brew livecheck` command to control its # This information is used by the `brew livecheck` command to control its
# behavior. Example `livecheck` blocks can be found in the # behavior. Example `livecheck` blocks can be found in the
@ -11,13 +12,13 @@
class Livecheck class Livecheck
extend Forwardable extend Forwardable
# A very brief description of why the formula/cask is skipped (e.g. `No longer # A very brief description of why the formula/cask/resource is skipped (e.g.
# developed or maintained`). # `No longer developed or maintained`).
# @return [String, nil] # @return [String, nil]
attr_reader :skip_msg attr_reader :skip_msg
def initialize(formula_or_cask) def initialize(package_or_resource)
@formula_or_cask = formula_or_cask @package_or_resource = package_or_resource
@referenced_cask_name = nil @referenced_cask_name = nil
@referenced_formula_name = nil @referenced_formula_name = nil
@regex = nil @regex = nil
@ -81,8 +82,9 @@ class Livecheck
# Sets the `@skip` instance variable to `true` and sets the `@skip_msg` # Sets the `@skip` instance variable to `true` and sets the `@skip_msg`
# instance variable if a `String` is provided. `@skip` is used to indicate # instance variable if a `String` is provided. `@skip` is used to indicate
# that the formula/cask should be skipped and the `skip_msg` very briefly # that the formula/cask/resource should be skipped and the `skip_msg` very
# describes why it is skipped (e.g. "No longer developed or maintained"). # briefly describes why it is skipped (e.g. "No longer developed or
# maintained").
# #
# @param skip_msg [String] string describing why the formula/cask is skipped # @param skip_msg [String] string describing why the formula/cask is skipped
# @return [Boolean] # @return [Boolean]
@ -96,7 +98,7 @@ class Livecheck
@skip = true @skip = true
end end
# Should `livecheck` skip this formula/cask? # Should `livecheck` skip this formula/cask/resource?
def skip? def skip?
@skip @skip
end end
@ -126,7 +128,7 @@ class Livecheck
# Sets the `@url` instance variable to the provided argument or returns the # Sets the `@url` instance variable to the provided argument or returns the
# `@url` instance variable when no argument is provided. The argument can be # `@url` instance variable when no argument is provided. The argument can be
# a `String` (a URL) or a supported `Symbol` corresponding to a URL in the # a `String` (a URL) or a supported `Symbol` corresponding to a URL in the
# formula/cask (e.g. `:stable`, `:homepage`, `:head`, `:url`). # formula/cask/resource (e.g. `:stable`, `:homepage`, `:head`, `:url`).
# @param val [String, Symbol] URL to check for version information # @param val [String, Symbol] URL to check for version information
# @return [String, nil] # @return [String, nil]
def url(val = nil) def url(val = nil)
@ -140,7 +142,7 @@ class Livecheck
end end
end end
delegate version: :@formula_or_cask delegate version: :@package_or_resource
private :version private :version
# Returns a `Hash` of all instance variable values. # Returns a `Hash` of all instance variable values.