Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9613 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

Partial plugin ordering with :all

Reported by: david Assigned to: core
Priority: normal Milestone:
Component: ActionPack Version: edge
Severity: normal Keywords: rails2
Cc:

Description

Now that we've extracted even more pieces of core functionality into plugins, it'd be good to ease the pain a little on the existing config.plugins way of specifying the load order. I propose introducing the :all term, which would work like this:

  config.plugins = [ :acts_as_list, :classic_pagination, :all ]

That way you don't have to name all your plugins to specify that a very select few needs to be loaded in a particular order. :all will expand to mean all the other plugins not already mentioned in alphabetical order.

See http://groups.google.com/group/rubyonrails-core/browse_frm/thread/7615e2ac0fa019d for more context. I don't buy into plugins being able to manage these things themselves. There should be some vinegar on plugin dependencies, so we don't encourage heavy and deep dependencies. But this would make it just the right amount, I think. Plugins can use their install.rb and README files to tell the user what the dependencies are and how to install and specify them.

Attachments

support_partial_plugin_ordering.diff (6.6 kB) - added by fcheung on 09/20/07 23:20:00.

Change History

09/20/07 23:20:00 changed by fcheung

  • attachment support_partial_plugin_ordering.diff added.

09/21/07 04:51:31 changed by hasmanyjosh

If :all just means "the rest of them", it seems that you don't need to even have it. Just code it so that unlisted names get tacked on at the end. Convention over configuration!

09/21/07 06:58:11 changed by fcheung

Unless you wanted to only load a certain set of plugins, or if you had a plugin which you wanted loaded last (ie config.plugins = [:all, :foo_plugin}. I don't know about the second case, but I've used the first case (and it does seem to be what config.plugins is currently used for)

09/21/07 14:15:22 changed by david

Right. The "don't load everything" use case is definitely still relevant.

09/21/07 22:31:27 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

(In [7531]) Added the :all option to config.plugins thatll include the rest of the plugins not already explicitly named (closes #9613) [fcheung]