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 3     3   4695 use strict;
  3         5  
  3         135  
4 3     3   18 use warnings;
  3         7  
  3         114  
5 3     3   20 use base 'Acme::CPANAuthors::Utils::CPANIndex';
  3         6  
  3         2025  
6              
7 15     15   103 sub _mappings {+{author => 'authors'}}
8              
9             sub _parse {
10 5     5   10 my ($self, $file) = @_;
11              
12 5         27 my $handle = $self->_handle($file);
13              
14 3         54 while (my $line = $handle->getline) {
15 30         1540 $line =~ s/\r?\n$//;
16 30         112 my ($alias, $pauseid, $long) = split ' ', $line, 3;
17 30         105 $long =~ s/^"//;
18 30         92 $long =~ s/"$//;
19 30         141 my ($name, $email) = $long =~ /(.*) <(.+)>$/;
20 30         211 my $author = Acme::CPANAuthors::Utils::Authors::Author->new({
21             pauseid => $pauseid,
22             name => $name,
23             email => $email,
24             });
25              
26 30         697 $self->{authors}{$pauseid} = $author;
27             }
28             }
29              
30             package #
31             Acme::CPANAuthors::Utils::Authors::Author;
32              
33 3     3   25 use strict;
  3         6  
  3         101  
34 3     3   19 use warnings;
  3         7  
  3         164  
35 3     3   19 use base 'Class::Accessor::Fast';
  3         5  
  3         2436  
36              
37             __PACKAGE__->mk_ro_accessors(qw/pauseid name email/);
38              
39             1;
40              
41             __END__