From: Austin Ziegler Date: 2005-09-27T06:02:07+09:00 Subject: Re: Require Namepaces and RubyGems' effect on LoadPath problem On 9/26/05, TRANS wrote: > I've added namespaces to require. Works like this: > > $LOAD_SPACE[ 'myspace' ] = [ 'a/path', 'another/path' ] > > require 'myspace:script.rb' > > The load spaces are File.join'd with the entries in $LOAD_PATH, > $LOAD_PATH is unshifted with those entries and the built-in #require > is called. When complete it removes those namespace paths. The key > thing to keep in mind here: this allows for *relative* paths within > the context of the namespace require. For example: > > $LOAD_SPACE[ 'tim' ] = [ 'tim/path' ] > > require 'tim:file.rb' > > tim/path/file.rb: > > require 'file2.rb' Two things. 1. I don't see any particular reason for this. It's neat, but I don't see why it's necessary. 2. If something is loaded from a particular "namespaced" path, that path should remain on the load list, because not everything in a path may actually be loaded with a single require. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca