commit 3707861465bc771315d850be4b3da9f111e414a4
parent 75f734585fe474a2dff22be76914abcd0f38ec78
Author: Ben Walton <bwalton@artsci.utoronto.ca>
Date: Mon, 25 Jan 2010 11:56:40 -0500
conditionally define Fixnum#ord
Ruby 1.8.5 was throwing exceptions from lib/sup/util.rb line 650 due
to calling .ord on a Fixnum. This patch defines Fixnum#ord if the
method doesn't exist already. Helps on old ruby version (1.8.5 here).
Signed-off-by: Ben Walton
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -366,6 +366,12 @@ class Fixnum
end
end
+ unless method_defined?(:ord)
+ def ord
+ self
+ end
+ end
+
## hacking the english language
def pluralize s
to_s + " " +