| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::Gnats::Command::RSET; | 
| 2 | 40 |  |  | 40 |  | 185 | use parent 'Net::Gnats::Command'; | 
|  | 40 |  |  |  |  | 57 |  | 
|  | 40 |  |  |  |  | 260 |  | 
| 3 | 40 |  |  | 40 |  | 2298 | use strictures; | 
|  | 40 |  |  |  |  | 61 |  | 
|  | 40 |  |  |  |  | 189 |  | 
| 4 |  |  |  |  |  |  | BEGIN { | 
| 5 | 40 |  |  | 40 |  | 3196 | $Net::Gnats::Command::RSET::VERSION = '0.21'; | 
| 6 |  |  |  |  |  |  | } | 
| 7 | 40 |  |  | 40 |  | 255 | use vars qw($VERSION); | 
|  | 40 |  |  |  |  | 57 |  | 
|  | 40 |  |  |  |  | 1815 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 40 |  |  | 40 |  | 199 | use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR); | 
|  | 40 |  |  |  |  | 65 |  | 
|  | 40 |  |  |  |  | 7928 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | =head1 NAME | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | Net::Gnats::Command::RSET | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | Used to reset the internal server state. The current query expression | 
| 18 |  |  |  |  |  |  | is cleared, and the index of PRs may be reread if it has been updated | 
| 19 |  |  |  |  |  |  | since the start of the session. | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | =head1 PROTOCOL | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | RSET | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | =head1 RESPONSES | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | The possible responses are: | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | 210 (CODE_OK) | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | The state has been reset. | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | 440 (CODE_CMD_ERROR) | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | One or more arguments were supplied to the command. | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | 6xx (internal error) | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | There were problems resetting the state (usually because the index | 
| 40 |  |  |  |  |  |  | could not be reread). The session will be immediately terminated. | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | =cut | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | my $c = 'RSET'; | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | sub new { | 
| 47 | 13 |  |  | 13 | 1 | 30 | my ( $class, %options ) = @_; | 
| 48 |  |  |  |  |  |  |  | 
| 49 | 13 |  |  |  |  | 48 | my $self = bless {}, $class; | 
| 50 | 13 |  |  |  |  | 59 | return $self; | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | sub as_string { | 
| 54 | 30 |  |  | 30 | 1 | 36 | my $self = shift; | 
| 55 | 30 |  |  |  |  | 82 | return $c; | 
| 56 |  |  |  |  |  |  | } | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | sub is_ok { | 
| 59 | 15 |  |  | 15 | 0 | 22 | my $self = shift; | 
| 60 | 15 | 50 |  |  |  | 46 | return 0 if not defined $self->response; | 
| 61 | 15 | 50 |  |  |  | 37 | return 0 if not defined $self->response->code; | 
| 62 | 15 | 100 |  |  |  | 38 | return 1 if $self->response->code == CODE_OK; | 
| 63 | 2 |  |  |  |  | 8 | return 0; | 
| 64 |  |  |  |  |  |  | } | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | 1; |