/usr/share/perl5/Dist/Zilla/Role/Plugin.pm is in libdist-zilla-perl 5.043-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | package Dist::Zilla::Role::Plugin;
# ABSTRACT: something that gets plugged in to Dist::Zilla
$Dist::Zilla::Role::Plugin::VERSION = '5.043';
use Moose::Role;
with 'Dist::Zilla::Role::ConfigDumper';
use Params::Util qw(_HASHLIKE);
use MooseX::Types;
use namespace::autoclean;
#pod =head1 DESCRIPTION
#pod
#pod The Plugin role should be applied to all plugin classes. It provides a few key
#pod methods and attributes that all plugins will need.
#pod
#pod =attr plugin_name
#pod
#pod The plugin name is generally determined when configuration is read.
#pod
#pod =cut
has plugin_name => (
is => 'ro',
isa => 'Str',
required => 1,
);
#pod =attr zilla
#pod
#pod This attribute contains the Dist::Zilla object into which the plugin was
#pod plugged.
#pod
#pod =cut
has zilla => (
is => 'ro',
isa => class_type('Dist::Zilla'),
required => 1,
weak_ref => 1,
);
#pod =method log
#pod
#pod The plugin's C<log> method delegates to the Dist::Zilla object's
#pod L<Dist::Zilla/log> method after including a bit of argument-munging.
#pod
#pod =cut
has logger => (
is => 'ro',
lazy => 1,
handles => [ qw(log log_debug log_fatal) ],
default => sub {
$_[0]->zilla->chrome->logger->proxy({
proxy_prefix => '[' . $_[0]->plugin_name . '] ',
});
},
);
# We define these effectively-pointless subs here to allow other roles to
# modify them with around. -- rjbs, 2010-03-21
sub mvp_multivalue_args {};
sub mvp_aliases { return {} };
sub plugin_from_config {
my ($class, $name, $arg, $section) = @_;
my $self = $class->new({
%$arg,
plugin_name => $name,
zilla => $section->sequence->assembler->zilla,
});
}
sub register_component {
my ($class, $name, $arg, $section) = @_;
my $self = $class->plugin_from_config($name, $arg, $section);
my $version = $self->VERSION || 0;
$self->log_debug([ 'online, %s v%s', $self->meta->name, $version ]);
push @{ $self->zilla->plugins }, $self;
return;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Dist::Zilla::Role::Plugin - something that gets plugged in to Dist::Zilla
=head1 VERSION
version 5.043
=head1 DESCRIPTION
The Plugin role should be applied to all plugin classes. It provides a few key
methods and attributes that all plugins will need.
=head1 ATTRIBUTES
=head2 plugin_name
The plugin name is generally determined when configuration is read.
=head2 zilla
This attribute contains the Dist::Zilla object into which the plugin was
plugged.
=head1 METHODS
=head2 log
The plugin's C<log> method delegates to the Dist::Zilla object's
L<Dist::Zilla/log> method after including a bit of argument-munging.
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|