From 9d030f83970f90d841494f0faf897e828e1ca33d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 16 Jun 2014 16:57:55 -0500 Subject: [PATCH] Combine conditionals --- Library/Homebrew/compilers.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 2d10074e10..e603220606 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -45,21 +45,16 @@ class CompilerFailure end def initialize compiler, &block + instance_eval(&block) if block_given? # Non-Apple compilers are in the format fails_with compiler => version if compiler.is_a? Hash # currently the only compiler for this case is GCC _, @major_version = compiler.first @compiler = 'gcc-' + @major_version - else - @compiler = compiler - end - - instance_eval(&block) if block_given? - - if compiler.is_a? Hash # so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible @version ||= @major_version + '.999' else + @compiler = compiler @version ||= 9999 @version = @version.to_i end