line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package roles; |
2
|
|
|
|
|
|
|
# ABSTRACT: A simple pragma for composing roles. |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
54188
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
386
|
use MOP (); |
|
1
|
|
|
|
|
40746
|
|
|
1
|
|
|
|
|
17
|
|
8
|
1
|
|
|
1
|
|
220
|
use Devel::Hook (); |
|
1
|
|
|
|
|
656
|
|
|
1
|
|
|
|
|
57
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:STEVAN'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
2
|
|
|
2
|
|
270
|
shift; |
15
|
2
|
|
|
|
|
4
|
my $role = caller; |
16
|
2
|
|
|
|
|
5
|
my @roles = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
{ |
19
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
|
2
|
|
|
|
|
2
|
|
20
|
1
|
|
|
1
|
|
4
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
21
|
2
|
|
|
|
|
3
|
push @{ $role.'::DOES' } => @roles; |
|
2
|
|
|
|
|
14
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Devel::Hook->push_UNITCHECK_hook(sub { |
25
|
2
|
|
|
2
|
|
997
|
my $meta; |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
2
|
|
28
|
1
|
|
|
1
|
|
4
|
no warnings 'once'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
104
|
|
29
|
2
|
50
|
|
|
|
3
|
if ( @{ $role.'::ISA' } ) { |
|
2
|
|
|
|
|
13
|
|
30
|
0
|
|
|
|
|
0
|
$meta = MOP::Class->new( $role ) |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
else { |
33
|
2
|
|
|
|
|
10
|
$meta = MOP::Role->new( $role ) |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
MOP::Util::APPLY_ROLES( |
38
|
2
|
50
|
|
|
|
266
|
$meta, |
39
|
|
|
|
|
|
|
[ $meta->roles ], |
40
|
|
|
|
|
|
|
to => ($meta->isa('MOP::Class') ? 'class' : 'role') |
41
|
|
|
|
|
|
|
); |
42
|
2
|
|
|
|
|
10
|
}); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |