line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Role::Parameterized::With; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$MooX::Role::Parameterized::With::VERSION = '0.082'; |
4
|
|
|
|
|
|
|
} |
5
|
3
|
|
|
3
|
|
63104
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
76
|
|
6
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
75
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: MooX::Role::Parameterized:With - dsl to apply roles with composition parameters |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
14
|
use Exporter; # qw(import); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
121
|
|
11
|
3
|
|
|
3
|
|
15
|
use Module::Runtime qw(use_module); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
20
|
|
12
|
3
|
|
|
3
|
|
2496
|
use List::MoreUtils qw(natatime); |
|
3
|
|
|
|
|
36953
|
|
|
3
|
|
|
|
|
20
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
3
|
|
|
3
|
|
33
|
my $package = shift; |
16
|
3
|
|
|
|
|
26
|
my $target = caller; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
44
|
my $it = natatime( 2, @_ ); |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
36
|
while ( my ( $role, $params ) = $it->() ) { |
21
|
3
|
|
|
|
|
16
|
use_module($role)->apply( $params, target => $target ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |