Gnats/Command/DBLS.pm

filter: Statementstmt 100% 23 / 23 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 66.6% 2 / 3 totaltotal 94.7% 36 / 38 CC 3 SCAR 3.4
CC
3
Cov
96%
new
2.0
is_ok
2.0
BEGIN
1.0
CRAP 1.4
« Gnats/Command/DBDESC.pm ↑ Summary Gnats/Command/DELETE.pm »
1 package Net::Gnats::Command::DBLS;
2 40 ▶use parent 'Net::Gnats::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 40 ▶use strictures;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 $Net::Gnats::Command::DBLS::VERSION = '0.22';
6 }
7 40 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 ▶use Net::Gnats::Constants qw(CODE_TEXT_READY);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 Net::Gnats::Command::DBLS
14  
15 =head1 DESCRIPTION
16  
17 Lists the known set of databases.
18  
19 The gnatsd access level listdb denies access until the user has
20 authenticated with the USER command. The only other command
21 available at this access level is DBLS. This access level provides a
22 way for a site to secure its gnats databases while still providing a
23 way for client tools to obtain a list of the databases for use on
24 login screens etc.
25  
26 The list of databases follows, one per line, using the standard
27 quoting mechanism. Only the database names are sent.
28  
29 =head1 PROTOCOL
30  
31 DBLS
32  
33 =head1 RESPONSES
34  
35 The possible responses are:
36  
37 6xx (internal error) An internal error was encountered while trying
38 to obtain the list of available databases, usually due to lack of
39 permissions or other filesystem-related problems, or the list of
40 databases is empty.
41  
42 301 (CODE_TEXT_READY)
43  
44 =cut
45  
46 40 my $c = 'DBLS';
47  
48 7 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
49 7 my ( $class ) = @_;
50 7 ▶ my %options = shift if $_;
Branch: 1 branch
BranchTrueFalseTotal
if $_ 0 7 7
51 7 my $self = bless \%options, $class;
52 7 return $self;
53 }
54  
55 18 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
56 18 return $c;
57 }
58  
59 4 ▶sub is_ok {
Subroutine is_ok: called CC=2 SCAR=6.9
Pod undocumented
60 4 my ($self) = @_;
61 4 ▶ return 1 if $self->response->code == CODE_TEXT_READY;
Branch: 1 branch
BranchTrueFalseTotal
if $self->response->code == 301 3 1 4
62 1 return 0;
63 }
64  
65 40 1;
« Gnats/Command/DBDESC.pm ↑ Summary Gnats/Command/DELETE.pm »