NAME

Dist::Man::Plugin -- how Dist::Man plugins work

DESCRIPTION

This document is a guide to writing plugins for Dist::Man. Currently, as is evident, it isn't very comprehensive. It should provide enough information for writing effective plugins, though. After all, Dist::Man's guts are nice and simple.

Dist::Man->import

Dist::Man provides an import method, the arguments to which are plugins, in the order in which they should be loaded. If no plugins are given, Dist::Man::Simple (and only Dist::Man::Simple) is loaded.

By default, the given modules are required and arranged in an is-a chain. That is, Dist::Man subclasses the last plugin given, which subclasses the second-to-last, up to the first plugin given, which is the base class. If a plugin provides a load_plugins method, however, the remaining plugins to be loaded are passed to that method, which is responsible for loading the rest of the plugins.

This architecture suggests two kinds of plugins:

engine plugins

An engine is a plugin that stands alone, implementing the public create_distro method and all the functionality required to carry out that implementation. The only engine included with Dist::Man is Dist::Man::Simple, and I'm not sure any more will be seen in the wild any time soon.

plain old plugins

Other plugins are designed to subclass an engine and alter its behavior, just as a normal subclass alters its parent class's. These plugins may add features to Dist::Man engines, or may just provide general APIs for other plugins to exploit (like Dist::Man::Plugin::Template.)

The template plugin is a simple example of a plugin that alters an engine to accept further plugins. Other plugins like template will probably be written in the near future, and plugins that exploit the API provided by Dist::Man::Plugin::Template will be available on the CPAN.

AUTHOR

Ricardo SIGNES <rjbs at cpan.org>

COPYRIGHT

Module-Starter

Copyright 2005, Ricardo SIGNES. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Dist-Man

Modified by Shlomi Fish, 2009 - all rights disclaimed - may be used under any of the present or future terms of Module-Starter.