line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
15
|
|
|
15
|
|
6161
|
use strict; |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
355
|
|
2
|
15
|
|
|
15
|
|
64
|
use warnings; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
606
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::API::Favorite; |
4
|
|
|
|
|
|
|
# ABSTRACT: Favorite ++ information for MetaCPAN::API |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.51'; |
7
|
|
|
|
|
|
|
|
8
|
15
|
|
|
15
|
|
71
|
use Carp; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
595
|
|
9
|
15
|
|
|
15
|
|
75
|
use Moo::Role; |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
79
|
|
10
|
15
|
|
|
15
|
|
4228
|
use namespace::autoclean; |
|
15
|
|
|
|
|
36
|
|
|
15
|
|
|
|
|
89
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# /favorite/_search only |
13
|
|
|
|
|
|
|
sub favorite { |
14
|
3
|
|
|
3
|
1
|
2936
|
my $self = shift; |
15
|
3
|
100
|
|
|
|
14
|
my %opts = @_ ? @_ : (); |
16
|
3
|
|
|
|
|
7
|
my $url = ''; |
17
|
3
|
|
|
|
|
5
|
my $error = "Only 'search' can be used here"; |
18
|
|
|
|
|
|
|
|
19
|
3
|
100
|
|
|
|
140
|
%opts or croak $error; |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
3
|
my %extra_opts = (); |
22
|
|
|
|
|
|
|
|
23
|
2
|
100
|
|
|
|
7
|
if ( defined ( my $search_opts = $opts{'search'} ) ) { |
24
|
1
|
50
|
33
|
|
|
11
|
ref $search_opts && ref $search_opts eq 'HASH' |
25
|
|
|
|
|
|
|
or croak $error; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
4
|
%extra_opts = %{$search_opts}; |
|
1
|
|
|
|
|
4
|
|
28
|
1
|
|
|
|
|
3
|
$url = 'favorite/_search'; |
29
|
|
|
|
|
|
|
} else { |
30
|
1
|
|
|
|
|
62
|
croak $error; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
6
|
return $self->fetch( $url, %extra_opts ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |