Skip to content

Commit

Permalink
add optional appcast stanza to DSL
Browse files Browse the repository at this point in the history
Appcasts are a standard way for applications to publish
information about available updates via RSS.  Sparkle and
other update frameworks are built upon appcasts.

In a quick test, appcasts were found for 188/360 Casks examined.

This PR adds an optional `appcast` stanza, but does not add
`appcast` to any Cask or make use of the info in any way.  It is
intentionally left undocumented.
  • Loading branch information
rolandwalker committed Feb 23, 2014
1 parent e7debe8 commit fe2ff07
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def homepage; self.class.homepage; end

def url; self.class.url; end

def appcast; self.class.appcast; end

def version; self.class.version; end

def depends_on_formula; self.class.depends_on_formula; end
Expand Down Expand Up @@ -37,6 +39,15 @@ def url(*args)
end
end

def appcast(*args)
if @appcast and !args.empty?
raise CaskInvalidError.new(self.title, "'appcast' stanza may only appear once")
end
@appcast ||= begin
Cask::UnderscoreSupportingURI.parse(*args) unless args.empty?
end
end

def version(version=nil)
if @version and !version.nil?
raise CaskInvalidError.new(self.title, "'version' stanza may only appear once")
Expand Down
11 changes: 10 additions & 1 deletion lib/cask/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ def odumpcask cask
if Cask.respond_to?(:debug) and Cask.debug
odebug "Cask instance dumps in YAML:"
odebug "Cask instance toplevel:", cask.to_yaml
[:homepage, :url, :version, :sums, :artifacts, :caveats, :depends_on_formula].each do |method|
[
:homepage,
:url,
:appcast,
:version,
:sums,
:artifacts,
:caveats,
:depends_on_formula,
].each do |method|
odebug "Cask instance method '#{method}':", cask.send(method).to_yaml
end
end
Expand Down

0 comments on commit fe2ff07

Please sign in to comment.