diff options
| author | Jack Nagel | 2013-09-13 11:13:12 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2013-09-13 11:13:12 -0500 | 
| commit | f7d3609ae3bdde6d4fa156b2876a4ad5e077777a (patch) | |
| tree | 1e905222155b8b38185892fe01427b5fc9340da3 /Library/Homebrew | |
| parent | 74542a5c5ce9a4c1143e769808b16abf077ec150 (diff) | |
| download | homebrew-f7d3609ae3bdde6d4fa156b2876a4ad5e077777a.tar.bz2 | |
head DSL can accept a block
Diffstat (limited to 'Library/Homebrew')
| -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  | 
