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