From: Dave Thomas Date: 2002-05-07T09:14:35+09:00 Subject: Re: require and case matz@ruby-lang.org (Yukihiro Matsumoto) writes: > Hi, > > In message "Re: require and case" > on 02/05/07, Dave Thomas writes: > > |I'm becoming convinced by this thread that rb_require should normalize > |all paths before executing, and should store those normalized paths in > |$". Thus on a Windows box the names should be converted to lower case > |and expand_path called. On a Unix both, the case should be left > |unchanged but expand_path is called. On other boxes, other rules will > |apply. > > I feel other way around. Requiring "feature names" should appear same > on all platforms, i.e. (basically) lowercase words, joined with > slashes. This convention also enhances script portability. Absolutely - I say require 'dbi' But under the covers, Ruby expands this to the canonical name, and stores that canonical name in $". That way, we don't get duplicates for require 'dbi' require 'dbi.rb' etc I agree - the feature name stays the same. But when rb_require uses the relative path to remember what files have been loaded, it's really a bug, as there are an infinite number of relative paths that all name the same file. If the contract for 'require' is that it only loads a given feature once, then not using a canonical name in $" breaks that contract. Cheers Dave