MToken/DeviceSkel.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 46 SCAR 6.9
CC
1
Cov
0%
build
2.0
dirs
2.0
pool
2.0
CRAP 2.0
1 package MToken::DeviceSkel; # $Id: DeviceSkel.pm 72 2019-06-11 07:28:00Z minus $
2 use strict;
3 use utf8;
4  
5 =encoding utf8
6  
7 =head1 NAME
8  
9 MToken::DeviceSkel - Internal helper's methods for MToken
10  
11 =head1 VIRSION
12  
13 Version 1.00
14  
15 =head1 SYNOPSIS
16  
17 none
18  
19 =head1 DESCRIPTION
20  
21 Internal helper's methods for MToken
22  
23 no public methods
24  
25 =head2 build, dirs, pool
26  
27 Main methods. For internal use only
28  
29 =head1 SEE ALSO
30  
31 L<MToken>, L<CTK::Skel>
32  
33 =head1 AUTHOR
34  
35 Serż Minus (Sergey Lepenkov) L<http://www.serzik.com> E<lt>abalama@cpan.orgE<gt>
36  
37 =head1 COPYRIGHT
38  
39 Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved
40  
41 =head1 LICENSE
42  
43 This program is free software; you can redistribute it and/or
44 modify it under the same terms as Perl itself.
45  
46 See C<LICENSE> file and L<https://dev.perl.org/licenses/>
47  
48 =cut
49  
50 use constant SIGNATURE => "device";
51  
52 use vars qw/ $VERSION /;
53 $VERSION = '1.00';
54  
55 sub build { # Building
56 my $self = shift;
57  
58 my $rplc = $self->{rplc};
59 $rplc->{TODO} = "TODO";
60 $rplc->{ENDSIGN} = "__END__"; # END signature
61  
62 $self->maybe::next::method();
63 return 1;
64 }
65 sub dirs { # Directories and permissions as array of hashs
66 my $self = shift;
67 $self->{subdirs}{(SIGNATURE)} = [
68 {
69 path => 'keys',
70 mode => 0755,
71 },
72  
73 {
74 path => 'certs',
75 mode => 0755,
76 },
77  
78 {
79 path => 'backup',
80 mode => 0755,
81 },
82  
83 {
84 path => 'restore',
85 mode => 0755,
86 },
87  
88 {
89 path => 'etc',
90 mode => 0755,
91 },
92 ];
93 $self->maybe::next::method();
94 return 1;
95 }
96 sub pool { # Multipart pool of files
97 my $self = shift;
98 my $pos = tell DATA;
99 my $data = scalar(do { local $/; <DATA> });
100 seek DATA, $pos, 0;
101 $self->{pools}{(SIGNATURE)} = $data;
102 $self->maybe::next::method();
103 return 1;
104 }
105  
106 1;
107  
108 __DATA__