| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::Gnats::Command::DBDESC; | 
| 2 | 40 |  |  | 40 |  | 214 | use parent 'Net::Gnats::Command'; | 
|  | 40 |  |  |  |  | 81 |  | 
|  | 40 |  |  |  |  | 200 |  | 
| 3 | 40 |  |  | 40 |  | 2386 | use strictures; | 
|  | 40 |  |  |  |  | 59 |  | 
|  | 40 |  |  |  |  | 185 |  | 
| 4 |  |  |  |  |  |  | BEGIN { | 
| 5 | 40 |  |  | 40 |  | 3134 | $Net::Gnats::Command::DBDESC::VERSION = '0.21'; | 
| 6 |  |  |  |  |  |  | } | 
| 7 | 40 |  |  | 40 |  | 183 | use vars qw($VERSION); | 
|  | 40 |  |  |  |  | 47 |  | 
|  | 40 |  |  |  |  | 1602 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 40 |  |  | 40 |  | 228 | use Net::Gnats::Constants qw(CODE_INFORMATION CODE_INVALID_DATABASE CODE_CMD_ERROR); | 
|  | 40 |  |  |  |  | 71 |  | 
|  | 40 |  |  |  |  | 8319 |  | 
| 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 | 9 | my ( $class, %options ) = @_; | 
| 46 |  |  |  |  |  |  |  | 
| 47 | 3 |  |  |  |  | 9 | my $self = bless \%options, $class; | 
| 48 | 3 |  | 100 |  |  | 23 | $self->{name} = $self->{name} || ''; | 
| 49 | 3 |  |  |  |  | 10 | 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 |  |  |  | 9 | return 1 if $self->response->code == CODE_INFORMATION; | 
| 60 | 2 |  |  |  |  | 12 | return 0; | 
| 61 |  |  |  |  |  |  | } | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | 1; |