Muster/Hook/Meta.pm

filter: Statementstmt 43.7% 14 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 1 / 1 totaltotal 45.2% 19 / 42 CC 3 SCAR 15.9
CC
3
Cov
41%
__ANON__
12.0
register
2.0
__ANON__
2.0
CRAP 4.9
« Muster/LeafFile/txt.pm ↑ Summary Muster/Command/scan.pm »
1 package Muster::Hook::Meta;
2 1 $Muster::Hook::Meta::VERSION = '0.96';
3 1 ▶use Mojo::Base 'Muster::Hook::Directives';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Muster::LeafFile;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Muster::Hooks;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Carp 'croak';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 Muster::Hook::Meta - Muster meta directive
12  
13 =head1 VERSION
14  
15 version 0.96
16  
17 =head1 DESCRIPTION
18  
19 L<Muster::Hook::Meta> processes the meta directive.
20  
21 =head1 METHODS
22  
23 L<Muster::Hook::Meta> inherits all methods from L<Muster::Hook::Directives>.
24  
25 =head2 register
26  
27 Do some intialization.
28  
29 =cut
30 0 ▶sub register {
Subroutine register: not called CC=1 SCAR=6.9
Pod documented
31 0 my $self = shift;
32 0 my $hookmaster = shift;
33 0 my $conf = shift;
34  
35 0 ▶ my $callback = sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
36 0 my %args = @_;
37  
38 0 my $leaf = $args{leaf};
39 0 my $phase = $args{phase};
40 0 my @p = @{$args{params}};
41 0 my %params = @p;
42  
43 0 ▶ if ($phase eq $Muster::Hooks::PHASE_SCAN)
Branch: 1 branch
BranchTrueFalseTotal
if ($phase eq $Muster::Hooks::PHASE_SCAN) 0 0 0
44 {
45 0 foreach my $key (keys %params)
46 {
47 0 $leaf->{meta}->{$key} = $params{$key};
48 }
49 }
50 0 return "";
51 0 };
52 0 ▶ $hookmaster->add_hook('meta' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
53 0 my %args = @_;
54  
55 0 return $self->do_directives(
56 no_scan=>0,
57 directive=>'meta',
58 call=>$callback,
59 %args,
60 );
61 },
62 0 );
63 0 return $self;
64 } # register
65  
66 1 1;
« Muster/LeafFile/txt.pm ↑ Summary Muster/Command/scan.pm »