Pod/Weaver/Section/Author/HAYOBAAN/Bugs.pm

filter: Statementstmt 57.5% 19 / 33 Branchbran 10.0% 1 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 46.3% 25 / 54 CC 7 SCAR 33.1
CC
7
Cov
43%
weave_section
42.3
BEGIN
1.0
BEGIN
1.0
CRAP 27.3
« Dist/Zilla/Plugin/Author/HAYOBAAN/NextVersion.pm ↑ Summary Pod/Weaver/PluginBundle/Author/HAYOBAAN.pm »
1 package Pod::Weaver::Section::Author::HAYOBAAN::Bugs;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Improved version of Pod::Weaver::Section::Bugs, adds proper links to the BUGS pod section
6 3 our $VERSION = '0.016'; # VERSION
7  
8 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 with 'Pod::Weaver::Role::Section';
11  
12 #pod =head1 OVERVIEW
13 #pod
14 #pod Just like the original L<Section::Bugs|Pod::Weaver::Section::Bugs>
15 #pod plugin, this section plugin will produce a hunk of Pod giving bug
16 #pod reporting information for the document. However, instead of a
17 #pod text-only link, this plugin will create a proper, clickable, link.
18 #pod
19 #pod =head1 USAGE
20 #pod
21 #pod Add the following line to your F<weaver.ini>:
22 #pod
23 #pod [Author::HAYOBAAN::Bugs]
24 #pod
25 #pod =head1 SEE ALSO
26 #pod
27 #pod =for :list
28 #pod * The original L<Section::Bugs|Pod::Weaver::Section::Bugs> plugin.
29 #pod
30 #pod =cut
31  
32 #pod =attr header
33 #pod
34 #pod The title of the header to be added.
35 #pod
36 #pod Default: C<BUGS>
37 #pod
38 #pod =cut
39  
40 3 has header => (
41 is => 'ro',
42 isa => 'Str',
43 default => 'BUGS',
44 );
45  
46 #pod =for Pod::Coverage weave_section
47 #pod
48 #pod =cut
49  
50 1 ▶sub weave_section {
Subroutine weave_section: called CC=7 SCAR=37.5
Pod undocumented
51 1 my ($self, $document, $input) = @_;
52  
53 1 ▶ return unless exists $input->{distmeta}{resources}{bugtracker};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $input->{"distmeta"}{"resources"}{"bugtracker"} 1 0 1
54  
55 0 my $bugtracker = $input->{distmeta}{resources}{bugtracker};
56 0 my ($web,$mailto) = @{$bugtracker}{qw/web mailto/};
57 0 ▶ return unless defined $web || defined $mailto;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $web or defined $mailto 0 0 0
Condition0%0/3
defined $web or defined $mailto
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $web or defined $mailto
defined $web defined $mailto
Truth table0%0/3
A or B
A= defined $webB= defined $mailto
ABresult
1X1
011
000
58  
59 0 my $text = "Please report any bugs or feature requests ";
60  
61 0 ▶ if (defined $web) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $web) 0 0 0
62 0 $text .= "on the bugtracker\nL<website|$web>";
63 0 ▶ $text .= defined $mailto ? "\n or " : ".\n";
Branch: 1 branch
BranchTrueFalseTotal
defined $mailto ? : 0 0 0
64 }
65  
66 0 ▶ if (defined $mailto) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mailto) 0 0 0
67 0 $text .= "by L<email|mailto:$mailto>.\n";
68 }
69  
70 0 $text .= <<'HERE';
71  
72 When submitting a bug or request, please include a test-file or a
73 patch to an existing test-file that illustrates the bug or desired
74 feature.
75 HERE
76  
77 0 push @{ $document->children },
78 Pod::Elemental::Element::Nested->new({
79 command => 'head1',
80 content => $self->header,
81 children => [
82 Pod::Elemental::Element::Pod5::Ordinary->new({ content => $text }),
83 ],
84 });
85  
86 0 return;
87 }
88  
89 3 __PACKAGE__->meta->make_immutable;
90 3 1;
91  
92 __END__
« Dist/Zilla/Plugin/Author/HAYOBAAN/NextVersion.pm ↑ Summary Pod/Weaver/PluginBundle/Author/HAYOBAAN.pm »