Plugins - loaded_plugins

StarAdd to favorites

loaded_plugins

loaded_plugins adds +Rails.plugins+, a list all of the plugins that Rails has loaded.

Resources

Announcement

Wiki

API

Development

Source

Description

During initialization, +Rails.plugins+ will keep track of a list of all of the plugins that have been loaded so far. Once initialization is complete, +Rails.plugins+ will contain all of the plugins loaded in the application.

The order of the plugins will be based on the order in which the plugins were loaded during initialization.

Usage

If you need access to Rails.plugins during initialization of your application, you must use one of two things:

  1. Use +config.plugins+ to specify the order in which plugins are

loaded, for example:

  Rails::Initializer.run do |config|
    ...
    config.plugins = [
      'loaded_plugins',
      ...
    ]
  end
  1. Require the plugin with the plugin_dependencies[http://wiki.pluginaweek.org/Plugin_dependencies] plugin installed.

If using require without plugin_dependencies installed, loaded_plugins will not track all of the plugins that were loaded prior to it being loaded until after initialization is complete.

Also, note that the plugins are listed in the order that they are completely loaded. That is, only after the entire initialization of a plugin is complete will it get added to +Rails.plugins+.

References

Aaron Pfeifer, Neil Abraham

http://wiki.pluginaweek.org/Loaded_plugins

http://svn.pluginaweek.org/trunk/plugins/rails/loaded_plugins

Rails' (MIT)

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment
Mislav 3 Nov 2006

So much work for something built-in (in edge). Take a look at Rails::Initializer.loaded_plugins

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?