line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::DBDESC; |
2
|
40
|
|
|
40
|
|
164
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
46
|
|
|
40
|
|
|
|
|
182
|
|
3
|
40
|
|
|
40
|
|
2054
|
use strictures; |
|
40
|
|
|
|
|
51
|
|
|
40
|
|
|
|
|
162
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
2892
|
$Net::Gnats::Command::DBDESC::VERSION = '0.20'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
175
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
46
|
|
|
40
|
|
|
|
|
1482
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
189
|
use Net::Gnats::Constants qw(CODE_INFORMATION CODE_INVALID_DATABASE CODE_CMD_ERROR); |
|
40
|
|
|
|
|
59
|
|
|
40
|
|
|
|
|
7442
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::DEDESC |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Returns a human-readable description of the specified database. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 PROTOCOL |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
DBDESC [database] |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 RESPONSES |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Responses include: |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
6xx (internal error) An internal error was encountered while trying |
28
|
|
|
|
|
|
|
to read the list of available databases, usually due to lack of |
29
|
|
|
|
|
|
|
permissions or other filesystem-related problems, or the list of |
30
|
|
|
|
|
|
|
databases is empty. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
350 (CODE_INFORMATION) The normal response; the supplied text is the |
33
|
|
|
|
|
|
|
database description. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
417 (CODE_INVALID_DATABASE) The specified database name does not |
36
|
|
|
|
|
|
|
have an entry. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) Required parameter not passed. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $c = 'DBDESC'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
45
|
3
|
|
|
3
|
1
|
5
|
my ( $class, %options ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
6
|
my $self = bless \%options, $class; |
48
|
3
|
|
100
|
|
|
15
|
$self->{name} = $self->{name} || ''; |
49
|
3
|
|
|
|
|
7
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub to_string { |
53
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
54
|
0
|
|
|
|
|
0
|
return $c . ' ' . $self->{name}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub is_ok { |
58
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
59
|
3
|
100
|
|
|
|
7
|
return 1 if $self->response->code == CODE_INFORMATION; |
60
|
2
|
|
|
|
|
9
|
return 0; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |