diff options
| author | Jack Nagel | 2014-08-03 13:12:59 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-08-03 13:14:50 -0500 | 
| commit | eb528fd7cd01baac4fb0bcdf13ab2c0ab8f6c568 (patch) | |
| tree | 12f0fa1d8adac2bdbd2480c1b921ee64c183b754 /Library | |
| parent | d54bce6a1af251a32f759e2017e0f4d1bc8d8c53 (diff) | |
| download | brew-eb528fd7cd01baac4fb0bcdf13ab2c0ab8f6c568.tar.bz2 | |
Eliminate a nil check
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/compilers.rb | 13 | 
1 files changed, 11 insertions, 2 deletions
| diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 95faa4415..93c52c343 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -3,7 +3,16 @@ module CompilerConstants    GNU_GCC_REGEXP = /^gcc-(4\.[3-9])$/  end -Compiler = Struct.new(:name, :version, :priority) +# TODO make this class private to CompilerSelector +class Compiler +  attr_reader :name, :version, :priority + +  def initialize(name, version=0, priority=0) +    @name = name +    @version = version +    @priority = priority +  end +end  class CompilerFailure    attr_reader :name @@ -40,7 +49,7 @@ class CompilerFailure    end    def ===(compiler) -    name == compiler.name && version >= (compiler.version || 0) +    name == compiler.name && version >= compiler.version    end    MESSAGES = { | 
