line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
15
|
|
|
15
|
|
102897
|
use strict; |
|
15
|
|
|
|
|
36
|
|
|
15
|
|
|
|
|
389
|
|
2
|
15
|
|
|
15
|
|
73
|
use warnings; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
633
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::API::Author; |
4
|
|
|
|
|
|
|
# ABSTRACT: Author information for MetaCPAN::API |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.51'; |
7
|
|
|
|
|
|
|
|
8
|
15
|
|
|
15
|
|
77
|
use Carp; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
746
|
|
9
|
15
|
|
|
15
|
|
86
|
use Moo::Role; |
|
15
|
|
|
|
|
39
|
|
|
15
|
|
|
|
|
83
|
|
10
|
15
|
|
|
15
|
|
5232
|
use namespace::autoclean; |
|
15
|
|
|
|
|
35
|
|
|
15
|
|
|
|
|
126
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# /author/{author} |
13
|
|
|
|
|
|
|
sub author { |
14
|
2
|
|
|
2
|
1
|
1530
|
my $self = shift; |
15
|
2
|
|
|
|
|
5
|
my ( $pause_id, $url, %extra_opts ); |
16
|
|
|
|
|
|
|
|
17
|
2
|
100
|
|
|
|
7
|
if ( @_ == 1 ) { |
|
|
50
|
|
|
|
|
|
18
|
1
|
|
|
|
|
4
|
$url = 'author/' . shift; |
19
|
|
|
|
|
|
|
} elsif ( @_ == 2 ) { |
20
|
0
|
|
|
|
|
0
|
my %opts = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
0
|
if ( defined $opts{'pauseid'} ) { |
|
|
0
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
$url = "author/" . $opts{'pauseid'}; |
24
|
|
|
|
|
|
|
} elsif ( defined $opts{'search'} ) { |
25
|
0
|
|
|
|
|
0
|
my $search_opts = $opts{'search'}; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
0
|
|
|
0
|
ref $search_opts && ref $search_opts eq 'HASH' |
28
|
|
|
|
|
|
|
or croak "'search' key must be hashref"; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
%extra_opts = %{$search_opts}; |
|
0
|
|
|
|
|
0
|
|
31
|
0
|
|
|
|
|
0
|
$url = 'author/_search'; |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
0
|
croak 'Unknown option given'; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} else { |
36
|
1
|
|
|
|
|
133
|
croak 'Please provide an author PAUSEID or a "search"'; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
7
|
return $self->fetch( $url, %extra_opts ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |