line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Slackeria::Plugin::GitHub; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4637741
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
122
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
100
|
|
5
|
1
|
|
|
1
|
|
150
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
966
|
use parent 'App::Slackeria::Plugin'; |
|
1
|
|
|
|
|
649
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1023
|
use Net::GitHub; |
|
1
|
|
|
|
|
353055
|
|
|
1
|
|
|
|
|
13
|
|
10
|
1
|
|
|
1
|
|
1063
|
use Sort::Versions; |
|
1
|
|
|
|
|
1020
|
|
|
1
|
|
|
|
|
428
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub check { |
15
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $github = Net::GitHub->new( |
18
|
|
|
|
|
|
|
owner => $self->{conf}->{owner}, |
19
|
|
|
|
|
|
|
repo => $self->{conf}->{name}, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
0
|
|
|
|
$self->{conf}->{href} //= 'http://github.com/%s/%s'; |
23
|
0
|
|
|
|
|
|
my $href = sprintf( |
24
|
|
|
|
|
|
|
$self->{conf}->{href}, |
25
|
|
|
|
|
|
|
$self->{conf}->{owner}, |
26
|
|
|
|
|
|
|
$self->{conf}->{name}, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $tags = $github->repos()->tags(); |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if ( $tags->{error} ) { |
32
|
0
|
|
|
|
|
|
die( $tags->{error} ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
if ( not keys %{$tags} ) { |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
return { |
37
|
0
|
|
|
|
|
|
data => q{}, |
38
|
|
|
|
|
|
|
href => $href, |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
return { |
43
|
0
|
|
|
|
|
|
data => ( sort { versioncmp( $a, $b ) } keys %{$tags} )[-1], |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
href => $href, |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |