[Bug #2704] CGI::rfc1123_date causes NameError

Bug #2704: CGI::rfc1123_date causes NameError
http://redmine.ruby-lang.org/issues/show/2704

e$B5/I<<Te(B: Naoto Takai
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
ruby -v: ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]

cgi/util.rb e$B$KDj5A$5$l$F$$$ke(B CGI::rfc1123_date e$B$,e(B
cgi/core.rb e$B$KDj5A$5$l$F$$$ke(B CGI::RFC822_DAYS
e$B$K0MB8$7$F$$$k$K$b$+$+$o$i$:!“e(B cgi/util.rb e$B$G$Oe(B cgi/core.rb
e$B$re(B require e$B$7$F$$$J$$$?$a!”<!$N$h$&$J%(%i!<$,H/@8$7$^$9!#e(B

$ ruby -rcgi/util -e ‘CGI::rfc1123_date Time.now’
/usr/local/ruby-1.9.1/lib/ruby/1.9.1/cgi/util.rb:150:in rfc1123_date': uninitialized constant CGI::RFC822_DAYS (NameError) from -e:1:in

e$B%A%1%C%He(B #2704 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

xibber e$B$5$se(B
e$B1sF#$G$9!#e(B

e$B$3$N%A%1%C%H$O$I$&$K$+$J$C$F$^$9$G$7$g$&$+!#e(B

RFC822_DAYS e$B$J$I$OB>$G;H$o$l$F$$$J$$$h$&$J$N$G!"e(Bcgi/util.rb
e$B$Ke(B
e$BDj5A$r$5$5$C$H0$7$F$7$^$($P$h$$$h$&$J5$$,$7$^$9!#e(B

require “cgi/core”; p CGI::RFC822_DAYS e$B$,F0$+$J$/$J$k$N$O:$$k!*e(B

e$B$H$$$&[email protected]$m$&$+e(B

diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index f3e2300…698c7ce 100644
— a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -40,12 +40,6 @@ class CGI
“VARIANT_ALSO_VARIES” => “506 Variant Also Negotiates”
}

  • 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 ]

  • :startdoc:

    def env_table
    diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
    index 42f1336…7be3e92 100644
    — a/lib/cgi/util.rb
    +++ b/lib/cgi/util.rb
    @@ -141,6 +141,12 @@ class CGI
    unescapeElement(str)
    end

  • 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)


Yusuke E. [email protected]

http://redmine.ruby-lang.org/issues/show/2704

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs