aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2014-03-08 10:37:58 -0800
committerMisty De Meo2014-03-08 10:37:58 -0800
commited73b2dd562746eb79632dc6f4b5825467f264c1 (patch)
treef8e6267379dd31d27de992d6d8c998ca489988b9 /Library
parentd17bc0b3e3064ba849da5fa448d7bbdcda029c9a (diff)
downloadhomebrew-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')
-rw-r--r--Library/Homebrew/extend/symbol.rb2
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