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