| 1 | package Net::Gnats::Command::UNDB; | ||||||||||
| 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::UNDB::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_GNATS_NOT_LOCKED CODE_CMD_ERROR); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | Net::Gnats::Command::UNDB | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | Unlocks the database. Any session may steal a database lock; no | ||||||||||
| 18 | checking of any sort is done. | ||||||||||
| 19 | |||||||||||
| 20 | =head1 PROTOCOL | ||||||||||
| 21 | |||||||||||
| 22 | UNDB | ||||||||||
| 23 | |||||||||||
| 24 | =head1 RESPONSES | ||||||||||
| 25 | |||||||||||
| 26 | The possible responses are: | ||||||||||
| 27 | |||||||||||
| 28 | 200 (CODE_OK) The lock has been removed. | ||||||||||
| 29 | |||||||||||
| 30 | 432 (CODE_GNATS_NOT_LOCKED) The database was not locked. | ||||||||||
| 31 | |||||||||||
| 32 | 440 (CODE_CMD_ERROR) One or more arguments were supplied to the | ||||||||||
| 33 | command. | ||||||||||
| 34 | |||||||||||
| 35 | 6xx (internal error) The database lock could not be removed, usually | ||||||||||
| 36 | because of permissions or other filesystem-related issues. | ||||||||||
| 37 | |||||||||||
| 38 | =cut | ||||||||||
| 39 | |||||||||||
| 40 | 40 | my $c = 'UNDB'; | |||||||||
| 41 | |||||||||||
| 42 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 43 | 1 | my ( $class ) = @_; | |||||||||
| 44 | |||||||||||
| 45 | 1 | my $self = bless {}, $class; | |||||||||
| 46 | 1 | return $self; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 8 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 50 | 8 | return $c; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 4 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 54 | 4 | my $self = shift; | |||||||||
| 55 | 4 | ▶ | return 0 if not defined $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 4 | ▶ | return 1 if $self->response->code == CODE_OK; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 3 | return 0; | |||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | 40 | 1; | |||||||||