line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
432
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
46
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Config::Identity::GitHub; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.0019'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Config::Identity; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
9
|
1
|
|
|
1
|
|
18
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
235
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $STUB = 'github'; |
12
|
1
|
|
100
|
1
|
0
|
17
|
sub STUB { defined $_ and return $_ for $ENV{CI_GITHUB_STUB}, $STUB } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub load { |
15
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
16
|
1
|
|
|
|
|
6
|
return Config::Identity->try_best( $self->STUB ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub check { |
20
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
21
|
1
|
|
|
|
|
4
|
my %identity = @_; |
22
|
1
|
|
|
|
|
4
|
my @missing; |
23
|
|
|
|
|
|
|
defined $identity{$_} && length $identity{$_} |
24
|
1
|
|
33
|
|
|
20
|
or push @missing, $_ for qw/ login token /; |
|
|
|
50
|
|
|
|
|
25
|
1
|
50
|
|
|
|
4
|
croak "Missing ", join ' and ', @missing if @missing; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub load_check { |
29
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
30
|
1
|
|
|
|
|
7
|
my %identity = $self->load; |
31
|
1
|
|
|
|
|
18
|
$self->check( %identity ); |
32
|
1
|
|
|
|
|
18
|
return %identity; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|