Remove workarounds for destructuring single-element hashes
This commit is contained in:
parent
ec1727a1be
commit
7c83e3ffe3
@ -32,7 +32,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.each { |e| break e }
|
_, major_version = spec.first
|
||||||
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"
|
||||||
|
|||||||
@ -57,20 +57,12 @@ class DependencyCollector
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build(spec)
|
def build(spec)
|
||||||
spec, tags = case spec
|
spec, tags = Hash === spec ? spec.first : spec
|
||||||
when Hash then destructure_spec_hash(spec)
|
|
||||||
else spec
|
|
||||||
end
|
|
||||||
|
|
||||||
parse_spec(spec, Array(tags))
|
parse_spec(spec, Array(tags))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def destructure_spec_hash(spec)
|
|
||||||
spec.each { |o| return o }
|
|
||||||
end
|
|
||||||
|
|
||||||
def parse_spec(spec, tags)
|
def parse_spec(spec, tags)
|
||||||
case spec
|
case spec
|
||||||
when String
|
when String
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user