Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional appcast stanza to DSL #3105

Merged
merged 1 commit into from
Feb 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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