| 1 | package Module::Setup::Plugin::Additional; | ||||||||||
| 2 | 18 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 18 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 18 | ▶ | use base 'Module::Setup::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 18 | ▶ | use Module::Setup::Path::Template; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | sub register { | ||||||||||
| 9 | 74 | ▶ | my($self, ) = @_; | ||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 10 | 74 | $self->add_trigger( append_template_file => \&append_template_file ); | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | sub append_template_file { | ||||||||||
| 14 | 41 | ▶ | my $self = shift; | ||||||||
|
Subroutine
append_template_file: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||
| 15 | |||||||||||
| 16 | 41 | my $config = $self->base_dir->flavor->additional->config->load; | |||||||||
| 17 | 41 | for my $additional ( $self->base_dir->flavor->additional->path->children ) { | |||||||||
| 18 | 48 | ▶ | next unless $additional->is_dir; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 6 | my $name = $additional->dir_list(-1); | |||||||||
| 20 | 6 | ▶ | return unless $self->dialog("Do you install additional template by $name? [yN] ", 'n') =~ /[Yy]/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | 5 | my $base_src = Module::Setup::Path::Template->new($self->base_dir->flavor->additional->path, $name); | |||||||||
| 23 | 5 | for my $path ($base_src->find_files) { | |||||||||
| 24 | 10 | $self->distribute->install_template($self, $path, $base_src); | |||||||||
| 25 | } | ||||||||||
| 26 | 5 | push @{ $self->distribute->{additionals} }, $config->{$name}; | |||||||||
| 27 | } | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 18 | 1; | |||||||||