File Coverage

blib/lib/Pod/Weaver/Section/BugsRT.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Pod::Weaver::Section::BugsRT;
2             $Pod::Weaver::Section::BugsRT::VERSION = '0.52';
3              
4             # ABSTRACT: Add a BUGS pod section for rt.cpan.org
5              
6 1     1   1405 use Moose;
  0            
  0            
7              
8             with 'Pod::Weaver::Role::Section';
9              
10             use Moose::Autobox;
11              
12              
13             sub weave_section {
14             my ($self, $document, $input) = @_;
15              
16             my $zilla = $input->{zilla} or return;
17             my $name = $zilla->name;
18              
19             my $bugtracker =
20             sprintf 'http://rt.cpan.org/Public/Dist/Display.html?Name=%s', $name;
21              
22             # I prefer all lower case emails.
23             my $email = "bug-".lc($name).'@rt.cpan.org';
24              
25             my $text =
26             "Please report any bugs or feature requests to $email ".
27             "or through the web interface at:\n".
28             " $bugtracker";
29              
30             $document->children->push(
31             Pod::Elemental::Element::Nested->new({
32             command => 'head1',
33             content => 'BUGS',
34             children => [
35             Pod::Elemental::Element::Pod5::Ordinary->new({content => $text}),
36             ],
37             }),
38             );
39             }
40              
41             no Moose;
42             1;
43              
44              
45              
46             =pod
47              
48             =head1 NAME
49              
50             Pod::Weaver::Section::BugsRT - Add a BUGS pod section for rt.cpan.org
51              
52             =head1 VERSION
53              
54             version 0.52
55              
56             =head1 SYNOPSIS
57              
58             In C<weaver.ini>:
59              
60             [BugsRT]
61              
62             =head1 OVERVIEW
63              
64             This section plugin will produce a hunk of Pod that describes how to report bugs to rt.cpan.org.
65              
66             =head1 METHODS
67              
68             =head2 weave_section
69              
70             adds the BUGS section.
71              
72             =head1 AUTHOR
73              
74             Michael Schout <mschout@cpan.org>
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             This software is copyright (c) 2010 by Michael Schout.
79              
80             This is free software; you can redistribute it and/or modify it under
81             the same terms as the Perl 5 programming language system itself.
82              
83             =head1 SOURCE
84              
85             You can contribute or fork this project via github:
86              
87             http://github.com/mschout/pod-weaver-section-bugsrt
88              
89             git clone git://github.com/mschout/pod-weaver-section-bugsrt.git
90              
91             =head1 BUGS
92              
93             Please report any bugs or feature requests to bug-pod-weaver-section-bugsrt@rt.cpan.org or through the web interface at:
94             http://rt.cpan.org/Public/Dist/Display.html?Name=Pod-Weaver-Section-BugsRT
95              
96             =cut
97              
98              
99             __END__
100