line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
15
|
|
|
15
|
|
7145
|
use strict; |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
517
|
|
2
|
15
|
|
|
15
|
|
69
|
use warnings; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
662
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::API::Favorite; |
4
|
|
|
|
|
|
|
# ABSTRACT: Favorite ++ information for MetaCPAN::API |
5
|
|
|
|
|
|
|
$MetaCPAN::API::Favorite::VERSION = '0.50'; |
6
|
15
|
|
|
15
|
|
67
|
use Carp; |
|
15
|
|
|
|
|
18
|
|
|
15
|
|
|
|
|
789
|
|
7
|
15
|
|
|
15
|
|
67
|
use Moo::Role; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
77
|
|
8
|
15
|
|
|
15
|
|
4258
|
use namespace::autoclean; |
|
15
|
|
|
|
|
37
|
|
|
15
|
|
|
|
|
101
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# /favorite/_search only |
11
|
|
|
|
|
|
|
sub favorite { |
12
|
3
|
|
|
3
|
1
|
2294
|
my $self = shift; |
13
|
3
|
100
|
|
|
|
12
|
my %opts = @_ ? @_ : (); |
14
|
3
|
|
|
|
|
5
|
my $url = ''; |
15
|
3
|
|
|
|
|
4
|
my $error = "Only 'search' can be used here"; |
16
|
|
|
|
|
|
|
|
17
|
3
|
100
|
|
|
|
162
|
%opts or croak $error; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
3
|
my %extra_opts = (); |
20
|
|
|
|
|
|
|
|
21
|
2
|
100
|
|
|
|
6
|
if ( defined ( my $search_opts = $opts{'search'} ) ) { |
22
|
1
|
50
|
33
|
|
|
12
|
ref $search_opts && ref $search_opts eq 'HASH' |
23
|
|
|
|
|
|
|
or croak $error; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
3
|
%extra_opts = %{$search_opts}; |
|
1
|
|
|
|
|
4
|
|
26
|
1
|
|
|
|
|
2
|
$url = 'favorite/_search'; |
27
|
|
|
|
|
|
|
} else { |
28
|
1
|
|
|
|
|
82
|
croak $error; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
6
|
return $self->fetch( $url, %extra_opts ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |