lib/Code/TidyAll/Role/Tempdir.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 31 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Code/TidyAll/Result.pm ↑ Summary
1 package Code::TidyAll::Role::Tempdir;
2  
3 58 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 58 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 58 ▶use Path::Tiny qw(tempdir);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 58 ▶use Specio::Library::Builtins;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 58 ▶use Specio::Library::Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 58 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 58 our $VERSION = '0.85';
13  
14 58 has _tempdir => (
15 is => 'ro',
16 isa => t('Dir'),
17 lazy => 1,
18 builder => 1,
19 );
20  
21 58 has no_cleanup => (
22 is => 'ro',
23 isa => t('Bool'),
24 default => 0,
25 );
26  
27 22 ▶sub _build__tempdir {
Subroutine _build__tempdir: called CC=1 SCAR=0.0
28 22 my ($self) = @_;
29 22 return tempdir(
30 'Code-TidyAll-XXXX',
31 CLEANUP => !$self->no_cleanup,
32 );
33 }
34  
35 58 1;
36  
37 # ABSTRACT: Provides a _tempdir attribute for Code::TidyAll classes
38  
39 __END__
« lib/Code/TidyAll/Result.pm ↑ Summary