From d600b662e255291232efa10c38d973697eea2dde Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:38:02 -0400 Subject: [PATCH] Expand documentation comments --- .../livecheck/strategy/electron_builder.rb | 5 +++-- .../livecheck/strategy/extract_plist.rb | 2 ++ Library/Homebrew/livecheck/strategy/sparkle.rb | 17 ++++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy/electron_builder.rb b/Library/Homebrew/livecheck/strategy/electron_builder.rb index 4b8bdc3273..3d0a4c7437 100644 --- a/Library/Homebrew/livecheck/strategy/electron_builder.rb +++ b/Library/Homebrew/livecheck/strategy/electron_builder.rb @@ -4,8 +4,8 @@ module Homebrew module Livecheck module Strategy - # The {ElectronBuilder} strategy fetches content at a URL and parses - # it as an electron-builder appcast in YAML format. + # The {ElectronBuilder} strategy fetches content at a URL and parses it + # as an electron-builder appcast in YAML format. # # This strategy is not applied automatically and it's necessary to use # `strategy :electron_builder` in a `livecheck` block to apply it. @@ -35,6 +35,7 @@ module Homebrew # Parses YAML text and identifies versions in it. # # @param content [String] the YAML text to parse and check + # @param regex [Regexp, nil] a regex for use in a strategy block # @return [Array] sig { params( diff --git a/Library/Homebrew/livecheck/strategy/extract_plist.rb b/Library/Homebrew/livecheck/strategy/extract_plist.rb index a1593fb840..0bf114f63d 100644 --- a/Library/Homebrew/livecheck/strategy/extract_plist.rb +++ b/Library/Homebrew/livecheck/strategy/extract_plist.rb @@ -58,6 +58,7 @@ module Homebrew # {UnversionedCaskChecker} 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] sig { params( @@ -81,6 +82,7 @@ module Homebrew # versions from `plist` files. # # @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] sig { params( diff --git a/Library/Homebrew/livecheck/strategy/sparkle.rb b/Library/Homebrew/livecheck/strategy/sparkle.rb index 26df689d4d..bddb6bc8ef 100644 --- a/Library/Homebrew/livecheck/strategy/sparkle.rb +++ b/Library/Homebrew/livecheck/strategy/sparkle.rb @@ -6,8 +6,8 @@ require "bundle_version" module Homebrew module Livecheck module Strategy - # The {Sparkle} strategy fetches content at a URL and parses - # it as a Sparkle appcast in XML format. + # The {Sparkle} strategy fetches content at a URL and parses it as a + # Sparkle appcast in XML format. # # This strategy is not applied automatically and it's necessary to use # `strategy :sparkle` in a `livecheck` block to apply it. @@ -60,7 +60,7 @@ module Homebrew delegate nice_version: :bundle_version end - # Identify version information from a Sparkle appcast. + # Identifies version information from a Sparkle appcast. # # @param content [String] the text of the Sparkle appcast # @return [Item, nil] @@ -152,9 +152,12 @@ module Homebrew end.compact 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] sig { params( @@ -186,6 +189,10 @@ module Homebrew end # 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 { params( url: String,