ruby-changes:67577
From: Nobuyoshi <ko1@a...>
Date: Fri, 3 Sep 2021 17:50:16 +0900 (JST)
Subject: [ruby-changes:67577] 62fc81fe12 (master): [ruby/cgi] Use Time#strftime
https://git.ruby-lang.org/ruby.git/commit/?id=62fc81fe12 From 62fc81fe124d4de35153aad5df0dcf21dafdddc6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 3 Sep 2021 13:39:47 +0900 Subject: [ruby/cgi] Use Time#strftime https://github.com/ruby/cgi/commit/caf1d0755d --- lib/cgi/util.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index 69a252b..55e61bf 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -179,21 +179,12 @@ module CGI::Util https://github.com/ruby/ruby/blob/trunk/lib/cgi/util.rb#L179 # Synonym for CGI.unescapeElement(str) alias unescape_element unescapeElement - # Abbreviated day-of-week names specified by RFC 822 - RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ] - - # Abbreviated month names specified by RFC 822 - RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ] - # Format a +Time+ object as a String using the format specified by RFC 1123. # # CGI.rfc1123_date(Time.now) # # Sat, 01 Jan 2000 00:00:00 GMT def rfc1123_date(time) - t = time.clone.gmtime - return format("%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT", - RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year, - t.hour, t.min, t.sec) + time.getgm.strftime("%a, %d %b %Y %T GMT") end # Prettify (indent) an HTML string. -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/