blib/lib/BioSAILs/Utils/Files/CacheDir.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 25 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package BioSAILs::Utils::Files::CacheDir;
2  
3 use Moose::Role;
4 use namespace::autoclean;
5  
6 use MooseX::Types::Path::Tiny qw/Path/;
7 use Cwd qw(getcwd);
8 use File::Spec;
9  
10 has 'cache_dir' => (
11 is => 'rw',
12 isa => Path,
13 coerce => 1,
14 default => sub {
15 return File::Spec->catdir( getcwd(), '.biosails' );
16 },
17 documentation => 'BioSAILs will cache some information during your runs. '
18 . 'Delete with caution! '
19 );
20  
21 has 'cache_file' => (
22 is => 'rw',
23 required => 0,
24 isa => Path,
25 coerce => 1,
26 documentation => 'BioSAILs caches relevant files.',
27 trigger => sub {
28 my $self = shift;
29 $self->cache_file->touchpath;
30 },
31 );
32  
33 1;