diff options
| author | Jack Nagel | 2013-09-13 11:13:12 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-13 11:13:12 -0500 |
| commit | 320356236dfcb5517bd8f8ebd5d2e3a47252b671 (patch) | |
| tree | cf86ccdc69479a02c2f73c2bf2d0191055ca37a4 | |
| parent | f2ebc0e32546146f6a4773c8386b3e19df1f784e (diff) | |
| download | brew-320356236dfcb5517bd8f8ebd5d2e3a47252b671.tar.bz2 | |
head DSL can accept a block
| -rw-r--r-- | Library/Homebrew/formula.rb | 14 |
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 |
