« lib/BioX/Workflow/Command/Exceptions.pm
↑ Summary
lib/BioX/Workflow/Command/run/Utils/Samples.pm »
| 1 | package BioX::Workflow::Command::run::Rules::Directives::Interpolate::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 | |||||||||||||||||||||||||||||
| 8 | 1 | has 'delimiter' => ( | |||||||||||||||||||||||||||
| 9 | is => 'rw', | ||||||||||||||||||||||||||||
| 10 | isa => 'Str', | ||||||||||||||||||||||||||||
| 11 | default => '{', | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | has 'sample_var' => ( | |||||||||||||||||||||||||||
| 15 | is => 'rw', | ||||||||||||||||||||||||||||
| 16 | isa => 'Str', | ||||||||||||||||||||||||||||
| 17 | lazy => 1, | ||||||||||||||||||||||||||||
| 18 | default => '{{{sample}}}', | ||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub interpol_directive { | ||||||||||||||||||||||||||
|
Subroutine
interpol_directive: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 23 | 0 | my $k = shift; | |||||||||||||||||||||||||||
| 24 | 0 | my $source = shift; | |||||||||||||||||||||||||||
| 25 | 0 | my $text = ''; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | #The $ is not always at the beginning | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ( exists $self->interpol_directive_cache->{$source} && $source !~ m/{/ ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $self->interpol_directive_cache->{$source} and not $source =~ /{/
MC/DC0%0/2
exists $self->interpol_directive_cache->{$source} and not $source =~ /{/
exists $self->interpol_directive_cache->{$source}
not $source =~ /{/
Truth table0%0/3
A and not(B)
A= exists $self->interpol_directive_cache->{$source}B= not $source =~ /{/
| |||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||
| 30 | 0 | return $self->interpol_directive_cache->{$source}; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if ( $source !~ m/{/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 0 | $self->interpol_directive_cache->{$source} = $source; | |||||||||||||||||||||||||||
| 35 | 0 | return $source; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | $text = Template::Mustache->render( $source, $self ); | |||||||||||||||||||||||||||
| 39 | 0 | $self->interpol_directive_cache->{$source} = $text; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | ##If its the same and it has a $sign, its probably a perl expression | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if ($text eq $source && $text =~ m/\$/){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$text eq $source and $text =~ /\$/
MC/DC0%0/2
$text eq $source and $text =~ /\$/
$text eq $source
$text =~ /\$/
Truth table0%0/3
A and B
A= $text eq $sourceB= $text =~ /\$/
| |||||||||||||||||||||||||||||
| 43 | 0 | return $self->interpol_text_template($source); | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | 0 | return $text; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 1 | 1; | |||||||||||||||||||||||||||