]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blobdiff - lib/Dist/Zilla/PluginBundle/Author/CCM.pm
Version 0.005
[chaz/p5-Dist-Zilla-PluginBundle-Author-CCM] / lib / Dist / Zilla / PluginBundle / Author / CCM.pm
index 411f4ac9c5b9f07100f1de61d4af3487ccb64065..b58965e0c238c2d04485da8af8d27ffcb33dadfc 100644 (file)
@@ -3,16 +3,28 @@ package Dist::Zilla::PluginBundle::Author::CCM;
 # KEYWORDS: dzil author bundle distribution tool
 
 
+use 5.014;
 use warnings;
 use strict;
 
-our $VERSION = '0.002'; # VERSION
+our $VERSION = '0.005'; # VERSION
 
 use Dist::Zilla::Util;
 use Moose;
 use namespace::autoclean;
 
 
+has authority => (
+    is      => 'ro',
+    isa     => 'Str',
+    lazy    => 1,
+    default => sub {
+        my $self = shift;
+        $self->payload->{'Authority.authority'} // $self->payload->{authority} // 'cpan:CCM';
+    },
+);
+
+
 has installer => (
     is      => 'ro',
     isa     => 'Str',
@@ -40,19 +52,22 @@ has no_upload => (
 sub configure {
     my $self = shift;
 
+    my @copy_from_build     = qw(LICENSE);
+    my @network_plugins     = qw(Git::Push Test::Pod::No404s UploadToCPAN);
+    my @gather_exclude      = (@copy_from_build, qw(README.md));
+    my @gather_prune        = qw(dist.ini);
+    my @no_index            = qw(eg share shares t xt);
+    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';
+
     if ($self->no_upload) {
-        print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
+        say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
     }
 
-    my @copy_from_build = qw(LICENSE);
-    my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
-    my @gather_exclude  = (@copy_from_build, qw(README.md));
-    my @gather_prune    = qw(dist.ini);
-    my @no_index        = qw(eg share shares t xt);
-    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 @plugins = (
 
         # VERSION
@@ -80,6 +95,7 @@ sub configure {
         ['PodSyntaxTests'],
         ['Test::Pod::No404s'],
         ['Test::Compile'],
+        ['Test::MinimumVersion' => {max_target_perl => $perl_version_target}],
         ['Test::EOL' => {finder => [@check_files]}],
         ['Test::NoTabs' => {finder => [@check_files]}],
         ['Test::Perl::Critic'],
@@ -88,7 +104,7 @@ sub configure {
         ['Test::ReportPrereqs'],
 
         # METADATA
-        ['Authority' => {do_munging => 0}],
+        ['Authority' => {authority => $self->authority, do_munging => 0}],
         ['MetaJSON'],
         ['MetaYAML'],
         ['MetaNoIndex' => {directory => [@no_index]}],
@@ -103,9 +119,9 @@ sub configure {
 
         # GENERATE FILES
         ['License'],
-        ['ReadmeAnyFromPod' => 'repo readme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}],
-        ['ReadmeAnyFromPod' => 'dist readme' => {filename => 'README', location => 'build', type => 'text'}],
-        ['TravisYML'],
+        ['ReadmeAnyFromPod' => 'RepoReadme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}],
+        ['ReadmeAnyFromPod' => 'DistReadme' => {filename => 'README', location => 'build', type => 'text'}],
+        ['TravisYML' => {build_branch => '/^(dist|build\/.*)$/', perl_version => $perl_version, perl_version_build => $perl_version_build}],
         ['Manifest'],
         ['ManifestSkip'],
 
@@ -156,7 +172,7 @@ Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built
 
 =head1 VERSION
 
-version 0.002
+version 0.005
 
 =head1 SYNOPSIS
 
@@ -197,6 +213,8 @@ You probably don't want to use this.
     [PodSyntaxTests]
     [Test::Pod::No404s]
     [Test::Compile]
+    [Test::MinimumVersion]
+    max_target_perl     = 5.10.1
     [Test::EOL]
     [Test::NoTabs]
     [Test::Perl::Critic]
@@ -239,6 +257,7 @@ You probably don't want to use this.
     location            = build
     type                = text
     [TravisYML]
+    build_branch        = /^(dist|build\/.*)$/
     [Manifest]
     [ManifestSkip]
 
@@ -265,6 +284,10 @@ You probably don't want to use this.
 
 =head1 ATTRIBUTES
 
+=head2 authority
+
+Specify the release authority. Defaults to C<cpan:CCM>.
+
 =head2 installer
 
 Specify which installer to use, such as:
This page took 0.024699 seconds and 4 git commands to generate.