summaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2000-08-20 20:34:40 +0000
committerknu <knu@FreeBSD.org>2000-08-20 20:34:40 +0000
commit8468edbb89c709df4f81bcdb2cf1df6c39765817 (patch)
treea214fd1f80e3e142fa99945af7bde2ef0aa64e53 /lang
parent19c897e8feb7021a4d0b743e25da0013ea38d541 (diff)
downloadFreeBSD-ports-8468edbb89c709df4f81bcdb2cf1df6c39765817.zip
FreeBSD-ports-8468edbb89c709df4f81bcdb2cf1df6c39765817.tar.gz
Patch cgi-lib.rb to follow the disuse of Class::module_functions.
Approved by: MAINTAINER
Diffstat (limited to 'lang')
-rw-r--r--lang/ruby14/files/patch-cgi-lib.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/lang/ruby14/files/patch-cgi-lib.rb b/lang/ruby14/files/patch-cgi-lib.rb
new file mode 100644
index 0000000..00f83e8
--- /dev/null
+++ b/lang/ruby14/files/patch-cgi-lib.rb
@@ -0,0 +1,50 @@
+--- lib/cgi-lib.rb.orig Tue Oct 12 18:11:29 1999
++++ lib/cgi-lib.rb Mon Aug 21 04:26:56 2000
+@@ -121,30 +121,40 @@
+ RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ]
+
+ # make rfc1123 date string
+- def rfc1123_date(time)
++ def CGI.rfc1123_date(time)
+ t = time.clone.gmtime
+ return format("%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
+ RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year,
+ t.hour, t.min, t.sec)
+ end
++ def rfc1123_date(time)
++ CGI.rfc1123_date(time)
++ end
+
+ # escape url encode
+- def escape(str)
++ def CGI.escape(str)
+ str.gsub(/[^a-zA-Z0-9_\-.]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }
+ end
++ def escape(str)
++ CGI.escape(str)
++ end
+
+ # unescape url encoded
+- def unescape(str)
++ def CGI.unescape(str)
+ str.gsub(/\+/, ' ').gsub(/%([0-9a-fA-F]{2})/){ [$1.hex].pack("c") }
+ end
++ def unescape(str)
++ CGI.unescape(str)
++ end
+
+ # escape HTML
+- def escapeHTML(str)
++ def CGI.escapeHTML(str)
+ str.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
+ end
+-
+- module_function :escape, :unescape, :escapeHTML, :rfc1123_date
+-
++ def escapeHTML(str)
++ CGI.escapeHTML(str)
++ end
++
+ # offline mode. read name=value pairs on standard input.
+ def read_from_cmdline
+ require "shellwords.rb"
OpenPOWER on IntegriCloud