line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
14
|
use v5.14; |
|
1
|
|
|
|
|
3
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
4
|
1
|
|
|
1
|
|
6
|
no warnings qw(void once uninitialized numeric); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
80
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Moops::ImportSet; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.038'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
543
|
use Moo; |
|
1
|
|
|
|
|
8558
|
|
|
1
|
|
|
|
|
6
|
|
12
|
1
|
|
|
1
|
|
1744
|
use Module::Runtime qw(use_package_optimistically); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
13
|
1
|
|
|
1
|
|
506
|
use namespace::autoclean; |
|
1
|
|
|
|
|
17223
|
|
|
1
|
|
|
|
|
4
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has imports => (is => 'ro'); |
16
|
|
|
|
|
|
|
has ident => (is => 'ro', init_arg => undef, default => sub { state $x = 0; ++$x }); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our %SAVED; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub BUILD { |
21
|
1
|
|
|
1
|
0
|
7
|
my $self = shift; |
22
|
1
|
|
|
|
|
8
|
$SAVED{ $self->ident } = $self->imports; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub do_imports { |
26
|
1
|
|
|
1
|
0
|
191424
|
shift; |
27
|
1
|
|
|
|
|
5
|
my ($package, $ident) = @_; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
4
|
my $imports = $SAVED{$ident}; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
540
|
require Import::Into; |
32
|
1
|
|
|
|
|
655
|
for my $import (@$imports) |
33
|
|
|
|
|
|
|
{ |
34
|
1
|
|
|
|
|
5
|
my ($module, $params) = @$import; |
35
|
1
|
50
|
|
|
|
5
|
use_package_optimistically($module)->import::into( |
|
|
50
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$package, |
37
|
|
|
|
|
|
|
(ref($params) eq q(HASH) ? %$params : ref($params) eq q(ARRAY) ? @$params : ()), |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub generate_code { |
43
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
44
|
1
|
|
|
|
|
3
|
my ($pkg) = @_; |
45
|
1
|
|
|
|
|
2
|
my $class = ref $self; |
46
|
1
|
|
|
|
|
6
|
my $ident = $self->ident; |
47
|
1
|
|
|
|
|
6
|
return "BEGIN { '$class'->do_imports(q[$pkg], $ident) };"; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |