File Coverage

blib/lib/BioX/Workflow/Command/run/Rules/Directives/Types/Glob.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 23 52.1


line stmt bran cond sub pod time code
1             package BioX::Workflow::Command::run::Rules::Directives::Types::Glob;
2              
3 1     1   1163 use Moose::Role;
  1         2  
  1         7  
4 1     1   4373 use namespace::autoclean;
  1         2  
  1         7  
5              
6 1     1   55 use File::Glob;
  1         3  
  1         175  
7              
8             after 'BUILD' => sub {
9             my $self = shift;
10              
11             $self->set_register_types(
12             'glob',
13             {
14             builder => 'create_reg_attr',
15             lookup => ['.*_glob$']
16             }
17             );
18              
19             $self->set_register_process_directives( 'glob',
20             { builder => 'process_directive_glob', lookup => ['.*_glob$'] } );
21             };
22              
23             sub process_directive_glob {
24 0     0 0   my $self = shift;
25 0           my $k = shift;
26 0           my $v = shift;
27              
28 0 0         return if $k eq 'sample_glob';
29              
30 0           my $text = $self->interpol_directive($v);
31 0           my @data = glob($text);
32 0           $self->$k( \@data );
33             }
34              
35             1;