Modify comments and other text

The `check_for_resources` code arguably speaks for itself, so it
doesn't feel like a necessary addition. Besides that, this cleans up
some other comments and text to better align with existing examples.
This commit is contained in:
Sam Ford 2022-09-27 00:18:20 -04:00
parent a81ef89883
commit 40b0070beb
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D
3 changed files with 4 additions and 6 deletions

View File

@ -286,8 +286,6 @@ module Homebrew
version_info[:latest] if version_info.present?
end
# Check current and latest resources (if "--resources" flag is given)
# Only check current and latest versions if we have resources to check against
check_for_resources = check_resources && formula_or_cask.is_a?(Formula) && formula_or_cask.resources.present?
if check_for_resources
resource_version_info = formula_or_cask.resources.map do |resource|
@ -531,7 +529,7 @@ module Homebrew
end
end
# Returns an Array containing the formula/resource/cask URLs that can be used by livecheck.
# Returns an Array containing the formula/cask/resource URLs that can be used by livecheck.
sig { params(package_or_resource: T.any(Formula, Cask::Cask, Resource)).returns(T::Array[String]) }
def checkable_urls(package_or_resource)
urls = []

View File

@ -172,7 +172,7 @@ module Homebrew
:cask_url_unversioned,
].freeze
# Skip conditions for resource.
# Skip conditions for resources.
RESOURCE_CHECKS = [
:package_or_resource_skip,
].freeze

View File

@ -152,11 +152,11 @@ describe Homebrew::Livecheck do
RUBY
end
it "returns a URL string when given a livecheck_url string for formula" do
it "returns a URL string when given a livecheck_url string for a formula" do
expect(livecheck.livecheck_url_to_string(livecheck_url, f_livecheck_url)).to eq(livecheck_url)
end
it "returns a URL string when given a livecheck_url string for resource" do
it "returns a URL string when given a livecheck_url string for a resource" do
expect(livecheck.livecheck_url_to_string(livecheck_url, r_livecheck_url)).to eq(livecheck_url)
end