|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package POE::Component::SmokeBox::Job;  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 $POE::Component::SmokeBox::Job::VERSION = '0.54';  | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #ABSTRACT: Object defining a SmokeBox job.  | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
5
 | 
21
 | 
 
 | 
 
 | 
  
21
  
 | 
 
 | 
1054896
 | 
 use strict;  | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
90
 | 
    | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
577
 | 
    | 
| 
6
 | 
21
 | 
 
 | 
 
 | 
  
21
  
 | 
 
 | 
105
 | 
 use warnings;  | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
39
 | 
    | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
601
 | 
    | 
| 
7
 | 
21
 | 
 
 | 
 
 | 
  
21
  
 | 
 
 | 
4383
 | 
 use Params::Check qw(check);  | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
35468
 | 
    | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1182
 | 
    | 
| 
8
 | 
21
 | 
 
 | 
 
 | 
  
21
  
 | 
 
 | 
149
 | 
 use base qw(Object::Accessor);  | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
43
 | 
    | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5679
 | 
    | 
| 
9
 | 
21
 | 
 
 | 
 
 | 
  
21
  
 | 
 
 | 
61582
 | 
 use vars qw($VERBOSE);  | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
66
 | 
    | 
| 
 
 | 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11703
 | 
    | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub new {  | 
| 
12
 | 
44
 | 
 
 | 
 
 | 
  
44
  
 | 
  
1
  
 | 
2721
 | 
   my $package = shift;  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
14
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
876
 | 
   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
  
 | 
 
 | 
 
 | 
 
 | 
224
 | 
   my $args = check( $tmpl, { @_ }, 1 ) or return;  | 
| 
26
 | 
44
 | 
  
 50
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
8006
 | 
   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
 | 
 
 | 
 
 | 
 
 | 
 
 | 
120
 | 
   my $self = bless { }, $package;  | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my $accessor_map = {  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	idle    => qr/^\d+$/,  | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	timeout => qr/^\d+$/,  | 
| 
34
 | 
44
 | 
 
 | 
 
 | 
  
44
  
 | 
 
 | 
14145
 | 
 	type    => sub { defined $_[0]; },  | 
| 
35
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	command => [ qw(check index smoke) ],  | 
| 
36
 | 
25
 | 
 
 | 
 
 | 
  
25
  
 | 
 
 | 
4234
 | 
 	module  => sub { defined $_[0]; },  | 
| 
37
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	id	=> sub { defined $_[0]; },  | 
| 
38
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
949
 | 
 	no_log	=> qr/^(?:0|1)$/,  | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	delay	=> qr/^\d+$/,  | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	check_warnings => qr/^(?:0|1)$/,  | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   };  | 
| 
42
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2071
 | 
   $self->mk_accessors( $accessor_map );  | 
| 
43
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3675
 | 
   $self->$_( $args->{$_} ) for keys %{ $args };  | 
| 
 
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
407
 | 
    | 
| 
44
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17745
 | 
   return $self;  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
46
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub dump_data {  | 
| 
48
 | 
85
 | 
 
 | 
 
 | 
  
85
  
 | 
  
1
  
 | 
2051
 | 
   my $self = shift;  | 
| 
49
 | 
85
 | 
 
 | 
 
 | 
 
 | 
 
 | 
988
 | 
   my @returns = qw(idle timeout type command no_log check_warnings);  | 
| 
50
 | 
85
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
675
 | 
   push @returns, 'module' if $self->command() eq 'smoke';  | 
| 
51
 | 
85
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10382
 | 
   return map { ( $_ => $self->$_ ) } @returns;  | 
| 
 
 | 
535
 | 
 
 | 
 
 | 
 
 | 
 
 | 
38645
 | 
    | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
53
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  | 
| 
55
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
56
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__  |