Dist::Zilla::Plugin::TemplateXS - A simple xs-file-from-template plugin
version 0.003
; In your profile.ini [TemplateXS] style = MakeMaker
This is a FileGatherer used for creating new XS files when minting a new dist with dzil new. It uses Text::Template (via Dist::Zilla::Role::TextTemplate) to render a template into a XS file. The template is given three variables for use in rendering: $name, the module name; $dist, the Dist::Zilla object, and $style, the style attribute that determines the location of the new file.
dzil new
$name
$dist
$style
style
This mandatory argument affects the location of the new XS file. Possible values are:
MakeMaker
This will cause the XS file for Foo::Bar to be written to Bar.xs.
ModuleBuild
This will cause the XS file for Foo::Bar to be written to lib/Foo/Bar.xs.
This contains the path to the template that is to be used. If not set, a default template will be used that looks something like this:
#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = {{ $name }} PACKAGE = {{ $name }} PROTOTYPES: DISABLED
This returns the filename for $module_name, given the specified style.
$module_name
This returns the appropriate content for $module_name.
This adds an XS file for the main module of the distribution.
Leon Timmermans <leont@cpan.org>
This software is copyright (c) 2014 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::TemplateXS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::TemplateXS
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::TemplateXS
For more information on module installation, please visit the detailed CPAN module installation guide.