line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Role::Tiny::With; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
8764
|
use strict; |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
404
|
|
4
|
16
|
|
|
16
|
|
94
|
use warnings; |
|
16
|
|
|
|
|
25
|
|
|
16
|
|
|
|
|
688
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.002004'; |
7
|
|
|
|
|
|
|
$VERSION =~ tr/_//d; |
8
|
|
|
|
|
|
|
|
9
|
16
|
|
|
16
|
|
75
|
use Role::Tiny (); |
|
16
|
|
|
|
|
25
|
|
|
16
|
|
|
|
|
312
|
|
10
|
|
|
|
|
|
|
|
11
|
16
|
|
|
16
|
|
77
|
use Exporter 'import'; |
|
16
|
|
|
|
|
25
|
|
|
16
|
|
|
|
|
1444
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw( with ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub with { |
15
|
39
|
|
|
39
|
0
|
9019
|
my $target = caller; |
16
|
39
|
|
|
|
|
162
|
Role::Tiny->apply_roles_to_package($target, @_) |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Role::Tiny::With - Neat interface for consumers of Role::Tiny roles |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
package Some::Class; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Role::Tiny::With; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with 'Some::Role'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# The role is now mixed in |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
C<Role::Tiny> is a minimalist role composition tool. C<Role::Tiny::With> |
38
|
|
|
|
|
|
|
provides a C<with> function to compose such roles. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 AUTHORS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
See L<Role::Tiny> for authors. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
See L<Role::Tiny> for the copyright and license. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|