Tak/ModuleLoader.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 2 / 6 Podpod 0.0% 0 / 3 totaltotal 40.0% 12 / 30 SCAR 1.3
CC
1
Cov
48%
_build_inc_hook
2.0
handle_enable
2.0
handle_disable
2.0
CRAP 1.1
« Tak/ObjectProxy.pm ↑ Summary Tak/ConnectionService.pm »
1 package Tak::ModuleLoader;
2  
3 1 ▶use Tak::ModuleLoader::Hook;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 with 'Tak::Role::Service';
7  
8 1 has module_sender => (is => 'ro', required => 1);
9  
10 1 has inc_hook => (is => 'lazy');
11  
12 sub _build_inc_hook {
13 0 ▶ my ($self) = @_;
Subroutine _build_inc_hook: not called CC=1 SCAR=6.9
14 0 Tak::ModuleLoader::Hook->new(sender => $self->module_sender);
15 }
16  
17 sub handle_enable {
18 0 ▶ my ($self) = @_;
Subroutine handle_enable: not called CC=1 SCAR=6.9
Pod undocumented
19 0 push @INC, $self->inc_hook;
20 0 return 'enabled';
21 }
22  
23 sub handle_disable {
24 0 ▶ my ($self) = @_;
Subroutine handle_disable: not called CC=1 SCAR=6.9
Pod undocumented
25 0 my $hook = $self->inc_hook;
26 0 @INC = grep $_ ne $hook, @INC;
27 0 return 'disabled';
28 }
29  
30 sub DEMOLISH {
31 0 ▶ my ($self) = @_;
Subroutine DEMOLISH: not called CC=1 SCAR=6.9
Pod undocumented
32 0 $self->handle_disable;
33 }
34  
35 1 1;
« Tak/ObjectProxy.pm ↑ Summary Tak/ConnectionService.pm »