logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MooseX::App::WritingPlugins - Writing plugins for MooseX::App

Callbacks

plugin_metaroles
       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

       •   attribute

       •   method

       •   wrapped_method

       •   instance

       •   constructor

       •   destructor

       •   error

Description

       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 or its meta classes.

Metaclasses

       Most of MooseX-App behaviour is implemented in metaclass roles. When writing plugins you will most likely
       need  to  alter/augument  the  behaviour  of  these  roles.  Implementation  details  can be found in the
       respective packages.

       •   MooseX::App::Meta::Role::Class::Base is applied to the base metaclass

       •   MooseX::App::Meta::Role::Class::Command is applied to the command metaclass

       •   MooseX::App::Meta::Role::Attribute::Option is applied to all attributes in the base and command  meta
           classes

perl v5.36.0                                       2023-10-22                   MooseX::App::WritingPlugins(3pm)

Name

       MooseX::App::WritingPlugins - Writing plugins for MooseX::App

Synopsis

        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_class' => sub {
           ...
        };

See Also