line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
30465
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
135
|
|
2
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
178
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Tiny::OpenSSL::Role::Entity; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Provides common tasks for Tiny::OpenSSL objects. |
7
|
|
|
|
|
|
|
our $VERSION = '0.1.2'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
17
|
use Moo::Role; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
43
|
|
10
|
4
|
|
|
4
|
|
1049
|
use Types::Standard qw( Str InstanceOf ); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
30
|
|
11
|
4
|
|
|
4
|
|
2124
|
use Path::Tiny; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
745
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has ascii => ( is => 'rw', isa => Str ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has file => ( |
16
|
|
|
|
|
|
|
is => 'rw', |
17
|
|
|
|
|
|
|
isa => InstanceOf ['Path::Tiny'], |
18
|
|
|
|
|
|
|
default => sub { return Path::Tiny->tempfile; } |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub write { |
22
|
1
|
|
|
1
|
1
|
7991
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
7
|
if ( $self->file ) { |
25
|
1
|
|
|
|
|
63
|
$self->file->spew( $self->ascii ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
567
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub load { |
32
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
1
|
50
|
33
|
|
|
5
|
if ( -f $self->file && $self->file->lines > 0 ) { |
35
|
1
|
|
|
|
|
230
|
$self->ascii( $self->file->slurp ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
199
|
return 1; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |