From e96f1d48d68a59d6b4e6009229d3cbd9ab54aa81 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sat, 27 Mar 2004 16:04:40 +0000 Subject: - Runtime fixes for ruby-1.8 - Raise PORTREVISION PR: ports/64782, ports/64789 Submitted by: David Bushong (maintainer) --- irc/rbot/files/patch-math | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 irc/rbot/files/patch-math (limited to 'irc/rbot/files/patch-math') diff --git a/irc/rbot/files/patch-math b/irc/rbot/files/patch-math new file mode 100644 index 000000000000..87dd66063e2c --- /dev/null +++ b/irc/rbot/files/patch-math @@ -0,0 +1,28 @@ +--- rbot/plugins/math.rb.orig Thu Mar 25 17:33:36 2004 ++++ rbot/plugins/math.rb Mon Jan 27 11:52:37 2003 +@@ -77,13 +77,13 @@ + expr.gsub!(/\bover /, "/ ") + expr.gsub!(/\bsquared/, "**2 ") + expr.gsub!(/\bcubed/, "**3 ") +- expr.gsub!(/\bto\s+(\d+)(r?st|nd|rd|th)?( power)?/, "**#$1 ") ++ expr.gsub!(/\bto\s+(\d+)(r?st|nd|rd|th)?( power)?/, '**\1 ') + expr.gsub!(/\bpercent of/, "*0.01*") + expr.gsub!(/\bpercent/, "*0.01") + expr.gsub!(/\% of\b/, "*0.01*") + expr.gsub!(/\%/, "*0.01") +- expr.gsub!(/\bsquare root of (\d+)/, "#$1 ** 0.5 ") +- expr.gsub!(/\bcubed? root of (\d+)/, "#$1 **(1.0/3.0) ") ++ expr.gsub!(/\bsquare root of (\d+)/, '\1 ** 0.5 ') ++ expr.gsub!(/\bcubed? root of (\d+)/, '\1 **(1.0/3.0) ') + expr.gsub!(/ of /, " * ") + expr.gsub!(/(bit(-| )?)?xor(\'?e?d( with))?/, "^") + expr.gsub!(/(bit(-| )?)?or(\'?e?d( with))?/, "|") +@@ -101,7 +101,7 @@ + if answer =~ /^[-+\de\.]+$/ + answer = sprintf("%1.12f", answer) + answer.gsub!(/\.?0+$/, "") +- answer.gsub!(/(\.\d+)000\d+/, $1) ++ answer.gsub!(/(\.\d+)000\d+/, '\1') + if (answer.length > 30) + answer = "a number with >30 digits..." + end -- cgit v1.2.3