File Coverage

blib/lib/Bio/RNA/RNAaliSplit/FileDir.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             # -*-CPerl-*-
2             # Last changed Time-stamp: <2017-03-09 16:16:55 michl>
3              
4             # Bio::RNA::RNAaliSplit::FileDir.pm: A Moose Role for basic file IO
5              
6             package Bio::RNA::RNAaliSplit::FileDir;
7              
8 1     1   657 use version; our $VERSION = qv('0.04');
  1         1  
  1         10  
9 1     1   75 use Moose::Util::TypeConstraints;
  1         1  
  1         9  
10 1     1   1833 use Moose::Role;
  1         3133  
  1         3  
11 1     1   4221 use Path::Class::File;
  1         1  
  1         26  
12 1     1   4 use Path::Class::Dir;
  1         1  
  1         149  
13              
14             subtype 'MyFile' => as class_type('Path::Class::File');
15              
16             coerce 'MyFile'
17             => from 'Str'
18             => via { Path::Class::File->new($_) };
19              
20             subtype 'MyDir' => as class_type('Path::Class::Dir');
21              
22             coerce 'MyDir'
23             => from 'ArrayRef'
24             => via { Path::Class::Dir->new( @{ $_ } ) };
25              
26             has 'ifile' => (
27             is => 'ro',
28             isa => 'MyFile',
29             predicate => 'has_ifile',
30             coerce => 1,
31             );
32              
33             has 'odir' => (
34             is => 'rw',
35             isa => 'MyDir',
36             predicate => 'has_odir',
37             coerce => 1,
38             );
39              
40             has 'odirn' => ( # custom output dir name
41             is => 'rw',
42             isa => 'Path::Class::Dir',
43             predicate => 'has_odirn',
44             );
45              
46              
47 1     1   5 no Moose;
  1         2  
  1         5  
48              
49             1;