lib/ASPEER/MakeMaker/MM/Constant.pm

filter: Statementstmt 100% 39 / 39 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 92.4% 49 / 53 CC 1 SCAR 0.0
CC
1
Cov
95%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/ASPEER/MakeMaker/MM/Util.pm ↑ Summary lib/ASPEER/MakeMaker/MM.pm »
1 #
2 # This file is part of ASPEER::MakeMaker.
3 #
4 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # Full license text is available at:
10 #
11 # <http://dev.perl.org/licenses/>
12 #
13 package ASPEER::MakeMaker::MM::Constant;
14  
15  
16 # Pragma
17 #
18 2 ▶use strict qw(vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use vars qw($VERSION @ISA %EXPORT_TAGS @EXPORT_OK @EXPORT %Constant);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 # Modules we need
24 #
25 2 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use File::Basename qw(dirname);
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28  
29 # Version information
30 #
31 2 $VERSION='1.012';
32  
33  
34 # Get module file name and path, derive name of file to store local constants
35 #
36 2 ▶use Cwd qw(abs_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
37 2 my $local_fn=abs_path(__FILE__) . '.local';
38  
39  
40 # Hash of constants
41 #
42 %Constant=(
43  
44  
45 MM_PREFIX => 'ASPEER_MAKEMAKER',
46  
47 ASPEER_MAKEMAKER_PM => 'ASPEER::MakeMaker',
48  
49 TEMPLATE_POSTAMBLE_FN =>
50 File::Spec->catfile(dirname(__FILE__), 'postamble.inc'),
51  
52 UPDATE_SOURCE_UTIL_FN =>
53 File::Spec->catfile(dirname(__FILE__), 'Util.pm'),
54  
55 UPDATE_SOURCE_IMPORT_FN =>
56 File::Spec->catfile(dirname(__FILE__), 'Import.pm'),
57  
58 ASPEER_MAKEMAKER_PM_ARGV => join(',', qw[
59 "$(NAME)"
60 "$(NAME_SYM)"
61 "$(DISTNAME)"
62 "$(DISTVNAME)"
63 "$(VERSION)"
64 "$(VERSION_SYM)"
65 "$(VERSION_FROM)"
66 "$(LICENSE)"
67 "$(AUTHOR)"
68 "$(TO_INST_PM)"
69 "$(EXE_FILES)"
70 "$(DIST_DEFAULT_TARGET)"
71 "$(SUFFIX)"
72 "$(ABSTRACT_FROM)"
73 ]),
74  
75  
76 # Local constants override anything above
77 #
78 2 ▶ %{do($local_fn) || {}},
Condition50%1/2
do $local_fn || {}
l!l
02
MC/DC0%0/1
do $local_fn || {}
do $local_fn
Truth table50%1/2
A
A= do $local_fn
Aresult
11
00
79 2 ▶ %{do(my($fn)=glob(sprintf('~/.%s.local', __PACKAGE__))) || {}} # || {} avoids warning
Subroutine BEGIN: called CC=1 SCAR=0.0
Condition50%1/2
do (my($fn) = glob('~/.ASPEER::MakeMaker::MM::Constant.local')) || {}
l!l
02
MC/DC0%0/1
do (my($fn) = glob('~/.ASPEER::MakeMaker::MM::Constant.local')) || {}
do (my($fn) = glob('~/.ASPEER::MakeMaker::MM::Constant.local'))
Truth table50%1/2
A
A= do (my($fn) = glob('~/.ASPEER::MakeMaker::MM::Constant.local'))
Aresult
11
00
80  
81 );
82  
83  
84 # Export constants to namespace, place in export tags
85 #
86 2 require Exporter;
87 2 @ISA=qw(Exporter);
88 {
89 2 ▶ no warnings qw(once);
Subroutine BEGIN: called CC=1 SCAR=0.0
90 2 foreach (keys %Constant) {${$_}=$Constant{$_}}
91 }
92 2 @EXPORT=map {'$' . $_} keys %Constant;
93 2 @EXPORT_OK=@EXPORT;
94 2 %EXPORT_TAGS=(all => [@EXPORT_OK]);
95 __END__
« lib/ASPEER/MakeMaker/MM/Util.pm ↑ Summary lib/ASPEER/MakeMaker/MM.pm »