Forum: Rails-core (closed, excessive spam) Accessing loaded_plugins from initializer?

Posted by Pedro Belo (pedrobelo)
on 2008-06-07 01:11
(Received via mailing list)
Hey guys,

Isn't it possible to access Rails::Initializer after it ran?

For instance, I want to see which plugins were loaded but I can't do
Dir["#{RAILS_ROOT}/plugins/*"] because I'm using another plugin
loader.

What's the "official" way the framework is using to get data from the
Initializer? Make it call your model?

Thanks,
Pedro
Posted by Mislav MarohniÄ? (mislav)
on 2008-06-07 20:14
(Received via mailing list)
Hey Pedro,
I don't think there is. There is just accessor for Rails::Configuration. 
But
you could easily get it:

    RINIT = Rails::Initializer.run do |config|
      # ...
    end

Now open up script/console:

    RINIT.loaded_plugins.map &:name

I think if we save the Configuration instance, we could save Initializer 
as
well.


On Sat, Jun 7, 2008 at 1:11 AM, Pedro Mariano Belo <pedrobelo@gmail.com>
This topic is locked and can not be replied to.