[Nitro] gen and parts

gabriele renzi surrender_it at yahoo.it
Mon Aug 7 19:21:58 EDT 2006

Fabian Buch ha scritto:
> Am 06.08.2006 um 16:52 schrieb gabriele renzi:
>>for what is worth, I could replicate the patch against the new gen
>>infrastructure, but I'm not sure I understand what is the use for  
>>you just want to copy a part from some $LOAD_PATH into the main
>>directory (plus proper public/ handling) ?
> Yes, but the main reason is the public/ handling, since I want parts  
> that also have images, custom css files and maybe (like James) custom  
> JS files. It could be somehow piped or css in actions (like the admin  
> part does), but that doesn't work nice for images. So at least the  
> public/ directory of a part has to be copied to the applications  
> public/ directory, to be visible by the webserver directly.

I see thank you , I'll implement this since it is simple enough :)
But just another question: how do you handle references to media/js in 
the part code?
Do you rely on hardcoded paths (i.e. <img src=/partname/something.png>), 
or is there a way through which we could make it modular, allowing for 
the copying of a part with a different name?
What I mean is, for example,
  gen part wiki pages
that could copy the wiki part installing it into the application as 
part/pages and public/pages.
It seem kind of useful, but seem hard to do.

> My patch does both, copy the whole part and it's public/ directory  
> into the applications public/ directory.

yes I've seen that, I just did not really understood what it was for :)

> I think that's also what George means by "The files that reside in  
> the public directory are typically copied by a code generator to your  
> application public dir." in the rdoc of part.rb, just that till now  
> this generator wasn't implemented yet.

yup, thanks for taking time to explain :)


blog en: http://www.riffraff.info
blog it: http://riffraff.blogsome.com
jabber : rff.rff at gmail dot com

More information about the Nitro-general mailing list