diff --git a/lib/cask/dsl.rb b/lib/cask/dsl.rb index 0490b66dc5f99..4c463f2e6bbc6 100644 --- a/lib/cask/dsl.rb +++ b/lib/cask/dsl.rb @@ -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 @@ -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") diff --git a/lib/cask/utils.rb b/lib/cask/utils.rb index 73e0cf485badf..dfdefbdb2f5d2 100644 --- a/lib/cask/utils.rb +++ b/lib/cask/utils.rb @@ -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