line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
5
|
|
|
5
|
|
33329
|
$MooX::AUTHORITY = 'cpan:GETTY'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$MooX::VERSION = '0.101'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: Using Moo and MooX:: packages the most lazy way |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
36
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
146
|
|
11
|
5
|
|
|
5
|
|
21
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
121
|
|
12
|
5
|
|
|
5
|
|
2985
|
use Import::Into; |
|
5
|
|
|
|
|
13973
|
|
|
5
|
|
|
|
|
164
|
|
13
|
5
|
|
|
5
|
|
39
|
use Module::Runtime qw( use_module ); |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
28
|
|
14
|
5
|
|
|
5
|
|
195
|
use Carp; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
425
|
|
15
|
5
|
|
|
5
|
|
4838
|
use Data::OptList; |
|
5
|
|
|
|
|
44608
|
|
|
5
|
|
|
|
|
691
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
4
|
|
|
4
|
|
605
|
my ( $class, @modules ) = @_; |
19
|
4
|
|
|
|
|
9
|
my $target = caller; |
20
|
4
|
|
|
|
|
13
|
unshift @modules, '+Moo'; |
21
|
4
|
|
|
|
|
13
|
MooX::import_base($class,$target,@modules); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub import_base { |
25
|
5
|
|
|
5
|
0
|
13
|
my ( $class, $target, @modules ) = @_; |
26
|
5
|
|
|
|
|
7
|
my @optlist = @{Data::OptList::mkopt([@modules],{ |
|
5
|
|
|
|
|
28
|
|
27
|
|
|
|
|
|
|
must_be => [qw( ARRAY HASH )], |
28
|
|
|
|
|
|
|
})}; |
29
|
5
|
|
|
|
|
274
|
for (@optlist) { |
30
|
14
|
|
|
|
|
102385
|
my $package = $_->[0]; |
31
|
14
|
|
|
|
|
27
|
my $opts = $_->[1]; |
32
|
14
|
100
|
|
|
|
28
|
for ($package) { s/^\+// or $_ = "MooX::$_" }; |
|
14
|
|
|
|
|
103
|
|
33
|
1
|
|
|
|
|
3
|
my @args = ref $opts eq 'ARRAY' |
34
|
0
|
|
|
|
|
0
|
? @{$opts} |
35
|
|
|
|
|
|
|
: ref $opts eq 'HASH' |
36
|
14
|
50
|
|
|
|
534
|
? %{$opts} |
|
|
100
|
|
|
|
|
|
37
|
|
|
|
|
|
|
: (); |
38
|
14
|
|
|
|
|
50
|
use_module($package)->import::into($target,@args); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |