From: TRANS Date: 2005-09-26T21:02:15+09:00 Subject: Re: Finally an answer to my RubyGems question and some small suggestions On 9/26/05, Austin Ziegler wrote: > On 9/25/05, TRANS wrote: > > I appreciate those that attempted to offer me some info on this issue. > > I found an answer to much of my query: > > > # We replace Ruby's require with our own, which is capable of > > # loading gems on demand. > > # > > # When you call require 'x', this is what happens: > > # * If the file can be loaded from the existing Ruby loadpath, it > > # is. > > # * Otherwise, installed gems are searched for a file that matches. > > # If it's found in gem 'y', that gem is activated (added to the > > # loadpath). > > # > > # The normal require functionality of returning false if > > # that file has already been loaded is preserved. > > # > > > > So the order of the search is: > > > > site_ruby > > ruby > > gems > > Unfortunately, the answer isn't *quite* that simple. It's site_ruby, > ruby, gems. When the gem is activated (with require_gem or > automatically), the gem's path is then added *before* site_ruby. Ah, right! Totally over looked that. And it might explain some of the problems I had. Thanks Austin. > > module Kernel > > alias require__ require > > > > The __ looks terrible, especailly in error output. Something like > > > > alias require_without_gems require > > This, of course, will no longer be necessary when RubyGems is integrated > into the core. Good. Do you think, while we're at it, some code can be put in there to deal with non-cross platform punctuation in file names? T.