Remove :appcast and rename :cask_url to :url.

This commit is contained in:
Markus Reiter 2020-12-25 00:48:54 +01:00
parent 8ac02c9b09
commit 7f633cce8c

View File

@ -87,16 +87,14 @@ 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`, `:head`, `:cask_url`, `:appcast`). # formula/cask (e.g. `:stable`, `:homepage`, `:head`, `:url`).
# @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)
@url = case val @url = case val
when nil when nil
return @url return @url
when :appcast when :url
@formula_or_cask.appcast.to_s
when :cask_url
@formula_or_cask.url.to_s @formula_or_cask.url.to_s
when :head, :stable when :head, :stable
@formula_or_cask.send(val).url @formula_or_cask.send(val).url