From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-05-03T14:52:26+09:00 Subject: Re: require and case In article , Martin Stannard wrote: > >>ruby -v >ruby 1.6.5 (2001-09-19) [i586-mswin32] > >======================= >require 'Date' >require 'date' > > >puts Date.new(2002, 4, 28) >========================= > >F:\fish\projects\test>e:\rubywin32\bin\ruby >F:\fish\projects\test\datetest.rb >e:/rubywin32/lib/ruby/1.6/date.rb:8: warning: already initialized constant >IDENT >e:/rubywin32/lib/ruby/1.6/date.rb:11: warning: already initialized constant >MONTHNAMES >e:/rubywin32/lib/ruby/1.6/date.rb:13: warning: already initialized constant >DAYNAMES >e:/rubywin32/lib/ruby/1.6/date.rb:15: warning: already initialized constant >ITALY >e:/rubywin32/lib/ruby/1.6/date.rb:16: warning: already initialized constant >ENGLAND >e:/rubywin32/lib/ruby/1.6/date.rb:17: warning: already initialized constant >JULIAN >e:/rubywin32/lib/ruby/1.6/date.rb:18: warning: already initialized constant >GREGORIAN >e:/rubywin32/lib/ruby/1.6/Date.rb:148:in `new3': invalid date >(ArgumentError) > from e:/rubywin32/lib/ruby/1.6/date.rb:150:in `new3' > from F:\fish\projects\test\datetest.rb:5 > > > >It took me a while to track this down as the 2 requires were in different >files. > >Should require be case insensitive or should it give a warning if the module >it's trying to load has different case to that specified? > Well, you wouldn't have had an issue on Unix, but because the Windows filesystem only pretends to be case-sensitive and then really isn't this is what happens. Maybe there should be a warning, but it should only be enabled on Windows... Don't need or want it on the Unices. Phil