diff options
| author | Misty De Meo | 2016-11-14 13:44:03 -0800 | 
|---|---|---|
| committer | GitHub | 2016-11-14 13:44:03 -0800 | 
| commit | 30fdbe089b6a7d91dd12132b46436f90dad60c88 (patch) | |
| tree | e6795dfbc3549722dfb536d5c1503776ea5e0d0d /Library/Homebrew/compilers.rb | |
| parent | 3a01fbadcd14fb180635d6464f2c600a738d50b5 (diff) | |
| parent | c7be025229dbbe86d85982a135c75b04c9ba00f2 (diff) | |
| download | brew-30fdbe089b6a7d91dd12132b46436f90dad60c88.tar.bz2 | |
Merge pull request #1435 from mistydemeo/dev_tools_version
Add "null version" class, and return compiler versions/build versions as Version objects
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 6c3971984..fdfcab817 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -14,7 +14,14 @@ end  class CompilerFailure    attr_reader :name -  attr_rw :version + +  def version(val = nil) +    if val +      @version = Version.parse(val.to_s) +    else +      @version +    end +  end    # Allows Apple compiler `fails_with` statements to keep using `build`    # even though `build` and `version` are the same internally @@ -45,7 +52,7 @@ class CompilerFailure    def initialize(name, version, &block)      @name = name -    @version = version +    @version = Version.parse(version.to_s)      instance_eval(&block) if block_given?    end @@ -115,13 +122,13 @@ class CompilerSelector          GNU_GCC_VERSIONS.reverse_each do |v|            name = "gcc-#{v}"            version = compiler_version(name) -          yield Compiler.new(name, version) if version +          yield Compiler.new(name, version) unless version.null?          end        when :llvm          next # no-op. DSL supported, compiler is not.        else          version = compiler_version(compiler) -        yield Compiler.new(compiler, version) if version +        yield Compiler.new(compiler, version) unless version.null?        end      end    end | 
