Command/webdelete.pm

filter: Statementstmt 43.7% 7 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 0.0% 0 / 1 totaltotal 36.3% 8 / 22 CC 2 SCAR 12.6
CC
2
Cov
39%
run
6.0
__ANON__
1.1
BEGIN
1.0
CRAP 3.5
« Command/delete.pm ↑ Summary Base.pm »
1 package PMLTQ::Command::webdelete;
2 1 our $AUTHORITY = 'cpan:MATY';
3 1 $PMLTQ::Command::webdelete::VERSION = '2.0.3';
4 # ABSTRACT: Remove treebank from web interface
5  
6 1 ▶use PMLTQ::Base 'PMLTQ::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶has usage => sub { shift->extract_usage };
Subroutine __ANON__: not called CC=1 SCAR=1.2
9  
10 0 ▶sub run {
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
11 0 my $self = shift;
12 0 my $ua = $self->ua;
13 0 $self->login($ua);
14 0 my $json = JSON->new;
15 0 my $treebank = $self->get_treebank($ua);
16 0 ▶ if($treebank) {
Branch: 1 branch
BranchTrueFalseTotal
if ($treebank) { } 0 0 0
17 0 $self->request_treebank($treebank,$ua,'DELETE');
18 } else {
19 0 print STDERR "Treebank '".$self->config->{title}."' is not at ".$self->config->{web_api}->{url}.".\n"
20 }
21 }
22  
23 =head1 SYNOPSIS
24  
25 pmltq webdelete <treebank_config>
26  
27 =head1 DESCRIPTION
28  
29 Remove treebank from web interface.
30  
31 =head1 OPTIONS
32  
33 =head1 PARAMS
34  
35 =over 5
36  
37 =item B<treebank_config>
38  
39 Path to configuration file. If a treebank_config is --, config is readed from STDIN.
40  
41 =back
42  
43 =cut
44  
45 1 1;
« Command/delete.pm ↑ Summary Base.pm »