From 4bd34c9624ac93885dd7216f45eeb07caf8b6822 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 13 Apr 2013 17:40:13 -0500 Subject: [PATCH] Allow "devel-only" formulae It seems only natural that this should be possible, or at the very least, it should not result in calling methods on nil. --- Library/Homebrew/formula.rb | 3 ++- Library/Homebrew/test/test_formula_validation.rb | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index eddacf08dd..cf7b50e555 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -73,7 +73,8 @@ class Formula when @head && ARGV.build_head? then @head # --HEAD when @devel && ARGV.build_devel? then @devel # --devel when @bottle && install_bottle?(self) then @bottle # bottle available - when @stable.nil? && @head then @head # head-only + when @devel && @stable.nil? then @devel # devel-only + when @head && @stable.nil? then @head # head-only else @stable end end diff --git a/Library/Homebrew/test/test_formula_validation.rb b/Library/Homebrew/test/test_formula_validation.rb index be4c38c641..5c6bf28884 100644 --- a/Library/Homebrew/test/test_formula_validation.rb +++ b/Library/Homebrew/test/test_formula_validation.rb @@ -59,6 +59,17 @@ class FormulaValidationTests < Test::Unit::TestCase end end + def test_devel_only_valid + assert_nothing_raised do + formula do + devel do + url "foo" + version "1.0" + end + end + end + end + def test_head_only_valid assert_nothing_raised do formula do