aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorJack Nagel2013-09-13 11:13:12 -0500
committerJack Nagel2013-09-13 11:13:12 -0500
commitf7d3609ae3bdde6d4fa156b2876a4ad5e077777a (patch)
tree1e905222155b8b38185892fe01427b5fc9340da3 /Library/Homebrew/formula.rb
parent74542a5c5ce9a4c1143e769808b16abf077ec150 (diff)
downloadhomebrew-f7d3609ae3bdde6d4fa156b2876a4ad5e077777a.tar.bz2
head DSL can accept a block
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 484ee429b..739322191 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -695,10 +695,16 @@ class Formula
@devel.instance_eval(&block)
end
- def head val=nil, specs={}
- return @head if val.nil?
- @head ||= HeadSoftwareSpec.new
- @head.url(val, specs)
+ def head val=nil, specs={}, &block
+ if block_given?
+ @head ||= HeadSoftwareSpec.new
+ @head.instance_eval(&block)
+ elsif val
+ @head ||= HeadSoftwareSpec.new
+ @head.url(val, specs)
+ else
+ @head
+ end
end
def version val=nil