From 166216d7c076ef2eb8ca60d92103d0b1a22afaea Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Fri, 25 Aug 2017 21:28:25 -0600 Subject: [PATCH] Version 0.008 --- Changes | 5 +++ MANIFEST | 2 +- META.json | 9 ++-- META.yml | 9 ++-- Makefile.PL | 6 ++- README | 6 ++- lib/Dist/Zilla/PluginBundle/Author/CCM.pm | 50 ++++++++++++++++++++--- lib/Pod/Weaver/PluginBundle/Author/CCM.pm | 4 +- t/00-report-prereqs.dd | 1 + 9 files changed, 72 insertions(+), 20 deletions(-) diff --git a/Changes b/Changes index 1a181e9..aab92b1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Dist-Zilla-PluginBundle-Author-CCM. +0.008 2017-08-25 21:28:07-06:00 MST7MDT + + * Automatically figure out perl_version and perl_version_build TravisYML + configuration based on configured minimum perl requirement + 0.007 2017-03-11 18:33:58-07:00 MST7MDT * Prevent writing wrong version to Changes diff --git a/MANIFEST b/MANIFEST index f43d55b..67c2e0e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. .travis.yml Changes LICENSE diff --git a/META.json b/META.json index b5413ad..1ba1568 100644 --- a/META.json +++ b/META.json @@ -4,7 +4,7 @@ "Charles McGarvey " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005", + "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150005", "keywords" : [ "dzil", "author", @@ -120,6 +120,7 @@ "Dist::Zilla::Role::PluginBundle::PluginRemover" : "0", "Dist::Zilla::Util" : "0", "Moose" : "0", + "Perl::Version" : "0", "Pod::Elemental::Transformer::List" : "0", "Pod::Elemental::Transformer::Verbatim" : "0", "Pod::Weaver::Config::Assembler" : "0", @@ -160,11 +161,11 @@ "provides" : { "Dist::Zilla::PluginBundle::Author::CCM" : { "file" : "lib/Dist/Zilla/PluginBundle/Author/CCM.pm", - "version" : "0.007" + "version" : "0.008" }, "Pod::Weaver::PluginBundle::Author::CCM" : { "file" : "lib/Pod/Weaver/PluginBundle/Author/CCM.pm", - "version" : "0.007" + "version" : "0.008" } }, "release_status" : "stable", @@ -179,7 +180,7 @@ "web" : "https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM" } }, - "version" : "0.007", + "version" : "0.008", "x_authority" : "cpan:CCM", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0225" } diff --git a/META.yml b/META.yml index 54df02d..e3a6880 100644 --- a/META.yml +++ b/META.yml @@ -12,7 +12,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005' +generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150005' keywords: - dzil - author @@ -34,10 +34,10 @@ no_index: provides: Dist::Zilla::PluginBundle::Author::CCM: file: lib/Dist/Zilla/PluginBundle/Author/CCM.pm - version: '0.007' + version: '0.008' Pod::Weaver::PluginBundle::Author::CCM: file: lib/Pod/Weaver/PluginBundle/Author/CCM.pm - version: '0.007' + version: '0.008' recommends: Dist::Zilla::Plugin::FakeRelease: '0' Dist::Zilla::Plugin::Prereqs::FromCPANfile: '0' @@ -99,6 +99,7 @@ requires: Dist::Zilla::Role::PluginBundle::PluginRemover: '0' Dist::Zilla::Util: '0' Moose: '0' + Perl::Version: '0' Pod::Elemental::Transformer::List: '0' Pod::Elemental::Transformer::Verbatim: '0' Pod::Weaver::Config::Assembler: '0' @@ -124,6 +125,6 @@ resources: bugtracker: https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues homepage: https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM repository: https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM.git -version: '0.007' +version: '0.008' x_authority: cpan:CCM x_serialization_backend: 'YAML::Tiny version 1.70' diff --git a/Makefile.PL b/Makefile.PL index db0d657..b6f63f0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010. use strict; use warnings; @@ -74,6 +74,7 @@ my %WriteMakefileArgs = ( "Dist::Zilla::Role::PluginBundle::PluginRemover" => 0, "Dist::Zilla::Util" => 0, "Moose" => 0, + "Perl::Version" => 0, "Pod::Elemental::Transformer::List" => 0, "Pod::Elemental::Transformer::Verbatim" => 0, "Pod::Weaver::Config::Assembler" => 0, @@ -103,7 +104,7 @@ my %WriteMakefileArgs = ( "Test::More" => 0, "blib" => "1.01" }, - "VERSION" => "0.007", + "VERSION" => "0.008", "test" => { "TESTS" => "t/*.t" } @@ -172,6 +173,7 @@ my %FallbackPrereqs = ( "IO::Handle" => 0, "IPC::Open3" => 0, "Moose" => 0, + "Perl::Version" => 0, "Pod::Elemental::Transformer::List" => 0, "Pod::Elemental::Transformer::Verbatim" => 0, "Pod::Weaver::Config::Assembler" => 0, diff --git a/README b/README index 31cf3f1..eee8b87 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ NAME VERSION - version 0.007 + version 0.008 SYNOPSIS @@ -117,6 +117,10 @@ DESCRIPTION ATTRIBUTES + max_target_perl + + Specify the minimum perl version. Defaults to 5.10.1. + authority Specify the release authority. Defaults to cpan:CCM. diff --git a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm index 5105692..0b92f30 100644 --- a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm +++ b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm @@ -7,13 +7,25 @@ use 5.014; use warnings; use strict; -our $VERSION = '0.007'; # VERSION +our $VERSION = '0.008'; # VERSION use Dist::Zilla::Util; use Moose; +use Perl::Version; use namespace::autoclean; +has max_target_perl => ( + is => 'ro', + isa => 'Str', + lazy => 1, + default => sub { + my $self = shift; + $self->payload->{'Test::MinimumVersion.max_target_perl'} // $self->payload->{max_target_perl} // '5.10.1'; + }, +); + + has authority => ( is => 'ro', isa => 'Str', @@ -29,7 +41,7 @@ has installer => ( is => 'ro', isa => 'Str', lazy => 1, - default => sub { shift->payload->{installer} || 'MakeMaker' }, + default => sub { shift->payload->{installer} // 'MakeMaker' }, ); @@ -60,9 +72,8 @@ sub configure { my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md)); my @git_remotes = qw(github origin); my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles); - my $perl_version_target = '5.10.1'; - my $perl_version = '5.24 5.22 5.20 5.18 5.16 5.14'; - my $perl_version_build = $perl_version . ' 5.12 5.10 -5.8'; + my $perl_version_target = $self->max_target_perl; + my ($perl_version, $perl_version_build) = $self->_travis_perl_versions($perl_version_target); if ($self->no_upload) { say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***'; @@ -174,6 +185,29 @@ sub configure { $self->add_plugins(@plugins); } +sub _travis_perl_versions { + my $self = shift; + + my $perl_version_target = Perl::Version->new(shift or die 'Missing target version'); + my $min_version = Perl::Version->new('5.14'); + my $min_version_build = Perl::Version->new($perl_version_target); + $min_version_build->subversion(0); + + my @versions; + my @versions_build; + + for my $v (qw{5.26 5.24 5.22 5.20 5.18 5.16 5.14 5.12 5.10 5.8}) { + my $version = Perl::Version->new($v); + push @versions, "$version" if $version >= $min_version_build && $version >= $min_version; + push @versions_build, "$version" if $version >= $min_version_build; + } + + my $perl_version = join(' ', @versions); + my $perl_version_build = join(' ', @versions_build); + + return ($perl_version, $perl_version_build); +} + with 'Dist::Zilla::Role::PluginBundle::Easy'; with 'Dist::Zilla::Role::PluginBundle::PluginRemover'; with 'Dist::Zilla::Role::PluginBundle::Config::Slicer'; @@ -193,7 +227,7 @@ Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built =head1 VERSION -version 0.007 +version 0.008 =head1 SYNOPSIS @@ -305,6 +339,10 @@ You probably don't want to use this. =head1 ATTRIBUTES +=head2 max_target_perl + +Specify the minimum perl version. Defaults to C<5.10.1>. + =head2 authority Specify the release authority. Defaults to C. diff --git a/lib/Pod/Weaver/PluginBundle/Author/CCM.pm b/lib/Pod/Weaver/PluginBundle/Author/CCM.pm index 9c7491b..2b95686 100644 --- a/lib/Pod/Weaver/PluginBundle/Author/CCM.pm +++ b/lib/Pod/Weaver/PluginBundle/Author/CCM.pm @@ -6,7 +6,7 @@ use 5.008; use warnings; use strict; -our $VERSION = '0.007'; # VERSION +our $VERSION = '0.008'; # VERSION use Pod::Weaver::Config::Assembler; use namespace::autoclean; @@ -105,7 +105,7 @@ Pod::Weaver::PluginBundle::Author::CCM - A plugin bundle for pod woven by CCM =head1 VERSION -version 0.007 +version 0.008 =head1 SYNOPSIS diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd index 6aaf302..711e466 100644 --- a/t/00-report-prereqs.dd +++ b/t/00-report-prereqs.dd @@ -89,6 +89,7 @@ do { my $x = { 'Dist::Zilla::Role::PluginBundle::PluginRemover' => '0', 'Dist::Zilla::Util' => '0', 'Moose' => '0', + 'Perl::Version' => '0', 'Pod::Elemental::Transformer::List' => '0', 'Pod::Elemental::Transformer::Verbatim' => '0', 'Pod::Weaver::Config::Assembler' => '0', -- 2.45.2