Skip to content

Commit

Permalink
Allow "devel-only" formulae
Browse files Browse the repository at this point in the history
It seems only natural that this should be possible, or at the very
least, it should not result in calling methods on nil.
  • Loading branch information
jacknagel committed Apr 13, 2013
1 parent 563d8be commit f0b7f44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/formula.rb
Expand Up @@ -73,7 +73,8 @@ def determine_active_spec
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
Expand Down
11 changes: 11 additions & 0 deletions Library/Homebrew/test/test_formula_validation.rb
Expand Up @@ -59,6 +59,17 @@ def initialize; end
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
Expand Down

0 comments on commit f0b7f44

Please sign in to comment.