blib/lib/Tak/ModuleLoader/Hook.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 10 | 30.0 |
branch | 0 | 2 | 0.0 |
condition | n/a | ||
subroutine | 1 | 2 | 50.0 |
pod | 0 | 1 | 0.0 |
total | 4 | 15 | 26.6 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Tak::ModuleLoader::Hook; | ||||||
2 | |||||||
3 | 1 | 1 | 5 | use Moo; | |||
1 | 2 | ||||||
1 | 6 | ||||||
4 | |||||||
5 | has sender => (is => 'ro', required => 1, weak_ref => 1); | ||||||
6 | |||||||
7 | sub Tak::ModuleLoader::Hook::INC { # unqualified INC forced into package main | ||||||
8 | 0 | 0 | 0 | my ($self, $module) = @_; | |||
9 | 0 | my $result = $self->sender->result_of(source_for => $module); | |||||
10 | 0 | 0 | if ($result->is_success) { | ||||
11 | 0 | my $code = $result->get; | |||||
12 | 0 | open my $fh, '<', \$code; | |||||
13 | 0 | return $fh; | |||||
14 | } | ||||||
15 | 0 | return; | |||||
16 | } | ||||||
17 | |||||||
18 | 1; |