line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
19
|
|
|
19
|
|
121
|
use strict; |
|
19
|
|
|
|
|
40
|
|
|
19
|
|
|
|
|
507
|
|
2
|
19
|
|
|
19
|
|
106
|
use warnings; |
|
19
|
|
|
|
|
44
|
|
|
19
|
|
|
|
|
704
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::Client::Package; |
4
|
|
|
|
|
|
|
# ABSTRACT: A package data object (02packages.details entry) |
5
|
|
|
|
|
|
|
$MetaCPAN::Client::Package::VERSION = '2.030000'; |
6
|
19
|
|
|
19
|
|
115
|
use Moo; |
|
19
|
|
|
|
|
51
|
|
|
19
|
|
|
|
|
95
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'MetaCPAN::Client::Role::Entity'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my %known_fields = ( |
11
|
|
|
|
|
|
|
scalar => [qw< author distribution dist_version file module_name version >], |
12
|
|
|
|
|
|
|
arrayref => [qw<>], |
13
|
|
|
|
|
|
|
hashref => [], |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @known_fields = |
17
|
|
|
|
|
|
|
map { @{ $known_fields{$_} } } qw< scalar arrayref hashref >; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
foreach my $field (@known_fields) { |
20
|
|
|
|
|
|
|
has $field => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
lazy => 1, |
23
|
|
|
|
|
|
|
default => sub { |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
return $self->data->{$field}; |
26
|
|
|
|
|
|
|
}, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
2
|
|
5
|
sub _known_fields { return \%known_fields } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |