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::Util::PluginLoader - Inflate a Legal Dist::Zilla Plugin from basic parts

VERSION

version 0.001003

SYNOPSIS

use Dist::Zilla::Util::PluginLoader;

my $loader = Dist::Zilla::Util::PluginLoader->new( sequence => $sequence );
$loader->load( $plugin, $name, [ key => value , key => value ]);
$loader->load_ini( $plugin, $name, [ 'key = value', 'key = value' ] );

METHODS

load

Load a Dist::Zilla plugin meeting specification.

Signatures:

void load( $self, $plugin )
void load( $self, $plugin, \@args );
void load( $self, $plugin, $name  );
void load( $self, $plugin, $name, \@args );

$plugin is Str ( Dist::Zilla Plugin )
$name   is Str ( Dist::Zilla Section Name )
@args   is ArrayRef
            num items == even
            key => value pairs of scalars.

Constructs an instance of $plugin, using $name where possible, and uses @args to populate the MVP properties for that $plugin, and then injects it to the ->sequence passed earlier.

load_ini

Load a Dist::Zilla plugin meeting specification with unparsed INI key = value strings.

Signatures:

void load( $self, $plugin )
void load( $self, $plugin, \@args );
void load( $self, $plugin, $name  );
void load( $self, $plugin, $name, \@args );

$plugin is Str ( Dist::Zilla Plugin )
$name   is Str ( Dist::Zilla Section Name )
@args   is ArrayRef of Str
          each Str is 'key = value'

Constructs an instance of $plugin, using $name where possible, and parses and uses @args to populate the MVP properties for that $plugin, and then injects it to the ->sequence passed earlier.

ATTRIBUTES

sequence

A Config::MVP::Sequence object.

The easiest way to get one of those is:

around plugin_from_config {
  my ($orig,$self,$name,$arg, $section ) = @_;
                              ^^^^^^^^
}

assembler

A Config::MVP::Assembler

Defaults to sequence->assembler

section_class

Defaults to assembler->section_class

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.