diff options
Diffstat (limited to 'lib/racc/compat.rb')
-rw-r--r-- | lib/racc/compat.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/racc/compat.rb b/lib/racc/compat.rb new file mode 100644 index 0000000000..ccb033e2e0 --- /dev/null +++ b/lib/racc/compat.rb @@ -0,0 +1,32 @@ +# +# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $ +# +# Copyright (c) 1999-2006 Minero Aoki +# +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU LGPL, Lesser General Public License version 2.1. +# For details of the GNU LGPL, see the file "COPYING". +# + +unless Object.method_defined?(:__send) + class Object + alias __send __send__ + end +end + +unless Object.method_defined?(:__send!) + class Object + alias __send! __send__ + end +end + +unless Array.method_defined?(:map!) + class Array + if Array.method_defined?(:collect!) + alias map! collect! + else + alias map! filter + end + end +end |