Expand documentation comments

This commit is contained in:
Sam Ford 2022-06-09 15:38:02 -04:00
parent 590aabe9d7
commit d600b662e2
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D
3 changed files with 17 additions and 7 deletions

View File

@ -4,8 +4,8 @@
module Homebrew module Homebrew
module Livecheck module Livecheck
module Strategy module Strategy
# The {ElectronBuilder} strategy fetches content at a URL and parses # The {ElectronBuilder} strategy fetches content at a URL and parses it
# it as an electron-builder appcast in YAML format. # as an electron-builder appcast in YAML format.
# #
# This strategy is not applied automatically and it's necessary to use # This strategy is not applied automatically and it's necessary to use
# `strategy :electron_builder` in a `livecheck` block to apply it. # `strategy :electron_builder` in a `livecheck` block to apply it.
@ -35,6 +35,7 @@ module Homebrew
# Parses YAML text and identifies versions in it. # Parses YAML text and identifies versions in it.
# #
# @param content [String] the YAML text to parse and check # @param content [String] the YAML text to parse and check
# @param regex [Regexp, nil] a regex for use in a strategy block
# @return [Array] # @return [Array]
sig { sig {
params( params(

View File

@ -58,6 +58,7 @@ module Homebrew
# {UnversionedCaskChecker} version information. # {UnversionedCaskChecker} version information.
# #
# @param items [Hash] a hash of `Item`s containing version information # @param items [Hash] a hash of `Item`s containing version information
# @param regex [Regexp, nil] a regex for use in a strategy block
# @return [Array] # @return [Array]
sig { sig {
params( params(
@ -81,6 +82,7 @@ module Homebrew
# versions from `plist` files. # versions from `plist` files.
# #
# @param cask [Cask::Cask] the cask to check for version information # @param cask [Cask::Cask] the cask to check for version information
# @param regex [Regexp, nil] a regex for use in a strategy block
# @return [Hash] # @return [Hash]
sig { sig {
params( params(

View File

@ -6,8 +6,8 @@ require "bundle_version"
module Homebrew module Homebrew
module Livecheck module Livecheck
module Strategy module Strategy
# The {Sparkle} strategy fetches content at a URL and parses # The {Sparkle} strategy fetches content at a URL and parses it as a
# it as a Sparkle appcast in XML format. # Sparkle appcast in XML format.
# #
# This strategy is not applied automatically and it's necessary to use # This strategy is not applied automatically and it's necessary to use
# `strategy :sparkle` in a `livecheck` block to apply it. # `strategy :sparkle` in a `livecheck` block to apply it.
@ -60,7 +60,7 @@ module Homebrew
delegate nice_version: :bundle_version delegate nice_version: :bundle_version
end end
# Identify version information from a Sparkle appcast. # Identifies version information from a Sparkle appcast.
# #
# @param content [String] the text of the Sparkle appcast # @param content [String] the text of the Sparkle appcast
# @return [Item, nil] # @return [Item, nil]
@ -152,9 +152,12 @@ module Homebrew
end.compact end.compact
end end
# Identify versions from content # Uses `#items_from_content` to identify versions from the Sparkle
# appcast content or, if a block is provided, passes the content to
# the block to handle matching.
# #
# @param content [String] the content to pull version information from # @param content [String] the content to check
# @param regex [Regexp, nil] a regex for use in a strategy block
# @return [Array] # @return [Array]
sig { sig {
params( params(
@ -186,6 +189,10 @@ module Homebrew
end end
# Checks the content at the URL for new versions. # Checks the content at the URL for new versions.
#
# @param url [String] the URL of the content to check
# @param regex [Regexp, nil] a regex for use in a strategy block
# @return [Hash]
sig { sig {
params( params(
url: String, url: String,