| 1 | package Net::Gnats::Command::RSET; | ||||||||||
| 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::RSET::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_OK CODE_CMD_ERROR); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 | 40 | my $c = 'RSET'; | |||||||||
| 45 | |||||||||||
| 46 | 13 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 47 | 13 | my ( $class, %options ) = @_; | |||||||||
| 48 | |||||||||||
| 49 | 13 | my $self = bless {}, $class; | |||||||||
| 50 | 13 | return $self; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 30 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 54 | 30 | my $self = shift; | |||||||||
| 55 | 30 | return $c; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 15 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||
| 59 | 15 | my $self = shift; | |||||||||
| 60 | 15 | ▶ | return 0 if not defined $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | 15 | ▶ | return 0 if not defined $self->response->code; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 15 | ▶ | return 1 if $self->response->code == CODE_OK; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | 2 | return 0; | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 40 | 1; | |||||||||