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