line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::SearchV3; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
our $VERSION = '0.01039'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Github v3 Search API |
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
80
|
use Moo; |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
66
|
|
7
|
14
|
|
|
14
|
|
3496
|
use Carp qw( croak ); |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
3506
|
|
8
|
|
|
|
|
|
|
extends 'Pithub::Base'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub issues { |
12
|
1
|
|
|
1
|
1
|
5786
|
my $self = shift; |
13
|
1
|
|
|
|
|
7
|
return $self->_search('issues', @_); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub repos { |
18
|
1
|
|
|
1
|
1
|
1279
|
my $self = shift; |
19
|
1
|
|
|
|
|
6
|
return $self->_search('repositories', @_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub users { |
24
|
1
|
|
|
1
|
1
|
1282
|
my $self = shift; |
25
|
1
|
|
|
|
|
7
|
return $self->_search('users', @_); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub code { |
30
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
31
|
0
|
|
|
|
|
0
|
return $self->_search('code', @_); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _search { |
35
|
3
|
|
|
3
|
|
75
|
my ( $self, $thing_to_search, %args ) = @_; |
36
|
3
|
50
|
|
|
|
16
|
croak 'Missing key in parameters: q' unless exists $args{q}; |
37
|
|
|
|
|
|
|
return $self->request( |
38
|
|
|
|
|
|
|
method => 'GET', |
39
|
|
|
|
|
|
|
path => '/search/' . $thing_to_search, |
40
|
|
|
|
|
|
|
query => { |
41
|
|
|
|
|
|
|
q => delete $args{q}, |
42
|
|
|
|
|
|
|
(exists $args{sort} ? (sort => delete $args{sort}) : ()), |
43
|
3
|
50
|
|
|
|
57
|
(exists $args{order} ? (order => delete $args{order}) : ()), |
|
|
50
|
|
|
|
|
|
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
%args, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |