Plugins dependency mechanism?

Hi,

With so many good plugins around at the moment, I’d perhaps like to
require
some of these in one of my own rather than try to re-write their
functionality.

Is there a mechanism available for making a plugin dependent on another
plugin(s)?

Cheers

Dan

There are two different types of dependency. Controlling the load
order is currently impossible without resorting to some send()-based
trickery (or the patch here - http://dev.rubyonrails.org/ticket/5468,
or using init_engine.rb and the engines plugin’s Engines.start
method).

However, I’m guessing that you might be looking for a more general
form of dependency, i.e. “for plugin X to operate, plugin Y needs to
be installed”. There are a couple of ways around that at the moment,
which aren’t too ardous.

  1. If you’re the developer behind Plugin X, you can include a hook in
    install.rb which ensures that Plugin Y is also installed if it isn’t
    already:

(from login engine’s install.rb)

Install the engines plugin if it has been already

unless File.exist?(File.dirname(FILE) + “/…/engines”)
Commands::Plugin.parse!([‘install’,
http://svn.rails-engines.org/plugins/engines’])
end

  1. If you’re not the developer of Plugin X, try using Plugin Packs
    (http://www.lukeredpath.co.uk/index.php/2006/07/28/rails-plugin-packs-coming-to-rapt/),
    a neat way to install collections of plugins in one go. We’ve got some
    ideas in development at the moment which will make this even simpler,
    in the future.

If you want to be able to use some of the functionality from Plugin Y
while Plugin X is loading (i.e. in init.rb), then you’ll need some of
the cunning at the top of this email. Some people have mooted using
gems to install and load plugins, which might give you all of this
functionality in the future. I’m not crazy about this idea, but we’ll
see what happens.

  • james

On 8/4/06, James A. [email protected] wrote:

which aren’t too ardous.
end
while Plugin X is loading (i.e. in init.rb), then you’ll need some of

With so many good plugins around at the moment, I’d perhaps like to

  • J *
    ~

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Thanx for the heads up James. I’ll certainly keep an eye on progress on
Rapt.

I’ve had a quick look at Rapt a while ago but couldn’t get it to work.
(I’m
on winXP)

Thanx again