From 940b63cad321f51ae69fef74082e3f6268b3c769 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Tue, 16 May 2023 19:51:20 +0200 Subject: [PATCH] chore: rename GitHubRelease to GitHubReleases --- Library/Homebrew/livecheck/strategy/github_latest.rb | 8 ++++---- Library/Homebrew/livecheck/strategy/github_release.rb | 10 +++++----- .../test/livecheck/strategy/github_release_spec.rb | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy/github_latest.rb b/Library/Homebrew/livecheck/strategy/github_latest.rb index e315c651a8..bd743645a6 100644 --- a/Library/Homebrew/livecheck/strategy/github_latest.rb +++ b/Library/Homebrew/livecheck/strategy/github_latest.rb @@ -41,7 +41,7 @@ module Homebrew # @return [Boolean] sig { params(url: String).returns(T::Boolean) } def self.match?(url) - GitHubRelease.match?(url) + GitHubReleases.match?(url) end # Extracts information from a provided URL and uses it to generate @@ -55,7 +55,7 @@ module Homebrew def self.generate_input_values(url) values = {} - match = url.delete_suffix(".git").match(GitHubRelease::URL_MATCH_REGEX) + match = url.delete_suffix(".git").match(GitHubReleases::URL_MATCH_REGEX) return values if match.blank? values[:url] = "https://api.github.com/repos/#{match[:username]}/#{match[:repository]}/releases/latest" @@ -79,7 +79,7 @@ module Homebrew block: T.nilable(Proc), ).returns(T::Hash[Symbol, T.untyped]) } - def self.find_versions(url:, regex: GitHubRelease::DEFAULT_REGEX, **_unused, &block) + def self.find_versions(url:, regex: GitHubReleases::DEFAULT_REGEX, **_unused, &block) match_data = { matches: {}, regex: regex, url: url } generated = generate_input_values(url) @@ -88,7 +88,7 @@ module Homebrew match_data[:url] = generated[:url] release = GitHub.get_latest_release(generated[:username], generated[:repository]) - GitHubRelease.versions_from_content(release, regex, &block).each do |match_text| + GitHubReleases.versions_from_content(release, regex, &block).each do |match_text| match_data[:matches][match_text] = Version.new(match_text) end diff --git a/Library/Homebrew/livecheck/strategy/github_release.rb b/Library/Homebrew/livecheck/strategy/github_release.rb index dcf09194c1..2c69209680 100644 --- a/Library/Homebrew/livecheck/strategy/github_release.rb +++ b/Library/Homebrew/livecheck/strategy/github_release.rb @@ -4,7 +4,7 @@ module Homebrew module Livecheck module Strategy - # The {GithubRelease} strategy identifies versions of software at + # The {GithubReleases} strategy identifies versions of software at # github.com by checking a repository's recent releases using the # GitHub API. # @@ -14,7 +14,7 @@ module Homebrew # * `https://github.com/example/example/archive/v1.2.3.tar.gz` # * `https://github.com/downloads/example/example/example-1.2.3.tar.gz` # - # {GithubRelease} should only be used when the upstream repository has + # {GithubReleases} should only be used when the upstream repository has # releases for suitable versions and the strategy is necessary or # appropriate (e.g. the formula/cask uses a release asset and the # {GithubLatest} strategy isn't sufficient to identify the newest version. @@ -28,11 +28,11 @@ module Homebrew # etc.). # # @api public - class GithubRelease + class GithubReleases NICE_NAME = "GitHub - Releases" # A priority of zero causes livecheck to skip the strategy. We do this - # for {GithubRelease} so we can selectively apply the strategy using + # for {GithubReleases} so we can selectively apply the strategy using # `strategy :github_release` in a `livecheck` block. PRIORITY = 0 @@ -150,6 +150,6 @@ module Homebrew end end end - GitHubRelease = Homebrew::Livecheck::Strategy::GithubRelease + GitHubReleases = Homebrew::Livecheck::Strategy::GithubReleases end end diff --git a/Library/Homebrew/test/livecheck/strategy/github_release_spec.rb b/Library/Homebrew/test/livecheck/strategy/github_release_spec.rb index 7c6948501e..0f6895b588 100644 --- a/Library/Homebrew/test/livecheck/strategy/github_release_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/github_release_spec.rb @@ -2,7 +2,7 @@ require "livecheck/strategy" -describe Homebrew::Livecheck::Strategy::GithubRelease do +describe Homebrew::Livecheck::Strategy::GitHubReleases do subject(:github_release) { described_class } let(:github_urls) do