MooseX::App::WritingPlugings - Writing plugins for MooseX::App
package MooseX::App::Plugin::MyPlugin; use Moose::Role; sub plugin_metaroles { my ($self,$class) = @_; return { class => ['MooseX::App::Plugin::MyPlugin::Meta::Class'], } } around 'initialize_command' => sub { ... };
Plugins are implemented as Moose roles and must reside in the MooseX::App::Plugin::* namespace. Metaclasses can be altered via the 'plugin_metaroles' callback method. Furthermore Moose method modifiers (around, after, before) can be used to alter the behaviour of MooseX::App.
Optional callback method that should return a hash reference specifying which metaroles will be applied to the class metaclass and its contained metaclasses and helper classes.
Each key should in turn point to an array reference of role names.
It accepts the following keys:
class =item * attribute =item * method =item * wrapped_method =item * instance =item * constructor =item * destructor =item * error
Most of MooseX-App behaviour is implemented in metaclass roles. When writing plugings you will most likely need to alter/augument the behviour of these roles.
MooseX::App::Meta::Role::Class::Base
MooseX::App::Meta::Role::Class::Command
MooseX::App::Meta::Role::Attribute
To install MooseX::App, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::App
CPAN shell
perl -MCPAN -e shell install MooseX::App
For more information on module installation, please visit the detailed CPAN module installation guide.