Plugin dependencies

Hi everyone!

I’m writing my first ever Rails plugin, and I’m trying to figure out
what the best way (in 2.3) to manage plugin dependencies is. Google
doesn’t seem to yield much that is applicable to my current situation,
and the Rails docs themselves are quite weak in this area (or I’m
looking at the wrong class).

Basically, the situation is this: I have some common model functionality
dealing with street addresses that I abstracted into a couple of
modules. I decided it was worth wrapping up those modules into an
acts_as plugin (acts_as_addressed). One of the modules uses only core
Rails features, and that was pretty easy to move into the plugin. The
problem now is my other module, which uses some of the geocoding
features provided by the YM4R plugin.

So…in this case, what’s the best way to specify that certain features
of the acts_as_addressed plugin depend on the YM4R plugin? I’m hoping
to release acts_as_addressed as a standalone plugin, and I’d like to
enforce the dependency somehow so that my users don’t get random
NameErrors. Does Rails provide a mechanism for this? Is there some
other way I should structure my plugin? Any ideas would be appreciated.

Sorry if this is a stupid question – I’m not really all that familiar
with the Rails plugin system, beyond using plugins in my applications.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Oct 23, 7:10 pm, Marnen Laibow-Koser <rails-mailing-l…@andreas-
s.net> wrote:

Hi everyone!

I’m writing my first ever Rails plugin, and I’m trying to figure out
what the best way (in 2.3) to manage plugin dependencies is. Google
doesn’t seem to yield much that is applicable to my current situation,
and the Rails docs themselves are quite weak in this area (or I’m
looking at the wrong class).

basically there is very little support for dependencies, core’s
position on this is ‘if you want dependencies, use gems’ (plugins can
be loaded from gems). If the plugin you want to depend on isn’t
available in gem form then it isn’t hard to make that plugin also work
as a gem according to
http://www.practicalecommerce.com/blogs/post/438-The-Blurring-Line-Between-Plugins-and-Gems

Fred

Frederick C. wrote:

On Oct 23, 7:10�pm, Marnen Laibow-Koser <rails-mailing-l…@andreas-
s.net> wrote:

Hi everyone!

I’m writing my first ever Rails plugin, and I’m trying to figure out
what the best way (in 2.3) to manage plugin dependencies is. �Google
doesn’t seem to yield much that is applicable to my current situation,
and the Rails docs themselves are quite weak in this area (or I’m
looking at the wrong class).

basically there is very little support for dependencies, core’s
position on this is ‘if you want dependencies, use gems’ (plugins can
be loaded from gems).

I was afraid of that.

If the plugin you want to depend on isn’t
available in gem form then it isn’t hard to make that plugin also work
as a gem according to
http://www.practicalecommerce.com/blogs/post/438-The-Blurring-Line-Between-Plugins-and-Gems

Thanks! I’ll check that out.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs