Skip to content

Commit

Permalink
Merge pull request #59 from Grinnz/quote_versions
Browse files Browse the repository at this point in the history
Quote versions in Makefile.PL/Build.PL templates
  • Loading branch information
Grinnz committed Mar 23, 2017
2 parents 4c7e346 + 834c175 commit c130899
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
24 changes: 12 additions & 12 deletions Makefile.PL
Expand Up @@ -8,22 +8,22 @@ WriteMakefile(
NAME => 'Module::Starter',
AUTHOR => 'Andy Lester <andy@petdance.com>',
VERSION_FROM => 'lib/Module/Starter.pm',
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
(eval { ExtUtils::MakeMaker->VERSION(6.48) } ? (MIN_PERL_VERSION => '5.6.1') : ()),
(eval { ExtUtils::MakeMaker->VERSION('6.21') } ? (LICENSE => 'perl') : ()),
(eval { ExtUtils::MakeMaker->VERSION('6.48') } ? (MIN_PERL_VERSION => '5.6.1') : ()),
ABSTRACT_FROM => 'lib/Module/Starter.pm',
EXE_FILES => [ 'bin/module-starter' ],
PREREQ_PM => {
'Test::More' => 0,
'Test::Harness' => 0.21,
'ExtUtils::Command' => 0,
'File::Spec' => 0,
'Path::Class' => 0,
'Getopt::Long' => 0,
'Pod::Usage' => 1.21,
'parent' => 0,
'Module::Install::AuthorTests' => 0,
'Test::More' => '0',
'Test::Harness' => '0.21',
'ExtUtils::Command' => '0',
'File::Spec' => '0',
'Path::Class' => '0',
'Getopt::Long' => '0',
'Pod::Usage' => '1.21',
'parent' => '0',
'Module::Install::AuthorTests' => '0',
},
(! eval { ExtUtils::MakeMaker->VERSION(6.46) } ? () :
(! eval { ExtUtils::MakeMaker->VERSION('6.46') } ? () :
(META_ADD => {
resources => {
homepage => 'https://github.com/xsawyerx/module-starter',
Expand Down
30 changes: 15 additions & 15 deletions lib/Module/Starter/Simple.pm
Expand Up @@ -106,7 +106,7 @@ sub create_distro {
($self->{email_obfuscated} = $self->{email}) =~ s/@/ at /;

$self->{license} ||= 'artistic2';
$self->{minperl} ||= 5.006;
$self->{minperl} ||= '5.006';
$self->{ignores_type} ||= ['generic'];
$self->{manifest_skip} = !! grep { /manifest/ } @{ $self->{ignores_type} };

Expand Down Expand Up @@ -768,16 +768,16 @@ WriteMakefile(
ABSTRACT_FROM => '$main_pm_file',
LICENSE => '$slname',
PL_FILES => {},
MIN_PERL_VERSION => $self->{minperl},
MIN_PERL_VERSION => '$self->{minperl}',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 0,
'ExtUtils::MakeMaker' => '0',
},
BUILD_REQUIRES => {
'Test::More' => 0,
'Test::More' => '0',
},
PREREQ_PM => {
#'ABC' => 1.6,
#'Foo::Bar::Module' => 5.0401,
#'ABC' => '1.6',
#'Foo::Bar::Module' => '5.0401',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => '$self->{distro}-*' },
Expand Down Expand Up @@ -817,7 +817,7 @@ all_from '$main_pm_file';
author q{$author};
license '$self->{license}';
perl_version $self->{minperl};
perl_version '$self->{minperl}';
tests_recursive('t');
Expand All @@ -831,16 +831,16 @@ resources (
);
configure_requires (
'Module::Install' => 0,
'Module::Install' => '0',
);
build_requires (
'Test::More' => 0,
'Test::More' => '0',
);
requires (
#'ABC' => 1.6,
#'Foo::Bar::Module' => 5.0401,
#'ABC' => '1.6',
#'Foo::Bar::Module' => '5.0401',
);
install_as_cpan;
Expand Down Expand Up @@ -910,14 +910,14 @@ my \$builder = Module::Build->new(
dist_version_from => '$main_pm_file',
release_status => 'stable',
configure_requires => {
'Module::Build' => 0,
'Module::Build' => '0',
},
build_requires => {
'Test::More' => 0,
'Test::More' => '0',
},
requires => {
#'ABC' => 1.6,
#'Foo::Bar::Module' => 5.0401,
#'ABC' => '1.6',
#'Foo::Bar::Module' => '5.0401',
},
add_to_cleanup => [ '$self->{distro}-*' ],
);
Expand Down
2 changes: 1 addition & 1 deletion t/data/templates/Makefile.PL
Expand Up @@ -9,7 +9,7 @@ WriteMakefile(
ABSTRACT_FROM => 'lib/Foo/Bar.pm',
PL_FILES => {},
PREREQ_PM => {
'Test::More' => 0,
'Test::More' => '0',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Foo-Bar-*' },
Expand Down
24 changes: 12 additions & 12 deletions t/test-dist.t
Expand Up @@ -541,7 +541,7 @@ sub parse_file_start {

my $distro = $self->{distro};
my $mainmod = $self->{modules}[0];
my $minperl = $self->{minperl} || 5.006;
my $minperl = $self->{minperl} || '5.006';

my $slname = $LICENSES->{ $self->{license} }->{slname};
my $license_url = $LICENSES->{ $self->{license} }->{url};
Expand Down Expand Up @@ -619,17 +619,17 @@ sub parse_file_start {
);

$self->parse(
qr/\A\s*configure_requires => \{\n *\Q'$self->{builder}' => 0\E,\n\s*\},\n/ms,
qr/\A\s*configure_requires => \{\n *\Q'$self->{builder}' => '0'\E,\n\s*\},\n/ms,
"Configure Requires",
);

$self->parse(
qr/\A\s*build_requires => \{\n *\Q'Test::More' => 0\E,\n\s*\},\n/ms,
qr/\A\s*build_requires => \{\n *\Q'Test::More' => '0'\E,\n\s*\},\n/ms,
"Build Requires",
);

$self->parse(
qr/\A\s*requires => \{\n *#'ABC' *=> 1.6,\n *#'Foo::Bar::Module' => 5.0401,\n\s*\},\n/ms,
qr/\A\s*requires => \{\n *#'ABC' *=> '1.6',\n *#'Foo::Bar::Module' => '5.0401',\n\s*\},\n/ms,
"Requires",
);

Expand Down Expand Up @@ -668,22 +668,22 @@ sub parse_file_start {
"PL_FILES",
);

$self->parse(qr{\A\s*MIN_PERL_VERSION *=> *\Q$minperl,\E\n}ms,
$self->parse(qr{\A\s*MIN_PERL_VERSION *=> *\Q'$minperl',\E\n}ms,
"MIN_PERL_VERSION",
);

$self->parse(
qr/\A\s*CONFIGURE_REQUIRES => \{\n *\Q'$self->{builder}' => 0\E,\n\s*\},\n/ms,
qr/\A\s*CONFIGURE_REQUIRES => \{\n *\Q'$self->{builder}' => '0'\E,\n\s*\},\n/ms,
"CONFIGURE_REQUIRES",
);

$self->parse(
qr/\A\s*BUILD_REQUIRES => \{\n *\Q'Test::More' => 0\E,\n\s*\},\n/ms,
qr/\A\s*BUILD_REQUIRES => \{\n *\Q'Test::More' => '0'\E,\n\s*\},\n/ms,
"BUILD_REQUIRES",
);

$self->parse(
qr/\A\s*PREREQ_PM => \{\n *#'ABC' *=> 1.6,\n *#'Foo::Bar::Module' => 5.0401,\n\s*\},\n/ms,
qr/\A\s*PREREQ_PM => \{\n *#'ABC' *=> '1.6',\n *#'Foo::Bar::Module' => '5.0401',\n\s*\},\n/ms,
"PREREQ_PM",
);
}
Expand All @@ -709,7 +709,7 @@ sub parse_file_start {
"license",
);

$self->parse(qr{\Aperl_version\s+\Q$minperl;\E\n\n}ms,
$self->parse(qr{\Aperl_version\s+\Q'$minperl';\E\n\n}ms,
"perl_version",
);

Expand All @@ -730,17 +730,17 @@ resources (
EOT

$self->parse(
qr/\A\s*configure_requires \(\n *\Q'$self->{builder}' => 0\E,\n\s*\);\n/ms,
qr/\A\s*configure_requires \(\n *\Q'$self->{builder}' => '0'\E,\n\s*\);\n/ms,
"configure_requires",
);

$self->parse(
qr/\A\s*build_requires \(\n *\Q'Test::More' => 0\E,\n\s*\);\n/ms,
qr/\A\s*build_requires \(\n *\Q'Test::More' => '0'\E,\n\s*\);\n/ms,
"build_requires",
);

$self->parse(
qr/\A\s*requires \(\n *#'ABC' *=> 1.6,\n *#'Foo::Bar::Module' => 5.0401,\n\s*\);\n/ms,
qr/\A\s*requires \(\n *#'ABC' *=> '1.6',\n *#'Foo::Bar::Module' => '5.0401',\n\s*\);\n/ms,
"requires",
);

Expand Down

0 comments on commit c130899

Please sign in to comment.