| 1 | package Dist::Zilla::Stash::Contributors; | ||||||||||||||||||||
| 2 | 2 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||||||||||
| 3 | # ABSTRACT: Stash containing list of contributors | ||||||||||||||||||||
| 4 | 2 | $Dist::Zilla::Stash::Contributors::VERSION = '0.1.1'; | |||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 2 | ▶ | use Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 2 | ▶ | use Dist::Zilla::Stash::Contributors::Contributor; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | has contributors => ( | ||||||||||||||||||||
| 13 | traits => [ 'Hash' ], | ||||||||||||||||||||
| 14 | isa => 'HashRef[Dist::Zilla::Stash::Contributors::Contributor]', | ||||||||||||||||||||
| 15 | is => 'ro', | ||||||||||||||||||||
| 16 | 1 | ▶ | default => sub { {} }, | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 2 | handles => { | |||||||||||||||||||
| 18 | _all_contributors => 'values', | ||||||||||||||||||||
| 19 | nbr_contributors => 'count', | ||||||||||||||||||||
| 20 | }, | ||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 2 | ▶ | sub all_contributors { | ||||||||||||||||||
|
Subroutine
all_contributors: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 25 | 2 | my $self = shift; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 2 | return sort { $a->stringify cmp $b->stringify } $self->_all_contributors; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 1 | ▶ | sub add_contributors { | ||||||||||||||||||
|
Subroutine
add_contributors: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||
| 32 | 1 | my ( $self, @contributors ) = @_; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 1 | for my $c ( @contributors ) { | |||||||||||||||||||
| 35 | 3 | my $name = $c; | |||||||||||||||||||
| 36 | 3 | my $email; | |||||||||||||||||||
| 37 | 3 | ▶ | $email = $1 if $name =~ s/\s*<(.*?)>\s*//; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 3 | my $object = Dist::Zilla::Stash::Contributors::Contributor->new( | |||||||||||||||||||
| 40 | name => $name, email => $email | ||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 3 | ▶ | $self->contributors->{ $object->stringify } ||= $object; | ||||||||||||||||||
|
Condition66%2/3
$self->contributors->{$object->stringify} ||= $object
MC/DC0%0/2
$self->contributors->{$object->stringify} ||= $object
$self->contributors->{$object->stringify}
$object
Truth table66%2/3
A ||= B
A= $self->contributors->{$object->stringify}B= $object
| |||||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||