Skip to content

Commit

Permalink
Sparkle: Refactor macOS os strings into constant
Browse files Browse the repository at this point in the history
  • Loading branch information
samford committed Nov 16, 2023
1 parent 491e2c4 commit 75ce724
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Library/Homebrew/livecheck/strategy/sparkle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class Sparkle
# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://}i.freeze

# Common `os` values used in appcasts to refer to macOS.
APPCAST_MACOS_STRINGS = ["macos", "osx"].freeze

# Whether the strategy can be applied to the provided URL.
#
# @param url [String] the URL to match against
Expand Down Expand Up @@ -152,7 +155,7 @@ def self.items_from_content(content)
def self.filter_items(items)
items.select do |item|
# Omit items with an explicit `os` value that isn't macOS
next false if item.os && !((item.os == "osx") || (item.os == "macos"))
next false if item.os && APPCAST_MACOS_STRINGS.none?(item.os)

# Omit items for prerelease macOS versions
next false if item.minimum_system_version&.strip_patch&.prerelease?
Expand Down

0 comments on commit 75ce724

Please sign in to comment.