On 11/27/07, Chad Woolley <[EMAIL PROTECTED]> wrote:
> I think this is a fairly bad regression that will likely break a lot
> of plugins.  We should consider fixing it before the 2.0 release.  I
> can try to give a more detailed failure scenario if you want.

You're right about the load path being added to before any init.rb
file is evaluated - I was paraphrasing, but it seems like this
separation of loading is one of the factors which is causing you
issues - apologies for the confusion.

> This breaks the assumption that a 'child' plugin can reopen a class
> from another 'parent' plugin which it depends on.

It's interesting, given that the reason it was decided to add all load
paths before loading plugins was exactly to remove dependency
problems! (see 
http://groups.google.com/group/rubyonrails-core/browse_frm/thread/7615e2ac0fa019d)

I sympathise with your issue, but I'm not convinced this is a
regression. It sounds like rspec_on_rails contained a file something
like rspec_on_rails/lib/spec/matchers/have.rb, which was intended to
add behaviour to the corresponding file in the rspec plugin; but
making this rely on the order of the load path is never going to be an
optimal solution. If one plugin really needs to modify code provided
by another one, shouldn't it do this by either:

* mixing in the new functionality via a module, or
* reopening the class manually, but *not* in a file which has the same
path as the file it is going to affect.

In other words, and in general Ruby as well as Rails, if we ever have
files which have the same "relative" path (such as
spec/matchers/have.rb), it's always going to be difficult to guarantee
that one will be loaded over the other. It seems like the best way to
solve this is to simply avoid it.

-- 
* J *
  ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to