On Thursday 21 May 2009, James Adam wrote:
> On May 20, 8:30 pm, Mislav Marohnić <[email protected]> wrote:
> > On Wed, May 20, 2009 at 17:08, Michael Schuerig 
<[email protected]> wrote:
> > > > The problem is that the current Initializer instance isn't
> > > > saved anywhere.
> > > >
> > > > If you change your environment.rb like this:
> > > >
> > > >   Init = Rails::Initializer.run ...
> > >
> > > That's not what I want, although I deliberately didn't say what
> > > I'm trying to do. I'm currently hacking on the rails/info
> > > controller to make it modular. I'd like to add a hook for
> > > plugins/gems as well as the application to add their own
> > > diagnostic information to that controller.
> >
> > I think that your goal, "get a list of loaded plugins", is fairly
> > straightforward and I don't understand why we need to know what are
> > you going to do with it. What I'm interested in is why do you think
> > saving the Initializer instance isn't adequate?
> >
> > Rails saves the active Configuration instance, so for consistency
> > it should also save the Initializer. After 2 additional lines of
> > code we could access plugins like:
> >
> >   Rails.initializer.loaded_plugins
>
> I've done a little bit of thinking around this, and my preference
> would be, roughly in order:
>
> 1) Rails.loaded_plugins
> 2) Rails.configuration.loaded_plugins
> 3) Rails.initializer.loaded_plugins

My patch at 

https://rails.lighthouseapp.com/projects/8994/tickets/2684-modular-
rails-info

currently does 2). However, I agree with your argument and will change 
it to 1).

Michael

-- 
Michael Schuerig
mailto:[email protected]
http://www.schuerig.de/michael/


--~--~---------~--~----~------------~-------~--~----~
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