[Rails] Let's talk about packaging
Jim Weirich
jim at weirichhouse.org
Mon Nov 8 21:43:26 GMT 2004
Scott Barron said:
>> I only stored site changable stuff outside the gem directory. This
>> included configuration information and the logging directory.
>
> Well, wouldn't the user want to choose where, outside the gem directory,
> these things would go? If one is using apache, then either public/ will
> have to go outside of the gems directory (preferred), or apache will
> have to point at public/ in the gems directory.
Hmmm ... the public area wasn't an issue with the webrick version. Let's
see what's in the public area... the dispatch code, javascript code,
stylesheets, the .htaccess file, images and static html.
If any of those things need to be customized by the end user, then they
should definitately reside outside the gem directory. If it makes it
easier for apache to access the data, then I have no problem with that
either.
Let me just add this too. The way I implemented a lot of this stuff in
storycards is to replace the require '../../../../../../../' stuff with
utility calls. For example, to access something in the log directory was:
log_file = File.join(Storycards.log_dir, "file.log")
The log_dir method would hunt down the proper location the first time it
is called. Thereafter it would return whatever it found the first time.
I also had a Storycards.data_dir. This gave me a lot of freedom in
moving parts of Rails around to where I wanted them.
--
-- Jim Weirich jim at weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
More information about the Rails
mailing list