| 1 | package TaskPipe::Template_Task; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Template::Nest; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | extends 'TaskPipe::Template'; | |||||||||
| 6 | 1 | with 'TaskPipe::Role::MooseType_ScopeMode'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | has name => (is => 'ro', isa => 'Str'); | |||||||||
| 9 | has template_vars => (is => 'ro', isa => 'HashRef', lazy => 1, default => sub{ | ||||||||||
| 10 | 0 | ▶ | my $p = $_[0]->path_settings->project; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 11 | return { | ||||||||||
| 12 | 0 | task_module_prefix => +$p->task_module_prefix, | |||||||||
| 13 | task_identifier => +$p->task_identifier, | ||||||||||
| 14 | name => +$_[0]->name | ||||||||||
| 15 | } | ||||||||||
| 16 | 1 | }); | |||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | sub target_filename{ | ||||||||||
| 20 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
target_filename: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | confess "name needs to be defined" unless $self->name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | return +$self->path_settings->project->task_identifier.$self->name.'.pm'; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | sub target_dir{ | ||||||||||
| 29 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
target_dir: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 30 | |||||||||||
| 31 | 0 | return +$self->path_settings->path( | |||||||||
| 32 | 'lib', | ||||||||||
| 33 | $self->path_settings->project->task_module_prefix | ||||||||||
| 34 | ); | ||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | =head1 NAME | ||||||||||
| 38 | |||||||||||
| 39 | TaskPipe::Template_Task - base class for task templates | ||||||||||
| 40 | |||||||||||
| 41 | =head1 DESCRIPTION | ||||||||||
| 42 | |||||||||||
| 43 | Base class for task templates | ||||||||||
| 44 | |||||||||||
| 45 | =head1 AUTHOR | ||||||||||
| 46 | |||||||||||
| 47 | Tom Gracey <tomgracey@gmail.com> | ||||||||||
| 48 | |||||||||||
| 49 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 50 | |||||||||||
| 51 | Copyright (c) Tom Gracey 2018 | ||||||||||
| 52 | |||||||||||
| 53 | TaskPipe is free software, licensed under | ||||||||||
| 54 | |||||||||||
| 55 | The GNU Public License Version 3 | ||||||||||
| 56 | |||||||||||
| 57 | =cut | ||||||||||
| 58 | |||||||||||
| 59 | |||||||||||
| 60 | |||||||||||
| 61 | 1 | 1; | |||||||||