File Coverage

blib/lib/Pod/Weaver/PluginBundle/Author/AJNN/Author.pm
Criterion Covered Total %
statement 25 26 96.1
branch 2 4 50.0
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 35 39 89.7


line stmt bran cond sub pod time code
1 2     2   1443 use 5.026;
  2         6  
2 2     2   11 use warnings;
  2         3  
  2         111  
3              
4             # ABSTRACT: Pod section naming the author
5             $Pod::Weaver::PluginBundle::Author::AJNN::Author::VERSION = '0.02';
6              
7             use Carp qw(croak);
8 2     2   11 use Moose;
  2         4  
  2         97  
9 2     2   446 use namespace::autoclean;
  2         390928  
  2         13  
10 2     2   12154 use Pod::Elemental::Element::Nested;
  2         6850  
  2         12  
11 2     2   522 use Pod::Elemental::Element::Pod5::Ordinary;
  2         215047  
  2         56  
12 2     2   424  
  2         62162  
  2         436  
13             with 'Pod::Weaver::Role::Section';
14              
15              
16             our $HEADER = 'AUTHOR';
17              
18              
19             my ($self, $document, $input) = @_;
20            
21 1     1 0 16069 my $author = $input->{authors}->[0];
22            
23 1         4 croak "Unsupported declaration of multiple authors in dist.ini" if $input->{authors}->@* > 1;
24              
25 1 50       4 if ( $author =~ m/<ajnn\@cpan\.org>/ ) {
26             $author .= <<~END;
27 1 50       6 \n
28 0         0 If you contact me by email, please make sure you include the word
29             "Perl" in your subject header to help beat the spam filters.
30             END
31             }
32            
33             push $document->children->@*, Pod::Elemental::Element::Nested->new({
34             command => 'head1',
35 1         22 content => $HEADER,
36             children => [ Pod::Elemental::Element::Pod5::Ordinary->new({
37             content => $author,
38             })],
39             });
40             }
41              
42              
43             __PACKAGE__->meta->make_immutable;
44              
45             1;
46              
47              
48             =pod
49              
50             =encoding UTF-8
51              
52             =head1 NAME
53              
54             Pod::Weaver::PluginBundle::Author::AJNN::Author - Pod section naming the author
55              
56             =head1 VERSION
57              
58             version 0.02
59              
60             =head1 SYNOPSIS
61              
62             package Pod::Weaver::PluginBundle::Author::AJNN;
63            
64             use Pod::Weaver::PluginBundle::Author::AJNN::Author;
65            
66             sub mvp_bundle_config {
67             return (
68             ...,
69             [ '@AJNN/Author', __PACKAGE__ . '::Author', {}, ],
70             )
71             }
72              
73             =head1 DESCRIPTION
74              
75             This package provides AJNN's customised author statement.
76              
77             In particular, if AJNN is declared as a distribution's only author,
78             a note is added that may help spam filtering.
79              
80             =head1 BUGS
81              
82             Multiple authors are unsupported.
83              
84             =head1 SEE ALSO
85              
86             L<Pod::Weaver::PluginBundle::Author::AJNN>
87              
88             L<Pod::Weaver::Section::Authors>
89              
90             =head1 AUTHOR
91              
92             Arne Johannessen <ajnn@cpan.org>
93              
94             If you contact me by email, please make sure you include the word
95             "Perl" in your subject header to help beat the spam filters.
96              
97             =head1 COPYRIGHT AND LICENSE
98              
99             Arne Johannessen has dedicated the work to the Commons by waiving all of his
100             or her rights to the work worldwide under copyright law and all related or
101             neighboring legal rights he or she had in the work, to the extent allowable by
102             law.
103              
104             Works under CC0 do not require attribution. When citing the work, you should
105             not imply endorsement by the author.
106              
107             =cut