On 9/1/10 10:38 AM, Jim Gay wrote:
On Wed, Sep 1, 2010 at 11:23 AM, Wes Gamble<we...@att.net>  wrote:
On 9/1/10 9:39 AM, Jim Gay wrote:

On Tue, Aug 31, 2010 at 1:09 PM, Wes Gamble<we...@att.net>  wrote:

I have an additional path that I would like to be on the load path for a
given extension.

What is the best way for me to add this load path to the set of default load
paths in Radiant?

Do I need to modify the load paths for _all_ extensions or just this one?

Thanks,
Wes

The load paths are set for the entire application.
If you want to load something from an specific path you could just
search for files in that path and load or require them.
But you're not being very specific; do you have an example of what you
want to do?

I want to add the ability to use the Cells gem
(http://github.com/apotonick/cells) within an extension.  I wrote a custom
tag that allows me to use a "cell" anywhere in my Radiant application.

It requires the use of a "cells" directory underneath "app", so I'd like to
load "app/cells" alongside the other extension paths, ideally in
ExtensionLoader.load_paths_for (which, unfortnately, is private, and uses a
hard-coded list of directories).

W
You can alter the load paths in your config/environment.rb

config.load_paths<<  "#{RAILS_ROOT}/app/cells"

If you need to add it from extensions you could do something with

Dir.glob("#{Rails.root}/vendor/extensions/**/app/cells")
Can I successfully modify the config.load_paths from within my xxx_extension.rb file?

W

Reply via email to