line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::EDITADDR; |
2
|
40
|
|
|
40
|
|
163
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
54
|
|
|
40
|
|
|
|
|
168
|
|
3
|
40
|
|
|
40
|
|
2121
|
use strictures; |
|
40
|
|
|
|
|
60
|
|
|
40
|
|
|
|
|
158
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
2909
|
$Net::Gnats::Command::EDITADDR::VERSION = '0.20'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
170
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
55
|
|
|
40
|
|
|
|
|
1516
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
163
|
use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR); |
|
40
|
|
|
|
|
53
|
|
|
40
|
|
|
|
|
7618
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::EDITADDR |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Sets the e-mail address of the person communicating with gnatsd. The |
18
|
|
|
|
|
|
|
command requires at least the edit access level. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 PROTOCOL |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
EDITADDR [address] |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 RESPONSES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
The possible responses are: |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
200 (CODE_OK) |
29
|
|
|
|
|
|
|
The address was successfully set. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) |
32
|
|
|
|
|
|
|
Invalid number of arguments were supplied. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $c = 'EDITADDR'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
40
|
4
|
|
|
4
|
1
|
9
|
my ( $class, %options ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
4
|
|
|
|
|
12
|
my $self = bless \%options, $class; |
43
|
4
|
|
|
|
|
11
|
return $self; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub as_string { |
47
|
7
|
|
|
7
|
1
|
9
|
my ($self) = @_; |
48
|
7
|
100
|
|
|
|
36
|
return undef if not defined $self->{address}; |
49
|
6
|
|
|
|
|
25
|
return $c . ' ' . $self->{address}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub is_ok { |
53
|
4
|
|
|
4
|
0
|
9
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
# command not issued |
55
|
4
|
100
|
|
|
|
13
|
return 0 if not defined $self->response; |
56
|
|
|
|
|
|
|
# malformed command |
57
|
3
|
50
|
|
|
|
11
|
return 0 if not defined $self->response->code; |
58
|
3
|
50
|
|
|
|
8
|
return 1 if $self->response->code == CODE_OK; |
59
|
0
|
|
|
|
|
|
return 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |