line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Declare::Syntax::RoleApplication; |
2
|
|
|
|
|
|
|
# ABSTRACT: Handle user specified roles |
3
|
|
|
|
|
|
|
$MooseX::Declare::Syntax::RoleApplication::VERSION = '0.39'; |
4
|
24
|
|
|
24
|
|
20847
|
use Moose::Role; |
|
24
|
|
|
|
|
61
|
|
|
24
|
|
|
|
|
233
|
|
5
|
|
|
|
|
|
|
|
6
|
24
|
|
|
24
|
|
168814
|
use aliased 'MooseX::Declare::Context::Namespaced'; |
|
24
|
|
|
|
|
68
|
|
|
24
|
|
|
|
|
237
|
|
7
|
|
|
|
|
|
|
|
8
|
24
|
|
|
24
|
|
4651
|
use namespace::clean -except => 'meta'; |
|
24
|
|
|
|
|
69
|
|
|
24
|
|
|
|
|
288
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
11
|
|
|
|
|
|
|
#pod |
12
|
|
|
|
|
|
|
#pod This role extends L<MooseX::Declare::Syntax::OptionHandling> and provides |
13
|
|
|
|
|
|
|
#pod a C<with|/add_with_option_customizations> option. |
14
|
|
|
|
|
|
|
#pod |
15
|
|
|
|
|
|
|
#pod =head1 CONSUMES |
16
|
|
|
|
|
|
|
#pod |
17
|
|
|
|
|
|
|
#pod =for :list |
18
|
|
|
|
|
|
|
#pod * L<MooseX::Declare::Syntax::OptionHandling> |
19
|
|
|
|
|
|
|
#pod |
20
|
|
|
|
|
|
|
#pod =cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
with qw( |
23
|
|
|
|
|
|
|
MooseX::Declare::Syntax::OptionHandling |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
around context_traits => sub { shift->(@_), Namespaced }; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#pod =method add_with_option_customizations |
29
|
|
|
|
|
|
|
#pod |
30
|
|
|
|
|
|
|
#pod Object->add_with_option_customizations ( |
31
|
|
|
|
|
|
|
#pod Object $context, |
32
|
|
|
|
|
|
|
#pod Str $package, |
33
|
|
|
|
|
|
|
#pod ArrayRef $roles, |
34
|
|
|
|
|
|
|
#pod HashRef $options |
35
|
|
|
|
|
|
|
#pod ) |
36
|
|
|
|
|
|
|
#pod |
37
|
|
|
|
|
|
|
#pod This will add a call to C<with> in the scope code. |
38
|
|
|
|
|
|
|
#pod |
39
|
|
|
|
|
|
|
#pod =cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub add_with_option_customizations { |
42
|
10
|
|
|
10
|
1
|
36
|
my ($self, $ctx, $package, $roles) = @_; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# consume roles |
45
|
14
|
|
|
|
|
758
|
$ctx->add_early_cleanup_code_parts( |
46
|
|
|
|
|
|
|
sprintf 'Moose::Util::apply_all_roles(%s->meta, %s)', |
47
|
|
|
|
|
|
|
$package, |
48
|
|
|
|
|
|
|
join ', ', |
49
|
14
|
|
|
|
|
71
|
map { "q[$_]" } |
50
|
10
|
|
|
|
|
44
|
map { $ctx->qualify_namespace($_) } |
51
|
10
|
|
|
|
|
32
|
@{ $roles }, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
10
|
|
|
|
|
51
|
return 1; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
58
|
|
|
|
|
|
|
#pod |
59
|
|
|
|
|
|
|
#pod =for :list |
60
|
|
|
|
|
|
|
#pod * L<MooseX::Declare> |
61
|
|
|
|
|
|
|
#pod * L<MooseX::Declare::Syntax::OptionHandling> |
62
|
|
|
|
|
|
|
#pod |
63
|
|
|
|
|
|
|
#pod =cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=encoding UTF-8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
MooseX::Declare::Syntax::RoleApplication - Handle user specified roles |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 VERSION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
version 0.39 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 DESCRIPTION |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This role extends L<MooseX::Declare::Syntax::OptionHandling> and provides |
84
|
|
|
|
|
|
|
a C<with|/add_with_option_customizations> option. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 METHODS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 add_with_option_customizations |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Object->add_with_option_customizations ( |
91
|
|
|
|
|
|
|
Object $context, |
92
|
|
|
|
|
|
|
Str $package, |
93
|
|
|
|
|
|
|
ArrayRef $roles, |
94
|
|
|
|
|
|
|
HashRef $options |
95
|
|
|
|
|
|
|
) |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This will add a call to C<with> in the scope code. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 CONSUMES |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=over 4 |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L<MooseX::Declare::Syntax::OptionHandling> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=back |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SEE ALSO |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=over 4 |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item * |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
L<MooseX::Declare> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item * |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
L<MooseX::Declare::Syntax::OptionHandling> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=back |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 AUTHOR |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Florian Ragwitz. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
132
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=cut |