File Coverage

blib/lib/CPAN/ReleaseHistory/Release.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package CPAN::ReleaseHistory::Release;
2             $CPAN::ReleaseHistory::Release::VERSION = '0.16';
3 2     2   14 use Moo;
  2         4  
  2         15  
4 2     2   676 use CPAN::DistnameInfo;
  2         4  
  2         317  
5              
6             has 'path' => (is => 'ro');
7             has 'timestamp' => (is => 'ro');
8             has 'size' => (is => 'ro');
9             has 'distinfo' => (is => 'lazy');
10             has 'date' => (is => 'lazy');
11              
12             sub _build_distinfo
13             {
14 9     9   1571 my $self = shift;
15              
16 9         29 return CPAN::DistnameInfo->new($self->path);
17             }
18              
19             sub _build_date
20             {
21 9     9   787 my $self = shift;
22 9         51 my @gmt = gmtime($self->timestamp);
23              
24 9         107 return sprintf('%d-%.2d-%.2d', $gmt[5]+1900, $gmt[4]+1, $gmt[3]);
25             }
26              
27             1;
28              
29             =head1 NAME
30              
31             CPAN::ReleaseHistory::Release - data object with information about one CPAN release
32              
33             =head1 DESCRIPTION
34              
35             B
36              
37             =head1 REPOSITORY
38              
39             L
40              
41             =head1 AUTHOR
42              
43             Neil Bowers Eneilb@cpan.orgE
44              
45             =head1 COPYRIGHT AND LICENSE
46              
47             This software is copyright (c) 2014 by Neil Bowers .
48              
49             This is free software; you can redistribute it and/or modify it under
50             the same terms as the Perl 5 programming language system itself.
51              
52             =cut