Branch Coverage

blib/lib/Acme/CPANAuthors/Acme/CPANAuthors/Authors.pm
Criterion Covered Total %
branch 0 10 0.0


line true false branch
63 0 0 if ($chunk =~ /^Acme::CPANAuthors/ms) { }
0 0 elsif ($authsec) { }
75 0 0 defined $old{$_} ? :
78 0 0 unless @new
92 0 0 unless 'HTTP::Tiny'->new->request('GET', 'http://www.cpan.org/modules/02packages.details.txt', {'data_callback', sub { my $chunk = shift(); if ($chunk =~ /^Acme::CPANAuthors/ms) { ++$authsec; $data .= $chunk; } elsif ($authsec) { while ($data =~ m[^(?:Acme::CPANAuthors(?:::(\S+))?).+\w/\w\w/(\w+)/.+$]gm) { $authors{$2} //= []; push @{$authors{$2};}, $1; } ; my(%old) = authors(); my(@new) = grep({defined $old{$_} ? () : $_;} keys %authors); print scalar(@new) . " new Acme::CPANAuthors authors to add\n"; return unless @new; require MetaCPAN::API; my $mcpan = 'MetaCPAN::API'->new; binmode STDOUT, ':utf8'; foreach my $id (sort @new) { my $author = $mcpan->author($id); printf " %s => q[%s], # %s\n", $id, $$author{'name'}, join(', ', map({'A::C::' . $_;} @{$authors{$id};})); } ; exit; } ; } })->{'success'}