line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::SmokeBox::Job; |
2
|
|
|
|
|
|
|
$POE::Component::SmokeBox::Job::VERSION = '0.56'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Object defining a SmokeBox job. |
4
|
|
|
|
|
|
|
|
5
|
21
|
|
|
21
|
|
1348697
|
use strict; |
|
21
|
|
|
|
|
97
|
|
|
21
|
|
|
|
|
613
|
|
6
|
21
|
|
|
21
|
|
1104
|
use warnings; |
|
21
|
|
|
|
|
49
|
|
|
21
|
|
|
|
|
779
|
|
7
|
21
|
|
|
21
|
|
4763
|
use Params::Check qw(check); |
|
21
|
|
|
|
|
39578
|
|
|
21
|
|
|
|
|
1100
|
|
8
|
21
|
|
|
21
|
|
136
|
use base qw(Object::Accessor); |
|
21
|
|
|
|
|
42
|
|
|
21
|
|
|
|
|
6279
|
|
9
|
21
|
|
|
21
|
|
68058
|
use vars qw($VERBOSE); |
|
21
|
|
|
|
|
54
|
|
|
21
|
|
|
|
|
12383
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
44
|
|
|
44
|
1
|
3210
|
my $package = shift; |
13
|
|
|
|
|
|
|
|
14
|
44
|
|
|
|
|
1140
|
my $tmpl = { |
15
|
|
|
|
|
|
|
idle => { allow => qr/^\d+$/, default => 600, }, |
16
|
|
|
|
|
|
|
timeout => { allow => qr/^\d+$/, default => 3600, }, |
17
|
|
|
|
|
|
|
type => { defined => 1, default => 'CPANPLUS::YACSmoke', }, |
18
|
|
|
|
|
|
|
command => { allow => [ qw(check index smoke) ], default => 'check', }, |
19
|
|
|
|
|
|
|
module => { defined => 1 }, |
20
|
|
|
|
|
|
|
no_log => { defined => 1, allow => qr/^(?:0|1)$/, default => 0, }, |
21
|
|
|
|
|
|
|
delay => { defined => 1, allow => qr/^\d+$/, default => 0, }, |
22
|
|
|
|
|
|
|
check_warnings => { defined => 1, allow => qr/^(?:0|1)$/, default => 1, }, |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
44
|
50
|
|
|
|
312
|
my $args = check( $tmpl, { @_ }, 1 ) or return; |
26
|
44
|
50
|
66
|
|
|
8556
|
if ( $args->{command} eq 'smoke' and !$args->{module} ) { |
27
|
0
|
|
|
|
|
0
|
warn "${package}::new expects 'module' to be set when command is 'smoke'"; |
28
|
0
|
|
|
|
|
0
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
44
|
|
|
|
|
127
|
my $self = bless { }, $package; |
31
|
|
|
|
|
|
|
my $accessor_map = { |
32
|
|
|
|
|
|
|
idle => qr/^\d+$/, |
33
|
|
|
|
|
|
|
timeout => qr/^\d+$/, |
34
|
44
|
|
|
44
|
|
16204
|
type => sub { defined $_[0]; }, |
35
|
|
|
|
|
|
|
command => [ qw(check index smoke) ], |
36
|
25
|
|
|
25
|
|
7434
|
module => sub { defined $_[0]; }, |
37
|
0
|
|
|
0
|
|
0
|
id => sub { defined $_[0]; }, |
38
|
44
|
|
|
|
|
1033
|
no_log => qr/^(?:0|1)$/, |
39
|
|
|
|
|
|
|
delay => qr/^\d+$/, |
40
|
|
|
|
|
|
|
check_warnings => qr/^(?:0|1)$/, |
41
|
|
|
|
|
|
|
}; |
42
|
44
|
|
|
|
|
390
|
$self->mk_accessors( $accessor_map ); |
43
|
44
|
|
|
|
|
3614
|
$self->$_( $args->{$_} ) for keys %{ $args }; |
|
44
|
|
|
|
|
375
|
|
44
|
44
|
|
|
|
|
12665
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub dump_data { |
48
|
85
|
|
|
85
|
1
|
2197
|
my $self = shift; |
49
|
85
|
|
|
|
|
823
|
my @returns = qw(idle timeout type command no_log check_warnings); |
50
|
85
|
100
|
|
|
|
1045
|
push @returns, 'module' if $self->command() eq 'smoke'; |
51
|
85
|
|
|
|
|
9538
|
return map { ( $_ => $self->$_ ) } @returns; |
|
535
|
|
|
|
|
40011
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |