File Coverage

blib/lib/BioX/Workflow/Command/run/Rules/Directives/Types/Roles/File.pm
Criterion Covered Total %
statement 6 21 28.5
branch 0 4 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 29 27.5


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