diff options
| author | Misty De Meo | 2014-03-08 10:37:58 -0800 |
|---|---|---|
| committer | Misty De Meo | 2014-03-08 10:37:58 -0800 |
| commit | ed73b2dd562746eb79632dc6f4b5825467f264c1 (patch) | |
| tree | f8e6267379dd31d27de992d6d8c998ca489988b9 /Library/Homebrew | |
| parent | d17bc0b3e3064ba849da5fa448d7bbdcda029c9a (diff) | |
| download | homebrew-ed73b2dd562746eb79632dc6f4b5825467f264c1.tar.bz2 | |
Symbol#to_proc: fix with arrays of arrays
Previously, with nested arrays, the Symbol#to_proc would iterate over
the first item in the nested array instead of the array itself, e.g.:
[[1,2], [3,4]].map(&:first) #=>
NoMethodError: undefined method `first' for 1:Fixnum
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/symbol.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/symbol.rb b/Library/Homebrew/extend/symbol.rb index 75a17b5ad..18ccb3147 100644 --- a/Library/Homebrew/extend/symbol.rb +++ b/Library/Homebrew/extend/symbol.rb @@ -1,5 +1,5 @@ class Symbol def to_proc - proc { |obj, *args| obj.send(self, *args) } + proc { |*args| args.shift.send(self, *args) } end unless method_defined?(:to_proc) end |
