lib/App/gh/Command/Drop.pm

filter: Statementstmt 44.8% 13 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 38.6% 17 / 44 CC 4 SCAR 23.5
CC
4
Cov
36%
run
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 10.5
« blib/lib/App/gh/Command/Upload.pm ↑ Summary lib/App/gh/Command/Push.pm »
1 package App::gh::Command::Drop;
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base qw(App::gh::Command);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use App::gh::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 App::gh::Command::Drop - drop a repository.
10  
11 =head1 USAGE
12  
13 $ gh drop [repository]
14  
15 =cut
16  
17 0 ▶sub run {
Subroutine run: not called CC=4 SCAR=30.0
Pod undocumented
18 0 my ($self,$repo) = @_;
19 0 ▶ return App::gh::Command->invoke('help', 'drop')
Branch: 1 branch
BranchTrueFalseTotal
unless defined $repo 0 0 0
20 unless defined $repo;
21  
22 0 my $gh_id = App::gh->config->github_id();
23 0 my $gh_token = App::gh->config->github_token();
24  
25 0 $repo =~ s{::}{-}g;
26  
27 0 ▶ unless( $gh_id && $gh_token ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($gh_id and $gh_token) 0 0 0
Condition0%0/3
$gh_id and $gh_token
!ll&&!rl&&r
000
MC/DC0%0/2
$gh_id and $gh_token
$gh_id $gh_token
Truth table0%0/3
A and B
A= $gh_idB= $gh_token
ABresult
0X0
100
111
28 0 die "Github authtoken not found. Can not delete repository.\n";
29 }
30  
31 0 print "Deleting @{[ $gh_id ]}/@{[ $repo ]}\n";
32  
33 # repos/delete/:user/:repo
34 0 my $uri = sprintf( qq{repos/delete/%s/%s}, $gh_id , $repo );
35 0 my $ret = App::gh->api->request(POST => $uri);
36 0 my $delete_token = $ret->{delete_token};
37 0 $ret = App::gh->api->request(POST => $uri, delete_token => $delete_token);
38 0 print $ret->{status} , "\n";
39 0 return;
40 }
41  
42  
43  
44  
45  
46 1 1;
« blib/lib/App/gh/Command/Upload.pm ↑ Summary lib/App/gh/Command/Push.pm »