« 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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
defined $web or defined $mailto
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
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | my $text = "Please report any bugs or feature requests "; | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 0 | ▶ | if (defined $web) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 62 | 0 | $text .= "on the bugtracker\nL<website|$web>"; | |||||||||||||||||||||||||||
| 63 | 0 | ▶ | $text .= defined $mailto ? "\n or " : ".\n"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if (defined $mailto) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||