OpenSSL/Role/Entity.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 87.2% 41 / 47 SCAR 13.9
CC
4
Cov
89%
load
3.3
write
2.0
BEGIN
1.0
CRAP 4.0
« OpenSSL/Key.pm ↑ Summary OpenSSL/Certificate.pm »
1 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Tiny::OpenSSL::Role::Entity;
5  
6 # ABSTRACT: Provides common tasks for Tiny::OpenSSL objects.
7 4 our $VERSION = '0.1.2'; # VERSION
8  
9 4 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use Types::Standard qw( Str InstanceOf );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 has ascii => ( is => 'rw', isa => Str );
14  
15 has file => (
16 is => 'rw',
17 isa => InstanceOf ['Path::Tiny'],
18 11 ▶ default => sub { return Path::Tiny->tempfile; }
Subroutine __ANON__: called CC=1 SCAR=0.0
19 4 );
20  
21 sub write {
22 1 ▶ my $self = shift;
Subroutine write: called CC=2 SCAR=7.0
Pod documented
23  
24 1 ▶ if ( $self->file ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->file) 1 0 1
25 1 $self->file->spew( $self->ascii );
26 }
27  
28 1 return 1;
29 }
30  
31 sub load {
32 1 ▶ my $self = shift;
Subroutine load: called CC=3 SCAR=12.0
Pod documented
33  
34 1 ▶ if ( -f $self->file && $self->file->lines > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $self->file and $self->file->lines > 0) 1 0 1
Condition33%1/3
-f $self->file and $self->file->lines > 0
!ll&&!rl&&r
001
MC/DC0%0/2
-f $self->file and $self->file->lines > 0
-f $self->file $self->file->lines > 0
Truth table33%1/3
A and B
A= -f $self->fileB= $self->file->lines > 0
ABresult
0X0
100
111
35 1 $self->ascii( $self->file->slurp );
36 }
37  
38 1 return 1;
39 }
40  
41 4 1;
42  
43 __END__
« OpenSSL/Key.pm ↑ Summary OpenSSL/Certificate.pm »