MToken/Const.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 93.7% 30 / 32 SCAR 11.0
CC
3
Cov
93%
BEGIN
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« MToken/MM.pm ↑ Summary MToken/DeviceSkel.pm »
1 package MToken::Const; # $Id: Const.pm 72 2019-06-11 07:28:00Z minus $
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =encoding utf-8
6  
7 =head1 NAME
8  
9 MToken::Const - Interface for MToken Constants
10  
11 =head1 VERSION
12  
13 Version 1.01
14  
15 =head1 SYNOPSIS
16  
17 use MToken::Const;
18  
19 =head1 DESCRIPTION
20  
21 This module provide interface for MToken Constants
22  
23 =head2 PROJECT, PROJECTNAME
24  
25 Returns name of the project
26  
27 =head1 HISTORY
28  
29 See C<Changes> file
30  
31 =head1 TO DO
32  
33 See C<TODO> file
34  
35 =head1 BUGS
36  
37 * none noted
38  
39 =head1 SEE ALSO
40  
41 L<MToken>
42  
43 =head1 AUTHOR
44  
45 Serż Minus (Sergey Lepenkov) L<http://www.serzik.com> E<lt>abalama@cpan.orgE<gt>
46  
47 =head1 COPYRIGHT
48  
49 Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved
50  
51 =head1 LICENSE
52  
53 This program is free software; you can redistribute it and/or
54 modify it under the same terms as Perl itself.
55  
56 See C<LICENSE> file and L<https://dev.perl.org/licenses/>
57  
58 =cut
59  
60 use constant {
61 # GENERAL
62 2 ▶ PROJECT => 'mtoken',
Branch: 2 branches
BranchTrueFalseTotal
$^O =~ /mswin/i ? : 0 2 2
$^O =~ /mswin/i ? : 0 2 2
63 PROJECTNAME => 'mtoken',
64 PREFIX => 'mtoken',
65 HOSTNAME => 'localhost',
66 DEFAULT_URL => 'http://localhost',
67 MSWIN => $^O =~ /mswin/i ? 1 : 0,
68 DIR_KEYS => 'keys',
69 DIR_CERTS => 'certs',
70 DIR_ETC => 'etc',
71 DIR_BACKUP => 'backup',
72 DIR_RESTORE => 'restore',
73 DIR_TMP => $^O =~ /mswin/i ? 'tmp' : '.tmp',
74 GLOBAL_CONF_FILE => 'mtoken.conf',
75 LOCAL_CONF_FILE => '.mtoken',
76 PWCACHE_FILE => '.pwcache',
77  
78 PUBLIC_GPG_KEY => 'public.key',
79 PRIVATE_GPG_KEY => 'private.key',
80 MY_PUBLIC_KEY => 'mypublic.key',
81 MY_PRIVATE_KEY => 'myprivate.key',
82 GPGCONFFILE => 'gpg.conf',
83 GPGBIN => 'gpg',
84 OPENSSLBIN => 'openssl',
85  
86 # MATH
87 TRUE => 1,
88 FALSE => 0,
89  
90 # CRYPT
91 KEYSUFFIX => '.key',
92 KEYMINSIZE => 32,
93 KEYMAXSIZE => 2048,
94  
95 # TEST
96 FOO => 1,
97 BAR => 2,
98 BAZ => 3,
99  
100 2 ▶ };
Subroutine BEGIN: called CC=3 SCAR=11.0
101  
102 2 ▶use base qw/Exporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 2 ▶use vars qw/$VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS/;
Subroutine BEGIN: called CC=1 SCAR=0.0
105 2 $VERSION = '1.01';
106  
107 # Named groups of exports
108 2 %EXPORT_TAGS = (
109 'GENERAL' => [qw/
110 PROJECT PROJECTNAME PREFIX
111 HOSTNAME DEFAULT_URL
112 DIR_KEYS DIR_CERTS DIR_ETC DIR_BACKUP DIR_RESTORE DIR_TMP
113 GLOBAL_CONF_FILE LOCAL_CONF_FILE PWCACHE_FILE
114 MY_PUBLIC_KEY MY_PRIVATE_KEY
115 GPGCONFFILE PUBLIC_GPG_KEY PRIVATE_GPG_KEY
116 MSWIN
117 OPENSSLBIN GPGBIN
118 /],
119 'MATH' => [qw/
120 TRUE FALSE
121 /],
122 'CRYPT' => [qw/
123 KEYSUFFIX KEYMINSIZE KEYMAXSIZE
124 /],
125 'TEST' => [qw/
126 FOO
127 BAR
128 BAZ
129  
130 /],
131 );
132  
133 # Items to export into callers namespace by default
134 # (move infrequently used names to @EXPORT_OK below)
135 @EXPORT = (
136 2 @{$EXPORT_TAGS{GENERAL}},
137 );
138  
139 # Other items we are prepared to export if requested
140 @EXPORT_OK = (
141 2 map {@{$_}} values %EXPORT_TAGS
142 );
143  
144 2 1;
« MToken/MM.pm ↑ Summary MToken/DeviceSkel.pm »