File Coverage

blib/lib/Bio/Tools/Run/QCons/Types.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 30 30 100.0


line stmt bran cond sub pod time code
1             package Bio::Tools::Run::QCons::Types;
2             {
3             $Bio::Tools::Run::QCons::Types::VERSION = '0.112990'; # TRIAL
4             }
5              
6             # ABSTRACT: Type library for Bio::Tools::Run::QCons
7              
8 3     3   163549 use strict;
  3         8  
  3         113  
9 3     3   17 use warnings;
  3         6  
  3         97  
10              
11 3     3   16 use Mouse::Util::TypeConstraints;
  3         5  
  3         50  
12 3     3   1338 use namespace::autoclean;
  3         23095  
  3         45  
13              
14 3     3   3473 use IPC::Cmd qw(can_run);
  3         178020  
  3         687  
15              
16             subtype 'Executable'
17             => as 'Str',
18             => where { _exists_executable($_) },
19             => message { "Can't find $_ in your PATH or not an executable" };
20              
21             sub _exists_executable {
22 4     4   15 my $candidate = shift;
23              
24 4 100       142 return 1 if -x $candidate;
25              
26 3         30 return scalar can_run($candidate);
27             }
28              
29 3     3   31 no Mouse::Util::TypeConstraints;
  3         7  
  3         44  
30              
31             __END__