From: Cameron McBride Date: 2002-05-04T13:01:46+09:00 Subject: Re: require and case > Cameron McBride wrote: > >> >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. > > > >I disagree. If I were writing an app on my happy linux box, but I > >wanted to distribute it about and have it work on Windows -- I would > >want the warning. > > > >Without the warning -- it seems a quick way to introduce 'porting' > >problems on a script that otherwise shouldn't have them. Anyhow, why > >would I want to use same name / different case package names? If I do > >it -- its got to be a mistake anyhow... ;-) > > On Sat, May 04, 2002 at 01:53:01AM +0900, Phil Tomson wrote: > Well, maybe I should clarify my statement. Let's say you're on Unix and > the file you want to require is named Some.rb. > > Now if you say: > require 'some' > > You're going to get an error that says that some.rb doesn't exist in the > search path. > > But on Windows it would have worked because even though you see the file > in your file viewer as Some.rb, it'll accept some.rb. > > So the warning isn't needed under Unix because you'll get an error anyway > if you try to mixup the case of the name of the file being required. My turn to clarify. ;-) Your example is true, but what about if you have some nontrivial code (ie you miss the obvious). Say you created a new lib (new.rb) and sucked it in with a require: require 'new' But what you forgot is that yesterday, you created another lib that did something different, but you happened to name it 'New.rb' and did: require 'New' If I am right, this will work nicely on my unix box -- but will choke a non-case sensitive OS. This is where the warning would be nice. Cameron ps -- I really should have tested this before posting, so please forgive my friday evening laziness if I am wrong.