The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dist::Zilla::Role::PluginLoader::Configurable - A role for plugins that load user defined and configured plugins

VERSION

version 0.001003

METHODS

mvp_aliases

  • dz_plugin_arguments= can be written as >= or dz_plugin_argument=

mvp_multivalue_args

All of the following support multiple declaration:

  • dz_plugin_arguments

  • prereq_to

load_plugins

This is where by default the child plugin itself is loaded.

If you want to make the loading of a child plugin conditional, wrapping this method is recommended as follows:

  around load_plugins => sub {
    my ( $orig, $self, $loader ) = @_;
    # conditional code here
    return if $dont_load_them;
    return $self->$orig($loader);
  };

You can also do more fancy things with $loader, but it is not advised.

register_prereqs

By default, registers "dz_plugin_package" version "dz_plugin_minimumversion" as develop.requires ( as per "prereq_to" ).

ATTRIBUTES

dz_plugin

REQUIRED

The plugin identifier.

For instance, [GatherDir / Foo] and [GatherDir] approximation would both set this field to

  dz_plugin => 'GatherDir'

dz_plugin_name

The "Name" for the plugin.

For instance, [GatherDir / Foo] would set this value as

  dz_plugin_name => "Foo"

and [GatherDir] approximation would both set this field to

  dz_plugin_name => "Foo"

In Dist::Zilla, [GatherDir] is equivalent to [GatherDir / GatherDir].

Likewise, if you do not specify dz_plugin_name, the value of dz_plugin will be used.

dz_plugin_minversion

The minimum version of dz_plugin to use.

At present, this ONLY affects prereq generation.

dz_plugin_arguments

A mvp_multivalue_arg attribute that creates an array of arguments to pass on to the created plugin.

For convenience, this attribute has an alias of '>' ( mnemonic "Forward" ), so that the following example:

  [GatherDir]
  include_dotfiles = 1
  exclude_file = bad
  exclude_file = bad2

Would be written

  [YourPlugin]
  dz_plugin = GatherDir
  >= include_dotfiles = 1
  >= exclude_file = bad
  >= exclude_file = bad2

Or in crazy long form

  [YourPlugin]
  dz_plugin = GatherDir
  dz_plugin_argument = include_dotfiles = 1
  dz_plugin_argument = exclude_file = bad
  dz_plugin_argument = exclude_file = bad2

prereq_to

This determines where dependencies get injected.

Default is:

  develop.requires

And a special value

  none

Prevents dependency injection.

This attribute may be specified multiple times.

AUTHOR

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.

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