From: Alan Chen Date: 2002-11-13T01:25:35+09:00 Subject: Re: Load path for eruby On Tue, Nov 12, 2002 at 08:49:33PM +0900, Patrick Roemer wrote: > Hi, > > I would like to include app-specific files that are not on > the regular load path into my eruby file. Using plain ruby > I would specify the load path with '-I'. This switch doesn't > seem to be available with eruby. What would be the best way > to access these files other than a) putting them in the same > directory as the eruby file or b) altering the global load > path? I'm not sure what you mean by "altering the global load path". I'm taking it to mean re-compiling ruby with an alternate load path defaults. Within the script you can alter the $LOAD_PATH variable. $LOAD_PATH.unshift('/path/to/somewhere') PS. I just found out that $: works with ruby -e but not $LOAD_PATH. Hmm.. Or, you could always give require a fully specified path require '/usr/lib/myrubylib/stuff.rb' Either way, you might want to place this type of code in some sort of config file so that you're not always rewriting your paths when you move your files. -alan -- Alan Chen Digikata LLC http://digikata.com