line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Role; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Mojo::Role - Tiny and simple role system for Mojo |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# imports |
6
|
2
|
|
|
2
|
|
31642
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
45
|
|
7
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
39
|
|
8
|
2
|
|
|
2
|
|
948
|
use Role::Tiny (); |
|
2
|
|
|
|
|
6107
|
|
|
2
|
|
|
|
|
34
|
|
9
|
2
|
|
|
2
|
|
897
|
use Role::Tiny::With (); |
|
2
|
|
|
|
|
407
|
|
|
2
|
|
|
|
|
39
|
|
10
|
2
|
|
|
2
|
|
1284
|
use Mojo::Base (); |
|
2
|
|
|
|
|
17800
|
|
|
2
|
|
|
|
|
181
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# version |
13
|
|
|
|
|
|
|
our $VERSION = 0.021; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import { |
16
|
5
|
|
|
5
|
|
2054
|
$_->import for qw(strict warnings utf8); |
17
|
5
|
|
|
|
|
230
|
feature->import(':5.10'); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# import with |
20
|
5
|
100
|
66
|
|
|
19
|
if (@_ > 1 and $_[1] eq '-with') { |
21
|
1
|
|
|
|
|
2
|
@_ = 'Role::Tiny::With'; |
22
|
1
|
|
|
|
|
82
|
goto &Role::Tiny::With::import; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
5
|
my $target = caller; |
26
|
4
|
|
|
0
|
|
13
|
my $has = sub { Mojo::Base::attr($target, @_) }; |
|
0
|
|
|
|
|
0
|
|
27
|
2
|
|
|
2
|
|
9
|
{ no strict 'refs'; *{"${target}::has"} = $has } |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
119
|
|
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
20
|
|
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
9
|
@_ = 'Role::Tiny'; |
30
|
4
|
|
|
|
|
11
|
goto &Role::Tiny::import; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |