Don't use Hash#first

Fixes Homebrew/homebrew#31360.
This commit is contained in:
Jack Nagel 2014-08-06 09:56:09 -05:00
parent ed5eef82a8
commit 1eecf1ac0b

View File

@ -31,7 +31,7 @@ class CompilerFailure
def self.create(spec, &block) def self.create(spec, &block)
# Non-Apple compilers are in the format fails_with compiler => version # Non-Apple compilers are in the format fails_with compiler => version
if spec.is_a?(Hash) if spec.is_a?(Hash)
_, major_version = spec.first _, major_version = spec.each { |e| break e }
name = "gcc-#{major_version}" name = "gcc-#{major_version}"
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible # so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
version = "#{major_version}.999" version = "#{major_version}.999"