line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Plugin; |
2
|
20
|
|
|
20
|
|
4183
|
use strict; |
|
20
|
|
|
|
|
31
|
|
|
20
|
|
|
|
|
536
|
|
3
|
20
|
|
|
20
|
|
81
|
use warnings; |
|
20
|
|
|
|
|
27
|
|
|
20
|
|
|
|
|
443
|
|
4
|
|
|
|
|
|
|
|
5
|
20
|
|
|
20
|
|
74
|
use Path::Class; |
|
20
|
|
|
|
|
25
|
|
|
20
|
|
|
|
|
1158
|
|
6
|
20
|
|
|
20
|
|
82
|
use Scalar::Util qw(weaken); |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
877
|
|
7
|
|
|
|
|
|
|
|
8
|
20
|
|
|
20
|
|
1027
|
use Module::Setup::Flavor; |
|
20
|
|
|
|
|
28
|
|
|
20
|
|
|
|
|
464
|
|
9
|
20
|
|
|
20
|
|
89
|
use Module::Setup::Path::Dir; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
6157
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
319
|
|
|
319
|
0
|
1030
|
my($class, %args) = @_; |
13
|
319
|
|
|
|
|
1218
|
my $self = bless { %args }, $class; |
14
|
319
|
|
|
|
|
1299
|
weaken $self->{context}; |
15
|
319
|
|
|
|
|
1164
|
$self->register; |
16
|
319
|
|
|
|
|
11481
|
$self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
2
|
0
|
|
sub register {} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_trigger { |
22
|
337
|
|
|
337
|
0
|
3496
|
my($self, @args) = @_; |
23
|
337
|
|
|
|
|
1224
|
$self->{context}->add_trigger(@args); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub append_template_file { |
27
|
9
|
|
|
9
|
1
|
96
|
my($self, $context, $caller) = @_; |
28
|
9
|
100
|
|
|
|
44
|
$caller = caller unless $caller; |
29
|
9
|
|
|
|
|
55
|
my @template = Module::Setup::Flavor::loader($caller); |
30
|
|
|
|
|
|
|
|
31
|
9
|
|
|
|
|
28
|
for my $tmpl (@template) { |
32
|
11
|
100
|
|
|
|
103
|
if (exists $tmpl->{dir}) { |
|
|
100
|
|
|
|
|
|
33
|
1
|
|
|
|
|
4
|
Module::Setup::Path::Dir->new($context->distribute->dist_path, split('/', $tmpl->{dir}))->mkpath; |
34
|
1
|
|
|
|
|
206
|
next; |
35
|
|
|
|
|
|
|
} elsif (!exists $tmpl->{file}) { |
36
|
1
|
|
|
|
|
7
|
next; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
my $options = { |
39
|
|
|
|
|
|
|
dist_path => $context->distribute->dist_path->file(split('/', $tmpl->{file})), |
40
|
|
|
|
|
|
|
template => $tmpl->{template}, |
41
|
9
|
|
|
|
|
44
|
vars => $context->distribute->template_vars, |
42
|
|
|
|
|
|
|
content => undef, |
43
|
|
|
|
|
|
|
}; |
44
|
9
|
100
|
|
|
|
42
|
$options->{chmod} = $tmpl->{chmod} if $tmpl->{chmod}; |
45
|
9
|
|
|
|
|
28
|
$context->distribute->write_template($context, $options); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |