Merge pull request #6155 from core-code/master
Add configuration to new appcast check
This commit is contained in:
commit
c82496cf5c
@ -301,11 +301,16 @@ module Cask
|
||||
def check_appcast_contains_version
|
||||
return unless check_appcast?
|
||||
return if cask.appcast.to_s.empty?
|
||||
return if cask.appcast.configuration == :no_check
|
||||
|
||||
appcast_stanza = cask.appcast.to_s
|
||||
appcast_contents, = curl_output("--max-time", "5", appcast_stanza)
|
||||
appcast_contents, = curl_output("--location", "--max-time", "5", appcast_stanza)
|
||||
version_stanza = cask.version.to_s
|
||||
if cask.appcast.configuration.blank?
|
||||
adjusted_version_stanza = version_stanza.split(",")[0].split("-")[0].split("_")[0]
|
||||
else
|
||||
adjusted_version_stanza = cask.appcast.configuration
|
||||
end
|
||||
return if appcast_contents.include? adjusted_version_stanza
|
||||
|
||||
add_warning "appcast at URL '#{appcast_stanza}' does not contain"\
|
||||
|
||||
@ -3,11 +3,12 @@
|
||||
module Cask
|
||||
class DSL
|
||||
class Appcast
|
||||
attr_reader :uri, :parameters
|
||||
attr_reader :uri, :parameters, :configuration
|
||||
|
||||
def initialize(uri, **parameters)
|
||||
@uri = URI(uri)
|
||||
@parameters = parameters
|
||||
@configuration = parameters[:configuration] if parameters.key?(:configuration)
|
||||
end
|
||||
|
||||
def to_yaml
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user