Skip to content
Snippets Groups Projects
Commit 7c83e3ff authored by Jack Nagel's avatar Jack Nagel
Browse files

Remove workarounds for destructuring single-element hashes

parent ec1727a1
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ class CompilerFailure
def self.create(spec, &block)
# Non-Apple compilers are in the format fails_with compiler => version
if spec.is_a?(Hash)
_, major_version = spec.each { |e| break e }
_, major_version = spec.first
name = "gcc-#{major_version}"
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
version = "#{major_version}.999"
......
......@@ -57,20 +57,12 @@ class DependencyCollector
end
def build(spec)
spec, tags = case spec
when Hash then destructure_spec_hash(spec)
else spec
end
spec, tags = Hash === spec ? spec.first : spec
parse_spec(spec, Array(tags))
end
private
def destructure_spec_hash(spec)
spec.each { |o| return o }
end
def parse_spec(spec, tags)
case spec
when String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment