line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::EXPR; |
2
|
40
|
|
|
40
|
|
247
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
212
|
|
3
|
40
|
|
|
40
|
|
2142
|
use strictures; |
|
40
|
|
|
|
|
68
|
|
|
40
|
|
|
|
|
221
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
9253
|
$Net::Gnats::Command::EXPR::VERSION = '0.22'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
237
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
96
|
|
|
40
|
|
|
|
|
1610
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
233
|
use Net::Gnats::Constants qw(CODE_OK CODE_INVALID_EXPR); |
|
40
|
|
|
|
|
89
|
|
|
40
|
|
|
|
|
10598
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::EXPR |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Specifies a query expression used to limit which PRs are returned |
19
|
|
|
|
|
|
|
from the QUER command. The expression uses the normal query |
20
|
|
|
|
|
|
|
expression syntax, (see Query expressions). |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Multiple EXPR commands may be issued; the expressions are boolean ANDed together. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Expressions are cleared by the RSET command. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 PROTOCOL |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
EXPR [query expression] |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 RESPONSES |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Possible responses include: |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
415 (CODE_INVALID_EXPR) The specified expression is invalid, and could not be parsed. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
210 (CODE_OK) The expression has been accepted and will be used to limit the results returned from QUER. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $c = 'EXPR'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
45
|
7
|
|
|
7
|
1
|
22
|
my ( $class, %options ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
7
|
|
|
|
|
19
|
my $self = bless \%options, $class; |
48
|
7
|
|
|
|
|
29
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub as_string { |
52
|
16
|
|
|
16
|
1
|
31
|
my ($self) = @_; |
53
|
16
|
100
|
|
|
|
66
|
return undef if not defined $self->{expressions}; |
54
|
14
|
50
|
|
|
|
41
|
return undef if ref( $self->{expressions} ) ne 'ARRAY'; |
55
|
14
|
|
|
|
|
23
|
return $c . ' ' . join( ' & ', @{$self->{expressions}} ); |
|
14
|
|
|
|
|
74
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_ok { |
59
|
7
|
|
|
7
|
0
|
11
|
my ($self) = @_; |
60
|
7
|
100
|
|
|
|
20
|
return 0 if not defined $self->response; |
61
|
6
|
50
|
|
|
|
20
|
return 0 if not defined $self->response->code; |
62
|
6
|
100
|
|
|
|
21
|
return 1 if $self->response->code == CODE_OK; |
63
|
1
|
|
|
|
|
6
|
return 0; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |