| 1 | package Dist::Zilla::Plugin::HelpWanted; | ||||||||||
| 2 | 2 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | # ABSTRACT: insert 'Help Wanted' information in the distribution's META | ||||||||||
| 4 | 2 | $Dist::Zilla::Plugin::HelpWanted::VERSION = '0.3.3'; | |||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use 5.34.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use List::MoreUtils qw(uniq); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 2 | ▶ | use experimental qw/ signatures /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 2 | with qw/ | |||||||||
| 15 | Dist::Zilla::Role::Plugin | ||||||||||
| 16 | Dist::Zilla::Role::InstallTool | ||||||||||
| 17 | /; | ||||||||||
| 18 | |||||||||||
| 19 | 2 | my @positions = qw/ | |||||||||
| 20 | maintainer | ||||||||||
| 21 | co-maintainer | ||||||||||
| 22 | coder | ||||||||||
| 23 | translator | ||||||||||
| 24 | documentation | ||||||||||
| 25 | tester | ||||||||||
| 26 | documenter | ||||||||||
| 27 | developer | ||||||||||
| 28 | helper | ||||||||||
| 29 | /; | ||||||||||
| 30 | |||||||||||
| 31 | 2 | my %legacy = ( | |||||||||
| 32 | 'co-maintainer' => 'maintainer', | ||||||||||
| 33 | 'coder' => 'developer', | ||||||||||
| 34 | 'documentation' => 'documenter', | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | 2 | has [ @positions ] => ( | |||||||||
| 38 | is => 'rw', | ||||||||||
| 39 | isa => 'Bool', | ||||||||||
| 40 | default => 0, | ||||||||||
| 41 | ); | ||||||||||
| 42 | |||||||||||
| 43 | 2 | has positions => ( | |||||||||
| 44 | is => 'ro', | ||||||||||
| 45 | isa => 'Str', | ||||||||||
| 46 | default => '', | ||||||||||
| 47 | ); | ||||||||||
| 48 | |||||||||||
| 49 | 3 | ▶ | sub setup_installer($self) { | ||||||||
|
Subroutine
setup_installer: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||
| 50 | |||||||||||
| 51 | 3 | for my $p ( split ' ', $self->positions ) { | |||||||||
| 52 | 8 | ▶ | eval { $self->$p(1); 1; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | or die "position '$p' not recognized\n"; | ||||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | my @open_positions = | ||||||||||
| 57 | uniq | ||||||||||
| 58 | 10 | ▶ | map { exists($legacy{$_}) ? $legacy{$_} : $_ } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 3 | grep { $self->$_ } @positions; | |||||||||
| 60 | |||||||||||
| 61 | $self->zilla->distmeta->{x_help_wanted} = \@open_positions | ||||||||||
| 62 | 3 | ▶ | if @open_positions; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 66 | 2 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 67 | 2 | 1; | |||||||||
| 68 | |||||||||||
| 69 | __END__ | ||||||||||