diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 484ee429b2..7393221919 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