Re: plugin dependencies

James Adam
Wed, 19 Sep 2007 15:19:45 -0000

On 9/19/07, Aaron Pfeifer <aaron.pfeifer@gmail.com>
wrote:
> Say we have 2 plugins, encrypted_strings and encrypted_attributes
> (which depends on encrypted_strings).  In this case, we do the
> following:
>
> encrypted_attributes/init.rb:
> require ''encrypted_attributes''
>
> encrypted_attributes/lib/encrypted_attributes.rb:
> require ''encrypted_strings''
> ...do stuff...
>
> With plugin_dependencies loaded, this will look for encrypted_strings
> as either a vendor/plugin within the application or as a gem.  This
> lets me be flexible in case I want the same plugin/gem/whatever used
> across multiple applications in a single environment.

Ignoring anything about requiring specific versions, couldn''t this be
achieved by having all of the plugins added to the load path before
any init.rb files are evaluated (my suggestion above)? That way the
normal Ruby "require" would seem to provide everything that you
describe here.

--
* J *
  ~