line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Role; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# imports |
4
|
2
|
|
|
2
|
|
140583
|
use Mojo::Base -strict; |
|
2
|
|
|
|
|
387158
|
|
|
2
|
|
|
|
|
20
|
|
5
|
2
|
|
|
2
|
|
337
|
use Role::Tiny (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
31
|
|
6
|
2
|
|
|
2
|
|
976
|
use Role::Tiny::With (); |
|
2
|
|
|
|
|
556
|
|
|
2
|
|
|
|
|
47
|
|
7
|
2
|
|
|
2
|
|
12
|
use Mojo::Util (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
433
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# version |
10
|
|
|
|
|
|
|
our $VERSION = '0.999'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
|
|
|
|
|
|
# caller is a consumer, import with |
14
|
|
|
|
|
|
|
# it is assumed that the caller's Mojo::Base imported strict already |
15
|
5
|
100
|
66
|
5
|
|
3040
|
if (@_ > 1 and $_[1] eq '-with') { |
16
|
1
|
|
|
|
|
3
|
@_ = 'Role::Tiny::With'; |
17
|
1
|
|
|
|
|
126
|
goto &Role::Tiny::With::import; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# the caller is a role |
21
|
|
|
|
|
|
|
# roles are strict |
22
|
4
|
|
|
|
|
20
|
Mojo::Base->import('-strict'); |
23
|
4
|
|
|
|
|
356
|
my $target = caller; |
24
|
4
|
|
|
0
|
|
27
|
Mojo::Util::monkey_patch $target, has => sub { Mojo::Base::attr($target, @_) }; |
|
0
|
|
|
0
|
|
0
|
|
25
|
|
|
|
|
|
|
|
26
|
4
|
|
|
|
|
73
|
@_ = 'Role::Tiny'; |
27
|
4
|
|
|
|
|
25
|
goto &Role::Tiny::import; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |