NAME
Dist::PolicyFiles - Generate CONTRIBUTING.md and SECURITY.md
VERSION
Version 0.01
SYNOPSIS
use Dist::PolicyFiles;
my $obj = Dist::PolicyFiles->new(login => $login_name, module => $module);
$obj->create_contrib_md();
$obj->create_security_md();
DESCRIPTION
This module is used to generate the policy files CONTRIBUTING.md and
SECURITY.md. It comes with the dist-policyfiles command line tool.
METHODS
Constructor
The constructor new() accepts the following named arguments, where login
and module are mandatory:
-
dirOptional. Directory where the policy files should be written. By default, this is the current working directory. See also accessor of the same name.
-
emailOptional. User's email address. If not specified,
new()tries to read it from comments inHOME/.ssh/config(see GitHub::Config::SSH::UserData).See also the accessor method of the same name.
-
full_nameOptional. User's full name. If not specified,
new()tries to read it from comments inHOME/.ssh/config(see GitHub::Config::SSH::UserData).See also the accessor method of the same name.
-
loginMandatory. User's github login name.
See also the accessor method of the same name.
-
moduleMandatory. Module name.
See also the accessor method of the same name.
-
prefixOptional. Prefix for repo name, see method
create_security_md(). Default is an empty string.See also the accessor method of the same name.
-
uncapitalizeOptional. Set this to
trueif your repo name is lower case, see methodcreate_security_md(). Default isfalse.See also the accessor method of the same name.
Generation of policy files
-
create_contrib_md(_CONTRIB_MD_TMPL_) -
create_contrib_md()Creates
CONTRIBUTING.mdin directorydir(see corresponding constructor argument). Optional argumentCONTRIB_MD_TMPLis the name of a template file (see Text::Template) for this policy. If this argument is not specified, then the internal default template is used.The template can use the following variables:
-
$cpan_rtCPAN's request tracker, e.g.:
https://rt.cpan.org/NoAuth/ReportBug.html?Queue=My-Great-Module -
$emailUser's email address.
-
$full_nameUser's full name.
-
$github_iGithub issue, e.g.:
https://github.com/jd/My-Great-Module/issuesSee method
create_security_md()for information on how the repo name is generated. -
$module
-
-
create_security_md(_NAMED_ARGUMENTS_)Creates
SECURITY.mdin directorydir(see corresponding constructor argument). The arguments accepted by this method are exactly the same as those accepted by thenew()method of Software::Security::Policy::Individual.However, there are the following defaults:
-
maintainer:User's full name and email address, e.g.:
John Doe <jd@cpan.org> -
programModule name, see constructor argument
module. -
urlhttps://github.com/LOGIN/REPO/blob/main/SECURITY.mdwhere:
-
LOGINUser's login name, see constructor argument
login. -
REPOThe repo name is structured as follows:
- The repo name begins with the contents of <prefix()>.
- The rest of the repo name is the module name where the double colons are replaced with hyphens.
- If the constructor argument
uncapitalisewastrue, the latter part of the repo name is changed to lower case.
-
To completely disable one of these arguments, set it to
undefor an empty string. -
Accessors
-
dir()Returns the value passed via the constructor argument
diror the default value'.'. -
email()Returns the user's email address.
-
full_name()Returns the user's full name.
-
login()Returns the value passed via the constructor argument
login. -
module()Returns the value passed via the constructor argument
module. -
prefix()Returns the value passed via the constructor argument
prefixor the default value (empty string). -
uncapitalize()Returns the value passed via the constructor argument
uncapitalizeor the default value (false).
AUTHOR
Klaus Rindfrey, <klausrin at cpan.org.eu>
BUGS
Please report any bugs or feature requests to bug-dist-policyfiles at rt.cpan.org, or through
the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dist-PolicyFiles. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
SEE ALSO
dist-policyfiles, GitHub::Config::SSH::UserData, Software::Security::Policy::Individual, Text::Template
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Dist::PolicyFiles
You can also look for information at:
-
RT: CPAN's request tracker (report bugs here)
-
Search CPAN
-
GitHub Repository
LICENSE AND COPYRIGHT
This software is copyright (c) 2025 by Klaus Rindfrey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.