diff options
| author | Jack Nagel | 2015-06-19 22:30:13 -0400 | 
|---|---|---|
| committer | Jack Nagel | 2015-06-19 22:30:13 -0400 | 
| commit | 7c83e3ffe38cdeb3287b275b202e2a1cdaab5bf8 (patch) | |
| tree | 753a9cce4854d362e880883c251cd07c0777e49e | |
| parent | ec1727a1bed5c431941972aeae064b6345e51321 (diff) | |
| download | brew-7c83e3ffe38cdeb3287b275b202e2a1cdaab5bf8.tar.bz2 | |
Remove workarounds for destructuring single-element hashes
| -rw-r--r-- | Library/Homebrew/compilers.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/dependency_collector.rb | 10 | 
2 files changed, 2 insertions, 10 deletions
| diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 25f09843e..a8bc945c2 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -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" diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index c9ccde7b9..5c62f2628 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -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 | 
