line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
46744
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
129
|
|
2
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
258
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Tiny::OpenSSL::Role::Entity; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Provides common tasks for Tiny::OpenSSL objects. |
7
|
|
|
|
|
|
|
our $VERSION = '0.1.3'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
26
|
use Moo::Role; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
34
|
|
10
|
5
|
|
|
5
|
|
1567
|
use Types::Standard qw( Str InstanceOf ); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
55
|
|
11
|
5
|
|
|
5
|
|
4095
|
use Path::Tiny; |
|
5
|
|
|
|
|
9782
|
|
|
5
|
|
|
|
|
1059
|
|
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
|
8040
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
6
|
if ( $self->file ) { |
25
|
1
|
|
|
|
|
52
|
$self->file->spew( $self->ascii ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
570
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub load { |
32
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
1
|
50
|
33
|
|
|
8
|
if ( -f $self->file && $self->file->lines > 0 ) { |
35
|
1
|
|
|
|
|
230
|
$self->ascii( $self->file->slurp ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
269
|
return 1; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |