| 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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$gh_id and $gh_token
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
| |||||||||||||||||||||||||||||
| 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; | |||||||||||||||||||||||||||