line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Plugin::Helper; |
2
|
3
|
|
|
3
|
|
23
|
use strict; |
|
3
|
|
|
|
|
20
|
|
|
3
|
|
|
|
|
137
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
130
|
|
4
|
3
|
|
|
3
|
|
19
|
use base 'Module::Setup::Plugin'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
361
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
20
|
use Module::Setup::Path::Dir; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
3389
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub register { |
9
|
6
|
|
|
6
|
0
|
16
|
my $self = shift; |
10
|
6
|
|
|
|
|
74
|
$self->add_trigger( |
11
|
|
|
|
|
|
|
after_setup_module_attribute => $self->can('setup_module_attribute') |
12
|
|
|
|
|
|
|
); |
13
|
6
|
|
|
|
|
257
|
$self->add_trigger( |
14
|
|
|
|
|
|
|
after_setup_template_vars => $self->can('setup_template_vars') |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub setup_module_attribute { |
19
|
3
|
|
|
3
|
0
|
249
|
my $setup = shift; |
20
|
3
|
100
|
|
|
|
51
|
if ($setup->{config}->{class}->is_append_files) { |
21
|
2
|
|
|
|
|
25
|
$setup->distribute->{dist_path} = Module::Setup::Path::Dir->new('.'); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub setup_template_vars { |
26
|
3
|
|
|
3
|
0
|
227
|
my ($setup, $vars) = @_; |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
100
|
|
|
39
|
my $conf = $setup->{helper} || {}; |
29
|
3
|
|
|
|
|
46
|
my $flavor_class = $setup->{config}->{class}; |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
38
|
my $prefix = $flavor_class->helper_option_prefix; |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
711
|
my %is_make_path = map { $_ => 1 } $flavor_class->generate_path_option_names; |
|
1
|
|
|
|
|
6
|
|
34
|
3
|
|
|
|
|
9
|
while (my($k, $v) = each %{ $conf }) { |
|
5
|
|
|
|
|
34
|
|
35
|
2
|
|
|
|
|
9
|
$vars->{"${prefix}_$k"} = $v; |
36
|
2
|
100
|
|
|
|
10
|
if ($is_make_path{$k}) { |
37
|
1
|
|
|
|
|
6
|
($vars->{"${prefix}_${k}_path"} = $v) =~ s!::!/!g; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
3
|
100
|
|
|
|
25
|
if (ref($conf->{setup_template_vars_callback}) eq 'CODE') { |
42
|
1
|
|
|
|
|
16
|
$conf->{setup_template_vars_callback}->($setup, $vars); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Module::Setup::Plugin::Helper - L support plugin |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|