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
commit53a25584730eee0de460b05cafd12d3ac8910f35 (patch)
tree7fe15630d3b296de1de48ffc88076e47ef567e56 /Library
parent9850e84f3bebea139d4b8bec4b8496955fc06ef2 (diff)
downloadbrew-53a25584730eee0de460b05cafd12d3ac8910f35.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