zen-cms/Zen-Core — Issue #36: Ditch Zen::Plugin
Author: YorickPeterse
Created: 2011-10-16 15:15:13+00:00
State: open
Labels: Planning

``Zen::Plugin`` is a rather useless class. First of all plugins in Zen aren't
plugins, they're just shortcuts so that you don't have to specify the full
namespace. Second these plugins don't have any special need to be in a special
type of class rather than a module or a model.

Because the current setup relies heavily on the ``plugin()`` method it should be
deprecated first and then removed. One way of doing this would be to move
everything into their own model/module and then simply use the ``plugin()``
method to call the appropriate method.

In terms of syntax ditching this class would result in the following code:

Sections::Model::SectionEntry.get(:section => 'Pages')

Instead of the following code:

plugin(:section_entries, :section => 'pages')

Another example would be the markup plugin. Instead of calling
``plugin(:markup, :markdown, 'Hello **world**')`` you'd call the following
instead:

Zen::Markup.render(:markdown, 'Hello **world**')