diff options
| author | Jack Nagel | 2014-09-18 15:50:54 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-09-18 15:50:54 -0500 | 
| commit | ae88549797c01283e8cb1599863a7614a165016c (patch) | |
| tree | b2dec8eec9e30e088ab7aa4b41471399afebf5e3 /Library/Homebrew/compilers.rb | |
| parent | 84352d2728eb90dcb321955424acd088a9702d5d (diff) | |
| download | brew-ae88549797c01283e8cb1599863a7614a165016c.tar.bz2 | |
Remove fails_with? from the formula instance
Diffstat (limited to 'Library/Homebrew/compilers.rb')
| -rw-r--r-- | Library/Homebrew/compilers.rb | 15 | 
1 files changed, 11 insertions, 4 deletions
| diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 7080f69e7..b445213ec 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -99,8 +99,11 @@ class CompilerQueue  end  class CompilerSelector -  def initialize(f, versions=MacOS) -    @f = f +  attr_reader :formula + +  def initialize(formula, versions=MacOS) +    @formula = formula +    @failures = formula.compiler_failures      @versions = versions      @compilers = CompilerQueue.new      %w{clang llvm gcc gcc_4_0}.map(&:to_sym).each do |cc| @@ -125,13 +128,17 @@ class CompilerSelector    # if none can be found raises CompilerError instead    def compiler      while cc = @compilers.pop -      return cc.name unless @f.fails_with?(cc) +      return cc.name unless fails_with?(cc)      end -    raise CompilerSelectionError.new(@f) +    raise CompilerSelectionError.new(formula)    end    private +  def fails_with?(compiler) +    @failures.any? { |failure| failure === compiler } +  end +    def priority_for(cc)      case cc      when :clang   then @versions.clang_build_version >= 318 ? 3 : 0.5 | 
