Re: plugin dependencies

James Adam
Fri, 05 Oct 2007 15:57:38 -0000

On 9/21/07, James Adam <james.adam@gmail.com>
wrote:
> On 9/21/07, DHH <david.heinemeier@gmail.com> wrote:
> >
> > > If every plugin''s lib was in the load path *before* any
plugin could
> > > start playing around or monkeypatching, many situations where you
> > > might want to explicitly ensure a plugin was loaded can be made
to go
> > > away.
> >
> > Can you look into writing a patch for that?
>
> Absolutely.
>

I''ve just created two (independent) patches to address this issue,
which you guys can now see on Trac. Both apply cleanly on edge as of
10 minutes ago, though not at the same time, of course.

The first - http://dev.rubyonrails.org/ticket/9793 - does the job with
the minimal amount of change to the existing code, and would be great
to apply, but still leaves me feeling like more could be done. Hence:

The second - http://dev.rubyonrails.org/ticket/9795 - which also does
the job, but also refactors the plugin locator/loader relationship to
be (hopefully) clearer, more testable and easier to develop in the
future. It''s quite a bit bigger, but that is only because it is mostly
refactoring (which always inflates a diff) and testing, rather than
significant new behaviour.

While I''m aware that getting feedback on this larger patch is going to
be more effort on your part, once you''ve applied it to a clean edge
checkout, browsing around the code in railties/lib/rails/ should be
clear enough.

Feedback greatly appreciated!

Cheers,

--
* J *
  ~