File Coverage

lib/Acme/CPANAuthors/Utils/Authors.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 37 37 100.0


line stmt bran cond sub pod time code
1             package Acme::CPANAuthors::Utils::Authors;
2              
3 2     2   1118 use strict;
  2         3  
  2         64  
4 2     2   7 use warnings;
  2         2  
  2         49  
5 2     2   7 use base 'Acme::CPANAuthors::Utils::CPANIndex';
  2         2  
  2         641  
6              
7 12     12   67 sub _mappings {+{author => 'authors'}}
8              
9             sub _parse {
10 4     4   7 my ($self, $file) = @_;
11              
12 4         11 my $handle = $self->_handle($file);
13              
14 2         33 while (my $line = $handle->getline) {
15 20         614 $line =~ s/\r?\n$//;
16 20         42 my ($alias, $pauseid, $long) = split ' ', $line, 3;
17 20         43 $long =~ s/^"//;
18 20         29 $long =~ s/"$//;
19 20         51 my ($name, $email) = $long =~ /(.*) <(.+)>$/;
20 20         85 my $author = Acme::CPANAuthors::Utils::Authors::Author->new({
21             pauseid => $pauseid,
22             name => $name,
23             email => $email,
24             });
25              
26 20         347 $self->{authors}{$pauseid} = $author;
27             }
28             }
29              
30             package #
31             Acme::CPANAuthors::Utils::Authors::Author;
32              
33 2     2   13 use strict;
  2         2  
  2         51  
34 2     2   6 use warnings;
  2         2  
  2         51  
35 2     2   9 use base 'Class::Accessor::Fast';
  2         2  
  2         546  
36              
37             __PACKAGE__->mk_ro_accessors(qw/pauseid name email/);
38              
39             1;
40              
41             __END__