| 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
| |||||||||||||||||||||||||||||
| 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
Condition33%1/3
-f $self->file and $self->file->lines > 0
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
| |||||||||||||||||||||||||||||
| 35 | 1 | $self->ascii( $self->file->slurp ); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | return 1; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 4 | 1; | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||