« lib/BioX/Workflow/Command/run/Utils/Attributes.pm
↑ Summary
lib/BioX/Workflow/Command/inspect/Exceptions/Path.pm »
| 1 | package BioX::Workflow::Command::run::Rules::Directives::Types::Mustache; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Template::Mustache; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Template::Mustache::Trait; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use File::Glob; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use File::Basename; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | after 'BUILD' => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 12 | 0 | my $self = shift; | |||||||||
| 13 | |||||||||||
| 14 | 0 | $self->set_register_types( | |||||||||
| 15 | 'mustache', | ||||||||||
| 16 | { | ||||||||||
| 17 | builder => 'create_reg_attr', | ||||||||||
| 18 | lookup => ['.*_mustache$'] | ||||||||||
| 19 | } | ||||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | 0 | $self->set_register_process_directives( 'mustache', | |||||||||
| 23 | { builder => 'process_directive_mustache', lookup => ['.*_mustache$'] } | ||||||||||
| 24 | ); | ||||||||||
| 25 | 1 | }; | |||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub process_directive_mustache { | ||||||||
|
Subroutine
process_directive_mustache: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | 0 | my $self = shift; | |||||||||
| 29 | 0 | my $k = shift; | |||||||||
| 30 | 0 | my $v = shift; | |||||||||
| 31 | |||||||||||
| 32 | 0 | return $v; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub create_mustache_attr { | ||||||||
|
Subroutine
create_mustache_attr: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my $self = shift; | |||||||||
| 37 | 0 | my $meta = shift; | |||||||||
| 38 | 0 | my $k = shift; | |||||||||
| 39 | |||||||||||
| 40 | 0 | $meta->add_attribute( | |||||||||
| 41 | $k => ( | ||||||||||
| 42 | is => 'rw', | ||||||||||
| 43 | traits => ['Mustache'], | ||||||||||
| 44 | handles => { | ||||||||||
| 45 | 'render_' . $k => 'render', | ||||||||||
| 46 | }, | ||||||||||
| 47 | lazy_build => 1, | ||||||||||
| 48 | ) | ||||||||||
| 49 | ); | ||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub render_mustache { | ||||||||
|
Subroutine
render_mustache: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 53 | 0 | my $self = shift; | |||||||||
| 54 | 0 | my $template = shift; | |||||||||
| 55 | 0 | my $print = shift; | |||||||||
| 56 | |||||||||||
| 57 | 0 | my $text = Template::Mustache->render( $template, $self ); | |||||||||
| 58 | 0 | ▶ | print $text if $print; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | return $text; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 1 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 63 | |||||||||||
| 64 | 1 | 1; | |||||||||