« blib/lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm
↑ Summary
blib/lib/ASPEER/MakeMaker/Markdown/Pod.pm »
| 1 | # | ||||||||||||
| 2 | # This file is part of ASPEER::MakeMaker::Markdown::Pod. | ||||||||||||
| 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 | |||||||||||||
| 14 | # | ||||||||||||
| 15 | |||||||||||||
| 16 | |||||||||||||
| 17 | # Pragma | ||||||||||||
| 18 | # | ||||||||||||
| 19 | package ASPEER::MakeMaker::Markdown::Pod::MM::Constant; | ||||||||||||
| 20 | 6 | ▶ | use strict qw(vars); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | 6 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 6 | ▶ | use vars qw($VERSION @ISA %EXPORT_TAGS @EXPORT_OK @EXPORT %Constant); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | |||||||||||||
| 24 | |||||||||||||
| 25 | # Modules we need | ||||||||||||
| 26 | # | ||||||||||||
| 27 | 6 | ▶ | use File::Spec; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | 6 | ▶ | use File::Basename qw(dirname); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 29 | |||||||||||||
| 30 | |||||||||||||
| 31 | # Version information | ||||||||||||
| 32 | # | ||||||||||||
| 33 | 6 | $VERSION='1.013'; | |||||||||||
| 34 | |||||||||||||
| 35 | |||||||||||||
| 36 | # Get module file name and path, derive name of file to store local constants | ||||||||||||
| 37 | # | ||||||||||||
| 38 | 6 | ▶ | use Cwd qw(abs_path); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 39 | 6 | my $local_fn=abs_path(__FILE__) . '.local'; | |||||||||||
| 40 | |||||||||||||
| 41 | |||||||||||||
| 42 | # Hash of constants | ||||||||||||
| 43 | # | ||||||||||||
| 44 | %Constant=( | ||||||||||||
| 45 | |||||||||||||
| 46 | MM_PREFIX => 'MARKPOD', | ||||||||||||
| 47 | |||||||||||||
| 48 | TEMPLATE_POSTAMBLE_FN => | ||||||||||||
| 49 | File::Spec->catfile(dirname(abs_path(__FILE__)), 'postamble.inc'), | ||||||||||||
| 50 | |||||||||||||
| 51 | MARKPOD_PM => 'ASPEER::MakeMaker::Markdown::Pod::MM', | ||||||||||||
| 52 | |||||||||||||
| 53 | MARKPOD_PM_ARGV => join(',', qw[ | ||||||||||||
| 54 | "$(NAME)" | ||||||||||||
| 55 | "$(NAME_SYM)" | ||||||||||||
| 56 | "$(DISTNAME)" | ||||||||||||
| 57 | "$(DISTVNAME)" | ||||||||||||
| 58 | "$(VERSION)" | ||||||||||||
| 59 | "$(VERSION_SYM)" | ||||||||||||
| 60 | "$(VERSION_FROM)" | ||||||||||||
| 61 | "$(LICENSE)" | ||||||||||||
| 62 | "$(AUTHOR)" | ||||||||||||
| 63 | "$(TO_INST_PM)" | ||||||||||||
| 64 | "$(EXE_FILES)" | ||||||||||||
| 65 | "$(DIST_DEFAULT_TARGET)" | ||||||||||||
| 66 | "$(SUFFIX)" | ||||||||||||
| 67 | "$(ABSTRACT_FROM)" | ||||||||||||
| 68 | ]), | ||||||||||||
| 69 | |||||||||||||
| 70 | |||||||||||||
| 71 | # Local constants override anything above | ||||||||||||
| 72 | # | ||||||||||||
| 73 | 6 | ▶ | %{do($local_fn) || {}}, | ||||||||||
|
Condition50%1/2
do $local_fn || {}
MC/DC0%0/1
do $local_fn || {}
do $local_fn
Truth table50%1/2
A
A= do $local_fn
| |||||||||||||
| 74 | 6 | ▶ | %{do(glob(sprintf('~/.%s.local', __PACKAGE__))) || {}} # || {} avoids warning | ||||||||||
|
Condition50%1/2
do (glob('~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local')) || {}
MC/DC0%0/1
do (glob('~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local')) || {}
do (glob('~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local'))
Truth table50%1/2
A
A= do (glob('~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local'))
| |||||||||||||
| 75 | |||||||||||||
| 76 | ); | ||||||||||||
| 77 | |||||||||||||
| 78 | |||||||||||||
| 79 | # Export constants to namespace, place in export tags | ||||||||||||
| 80 | # | ||||||||||||
| 81 | 6 | require Exporter; | |||||||||||
| 82 | 6 | @ISA=qw(Exporter); | |||||||||||
| 83 | { | ||||||||||||
| 84 | 6 | ▶ | no warnings qw(once); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 85 | 6 | foreach (keys %Constant) {${$_}=$Constant{$_}} | |||||||||||
| 86 | } | ||||||||||||
| 87 | 6 | @EXPORT=map {'$' . $_} keys %Constant; | |||||||||||
| 88 | 6 | @EXPORT_OK=@EXPORT; | |||||||||||
| 89 | 6 | %EXPORT_TAGS=(all => [@EXPORT_OK]); | |||||||||||
| 90 | __END__ | ||||||||||||