ASPEER-MakeMaker-Markdown-Pod
view release on metacpan or search on metacpan
lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm view on Meta::CPAN
#
# Pragma
#
package ASPEER::MakeMaker::Markdown::Pod::MM::Constant;
use strict qw(vars);
use warnings;
use vars qw($VERSION @ISA %EXPORT_TAGS @EXPORT_OK @EXPORT %Constant);
# Modules we need
#
use File::Spec;
use File::Basename qw(dirname);
# Version information
#
$VERSION='1.013';
# Get module file name and path, derive name of file to store local constants
#
use Cwd qw(abs_path);
my $local_fn=abs_path(__FILE__) . '.local';
# Hash of constants
#
%Constant=(
MM_PREFIX => 'MARKPOD',
TEMPLATE_POSTAMBLE_FN =>
File::Spec->catfile(dirname(abs_path(__FILE__)), 'postamble.inc'),
MARKPOD_PM => 'ASPEER::MakeMaker::Markdown::Pod::MM',
MARKPOD_PM_ARGV => join(',', qw[
"$(NAME)"
"$(NAME_SYM)"
"$(DISTNAME)"
"$(DISTVNAME)"
"$(VERSION)"
"$(VERSION_SYM)"
"$(VERSION_FROM)"
"$(LICENSE)"
"$(AUTHOR)"
"$(TO_INST_PM)"
"$(EXE_FILES)"
"$(DIST_DEFAULT_TARGET)"
"$(SUFFIX)"
"$(ABSTRACT_FROM)"
]),
# Local constants override anything above
#
%{do($local_fn) || {}},
%{do(glob(sprintf('~/.%s.local', __PACKAGE__))) || {}} # || {} avoids warning
);
# Export constants to namespace, place in export tags
#
require Exporter;
@ISA=qw(Exporter);
{
no warnings qw(once);
foreach (keys %Constant) {${$_}=$Constant{$_}}
}
@EXPORT=map {'$' . $_} keys %Constant;
@EXPORT_OK=@EXPORT;
%EXPORT_TAGS=(all => [@EXPORT_OK]);
__END__
=begin markdown
# NAME
ASPEER::MakeMaker::Markdown::Pod::MM::Constant - constants for MakeMaker integration
# SYNOPSIS
```perl
use ASPEER::MakeMaker::Markdown::Pod::MM::Constant;
my $postamble = $TEMPLATE_POSTAMBLE_FN;
my $module = $MARKPOD_PM;
my $argv = $MARKPOD_PM_ARGV;
```
# DESCRIPTION
`ASPEER::MakeMaker::Markdown::Pod::MM::Constant` defines constants used by
`ASPEER::MakeMaker::Markdown::Pod::MM` when it extends `ExtUtils::MakeMaker`.
`MM_PREFIX` selects the private `MARKPOD_*` Makefile macro namespace used by
the shared hook implementation. It is hook configuration and is not emitted as
a generic `MM_PREFIX` Makefile macro.
The constants describe where the Makefile postamble template lives, which Perl
module should be invoked by the generated targets, and which MakeMaker
variables should be passed back into the target dispatcher.
# CONSTANTS
`$TEMPLATE_POSTAMBLE_FN`
: Path to the bundled `postamble.inc` template.
`$MARKPOD_PM`
: Module name invoked by the generated Makefile targets. This is normally
`ASPEER::MakeMaker::Markdown::Pod::MM`.
`$MARKPOD_PM_ARGV`
: Quoted list of MakeMaker variables passed to the target dispatcher so methods
such as `doc` and `readme` can reconstruct their input parameters.
# LOCAL OVERRIDES
( run in 0.834 second using v1.01-cache-2.11-cpan-5f8a54ce150 )