Weaver/Role/Plugin.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 37 / 37 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Weaver/Role/Finalizer.pm ↑ Summary Weaver/Role/Preparer.pm »
1 package Pod::Weaver::Role::Plugin 4.022;
2 # ABSTRACT: a Pod::Weaver plugin
3  
4 10 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # BEGIN BOILERPLATE
7 10 ▶use v5.22.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 10 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 10 ▶no feature 'switch';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 10 ▶use experimental qw(postderef postderef_qq); # This experiment gets mainlined.
Subroutine BEGIN: called CC=1 SCAR=0.0
12 # END BOILERPLATE
13  
14 10 ▶use Params::SomeUtil qw(_HASHLIKE);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 10 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 #pod =head1 IMPLEMENTING
19 #pod
20 #pod This is the most basic role that all plugins must perform.
21 #pod
22 #pod =attr plugin_name
23 #pod
24 #pod This name must be unique among all other plugins loaded into a weaver. In
25 #pod general, this will be set up by the configuration reader.
26 #pod
27 #pod =cut
28  
29 10 has plugin_name => (
30 is => 'ro',
31 isa => 'Str',
32 required => 1,
33 );
34  
35 #pod =attr weaver
36 #pod
37 #pod This is the Pod::Weaver object into which the plugin was loaded. In general,
38 #pod this will be set up when the weaver is instantiated from config.
39 #pod
40 #pod =cut
41  
42 10 has weaver => (
43 is => 'ro',
44 isa => 'Pod::Weaver',
45 required => 1,
46 weak_ref => 1,
47 );
48  
49 has logger => (
50 is => 'ro',
51 lazy => 1,
52 handles => [ qw(log log_debug log_fatal) ],
53 161 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
54 161 $_[0]->weaver->logger->proxy({
55 proxy_prefix => '[' . $_[0]->plugin_name . '] ',
56 });
57 },
58 10 );
59  
60 10 1;
61  
62 __END__
« Weaver/Role/Finalizer.pm ↑ Summary Weaver/Role/Preparer.pm »