Cask: rename appcast configuration to must_contain
This commit is contained in:
parent
731c723c4a
commit
8961ef40d5
@ -303,16 +303,16 @@ module Cask
|
|||||||
def check_appcast_contains_version
|
def check_appcast_contains_version
|
||||||
return unless check_appcast?
|
return unless check_appcast?
|
||||||
return if cask.appcast.to_s.empty?
|
return if cask.appcast.to_s.empty?
|
||||||
return if cask.appcast.configuration == :no_check
|
return if cask.appcast.must_contain == :no_check
|
||||||
|
|
||||||
appcast_stanza = cask.appcast.to_s
|
appcast_stanza = cask.appcast.to_s
|
||||||
appcast_contents, = curl_output("--compressed", "--user-agent", HOMEBREW_USER_AGENT_FAKE_SAFARI, "--location",
|
appcast_contents, = curl_output("--compressed", "--user-agent", HOMEBREW_USER_AGENT_FAKE_SAFARI, "--location",
|
||||||
"--globoff", "--max-time", "5", appcast_stanza)
|
"--globoff", "--max-time", "5", appcast_stanza)
|
||||||
version_stanza = cask.version.to_s
|
version_stanza = cask.version.to_s
|
||||||
adjusted_version_stanza = if cask.appcast.configuration.blank?
|
adjusted_version_stanza = if cask.appcast.must_contain.blank?
|
||||||
version_stanza.split(",")[0].split("-")[0].split("_")[0]
|
version_stanza.split(",")[0].split("-")[0].split("_")[0]
|
||||||
else
|
else
|
||||||
cask.appcast.configuration
|
cask.appcast.must_contain
|
||||||
end
|
end
|
||||||
return if appcast_contents.include? adjusted_version_stanza
|
return if appcast_contents.include? adjusted_version_stanza
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
module Cask
|
module Cask
|
||||||
class DSL
|
class DSL
|
||||||
class Appcast
|
class Appcast
|
||||||
attr_reader :uri, :parameters, :configuration
|
attr_reader :uri, :parameters, :must_contain
|
||||||
|
|
||||||
def initialize(uri, **parameters)
|
def initialize(uri, **parameters)
|
||||||
@uri = URI(uri)
|
@uri = URI(uri)
|
||||||
@parameters = parameters
|
@parameters = parameters
|
||||||
@configuration = parameters[:configuration] if parameters.key?(:configuration)
|
@must_contain = parameters[:must_contain] if parameters.key?(:must_contain)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_yaml
|
def to_yaml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user