mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-11-27 03:19:46 -05:00
Ruby 1.8.6 doesn't have Symbol#to_proc, which allows things like
map(&:to_s) rather than map { |o| o.to_s }. 1.8.7 does, though, and
since it is used in a bunch of the superenv code we should attempt to
keep it compatible with 1.8.6.
Closes #16046.
6 lines
118 B
Ruby
6 lines
118 B
Ruby
class Symbol
|
|
def to_proc
|
|
proc { |obj, *args| obj.send(self, *args) }
|
|
end unless method_defined?(:to_proc)
|
|
end
|