File Coverage

blib/lib/BioX/Workflow/Command/run/Rules/Directives/Types/Roles/File.pm
Criterion Covered Total %
statement 3 19 15.7
branch 0 4 0.0
condition n/a
subroutine 1 2 50.0
pod 0 1 0.0
total 4 26 15.3


line stmt bran cond sub pod time code
1             package BioX::Workflow::Command::run::Rules::Directives::Types::Roles::File;
2              
3 1     1   708 use Moose::Role;
  1         4  
  1         10  
4              
5             sub check_file_exists {
6 0     0 0   my $self = shift;
7 0           my $k = shift;
8 0           my $v = shift;
9              
10 0 0         if ( !exists $v->{file} ) {
11 0           $self->app_log->warn( 'You have a key ' . $k );
12 0           $self->app_log->warn(
13             'This maps to a csv file type that requires file and optionally requires options'
14             );
15 0           $self->$k($v);
16 0           return 0;
17             }
18              
19 0           my $file = $self->interpol_directive( $v->{file} );
20 0 0         if ( !-e $file ) {
21 0           $self->app_log->warn( 'You have a key ' . $k );
22 0           $self->app_log->warn( 'With file ' . $file );
23 0           $self->app_log->warn('Which does not exist');
24 0           $self->$k($v);
25 0           return 0;
26             }
27              
28 0           return $file;
29             }
30              
31             1;