line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Slackeria::Plugin::CPAN; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1229090
|
use strict; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
280
|
|
4
|
1
|
|
|
1
|
|
17
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
133
|
|
5
|
1
|
|
|
1
|
|
282
|
use 5.010; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
57
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
2342
|
use parent 'App::Slackeria::Plugin'; |
|
1
|
|
|
|
|
838
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
14067
|
use CPANPLUS; |
|
1
|
|
|
|
|
1051683
|
|
|
1
|
|
|
|
|
259
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
1
|
|
my ( $obj, %conf ) = @_; |
15
|
0
|
|
|
|
|
|
my $ref = {}; |
16
|
0
|
|
|
|
|
|
$ref->{default} = \%conf; |
17
|
0
|
|
0
|
|
|
|
$ref->{default}->{href} //= 'http://search.cpan.org/dist/%s/'; |
18
|
0
|
|
|
|
|
|
$ref->{cb} = CPANPLUS::Backend->new(); |
19
|
0
|
|
|
|
|
|
return bless( $ref, $obj ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub check { |
23
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
24
|
0
|
|
|
|
|
|
my $mod = $self->{cb}->parse_module( module => $self->{conf}->{name} ); |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
if ($mod) { |
27
|
0
|
|
|
|
|
|
return { data => $mod->version(), }; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
0
|
|
|
|
|
|
die("not found\n"); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |