pretty please? On Jan 13, 2005, at 7:20 PM, Ryan Davis wrote: > If date.rb is loaded twice, the second load raises NameError. > >> <527> cat blah.rb >> >> require './lib/date.rb' >> require '/Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb' > > causes: > >> <528> ./ruby18 blah.rb >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:238: >> warning: already initialized constant MONTHNAMES >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:243: >> warning: already initialized constant DAYNAMES >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:247: >> warning: already initialized constant ABBR_MONTHNAMES >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:250: >> warning: already initialized constant ABBR_DAYNAMES >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:254: >> warning: already initialized constant ITALY >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:258: >> warning: already initialized constant ENGLAND >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:262: >> warning: already initialized constant JULIAN >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:266: >> warning: already initialized constant GREGORIAN >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:1261:in >> `undef_method': undefined method `today' for `DateTime' (NameError) >> from >> /Volumes/Space/ryan/Work/cvs/ruby-lang/ruby_18/lib/date.rb:1261 >> from blah.rb:3:in `require' >> from blah.rb:3 > > With the patch below you just get the warnings. > > <506> cvs diff -du lib/date.rb > Index: lib/date.rb > =================================================================== > RCS file: /src/ruby/lib/date.rb,v > retrieving revision 1.17.2.5 > diff -d -u -r1.17.2.5 date.rb > --- lib/date.rb 23 Jul 2004 07:52:37 -0000 1.17.2.5 > +++ lib/date.rb 14 Jan 2005 03:09:34 -0000 > @@ -1258,7 +1258,7 @@ > new_with_hash(elem, sg) > end > > - class << self; undef_method :today end > + class << self; undef_method :today end rescue nil > > # Create a new DateTime object representing the current time. > # > >