lib/App/MadEye/Plugin/Agent/Base.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 2 SCAR 12.0
CC
2
Cov
0%
import
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package App::MadEye::Plugin::Agent::Base;
2 use strict;
3 use warnings;
4 use base qw/App::MadEye::Plugin::Base/;
5  
6 sub import {
7 my $class = shift;
8 my $pkg = caller;
9  
10 no strict 'refs';
11 push @{"$pkg\::ISA"}, $class;
12  
13 *{"$pkg\::run_jobs"} = sub :Hook('run_jobs') {
14 my ($self, $context, $args) = @_;
15  
16 $context->log( info => "run " . ref $self );
17  
18 my $target = $self->config->{config}->{target};
19 $target = [$target] unless ref $target eq 'ARRAY';
20  
21 for my $t (@$target) {
22 $context->log('debug', "register job: $self, $t");
23 $context->run_job( +{ target => $t, plugin => $self, } );
24 }
25 };
26 }
27  
28 1;
29