Fix :cask_url and allow :appcast

This commit is contained in:
Seeker 2020-09-02 12:39:30 -07:00 committed by Sam Ford
parent 6794a78087
commit 0a766350b5
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

@ -81,8 +81,7 @@ class Livecheck
# Sets the `@url` instance variable to the provided argument or returns the # Sets the `@url` instance variable to the provided argument or returns the
# `@url` instance variable when no argument is provided. The argument can be # `@url` instance variable when no argument is provided. The argument can be
# a `String` (a URL) or a supported `Symbol` corresponding to a URL in the # a `String` (a URL) or a supported `Symbol` corresponding to a URL in the
# formula/cask (e.g. `:stable`, `:homepage`, or `:head`). # formula/cask (e.g. `:stable`, `:homepage`, `:head`, `:cask_url`, `:appcast`).
#
# @param val [String, Symbol] URL to check for version information # @param val [String, Symbol] URL to check for version information
# @return [String, nil] # @return [String, nil]
def url(val = nil) def url(val = nil)
@ -90,7 +89,9 @@ class Livecheck
when nil when nil
return @url return @url
when :cask_url when :cask_url
@formula_or_cask.url @formula_or_cask.url.to_s
when :appcast
@formula_or_cask.appcast.to_s
when :head, :stable when :head, :stable
@formula_or_cask.send(val).url @formula_or_cask.send(val).url
when :homepage when :homepage