X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FDist%2FZilla%2FPluginBundle%2FAuthor%2FCCM.pm;h=356f6c60b6f7852c9e1888d63a3f64abda8bbcb9;hb=9d0e5b43bfd9d69f39ec1c4bf2a28dab741ee4b2;hp=177b79b26989386930f31d419fedf0a46c13e8af;hpb=b3d8e8697c056b409772cd63145088d5cec4d153;p=chaz%2Fp5-Dist-Zilla-PluginBundle-Author-CCM diff --git a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm index 177b79b..356f6c6 100644 --- a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm +++ b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm @@ -13,8 +13,6 @@ You probably don't want to use this. ; VERSION [Git::NextVersion] - [ReversionOnRelease] - prompt = 1 ; GATHER [Git::GatherDir] @@ -83,8 +81,6 @@ You probably don't want to use this. filename = README location = build type = text - [TravisYML] - build_branch = /^(dist|build\/.*)$/ [Manifest] [ManifestSkip] @@ -141,7 +137,29 @@ has max_target_perl => ( lazy => 1, default => sub { my $self = shift; - $self->payload->{'Test::MinimumVersion.max_target_perl'} // $self->payload->{max_target_perl} // '5.10.1'; + $self->payload->{'Test::MinimumVersion.max_target_perl'} + // $self->payload->{max_target_perl} + // '5.10.1'; + }, +); + +=attr no_index + +Set directories to not index. + +Default: + +=cut + +has no_index => ( + is => 'ro', + isa => 'ArrayRef', + lazy => 1, + default => sub { + my $self = shift; + [split(/\s+/, $self->payload->{'MetaNoIndex.directories'} + // $self->payload->{no_index} + // 'eg share shares t xt')]; }, ); @@ -217,43 +235,20 @@ sub configure { 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 @no_index = @{$self->no_index}; + my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md)); my @git_remotes = qw(github origin); my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles); 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!! ***'; } - if (!$self->payload->{'TravisYML.support_builddir'}) { - # swap perl_version and perl_version_build because DZP::TravisYML got it backwards! - # https://github.com/SineSwiper/Dist-Zilla-TravisCI/pull/40 - - my $tmp = $self->payload->{'TravisYML.perl_version_build'}; - if (defined $self->payload->{'TravisYML.perl_version'}) { - $self->payload->{'TravisYML.perl_version_build'} = $self->payload->{'TravisYML.perl_version'} - } - else { - delete $self->payload->{'TravisYML.perl_version_build'}; - } - if (defined $tmp) { - $self->payload->{'TravisYML.perl_version'} = $tmp; - } - else { - delete $self->payload->{'TravisYML.perl_version'}; - } - - ($perl_version, $perl_version_build) = ($perl_version_build, $perl_version); - } - my @plugins = ( # VERSION ['Git::NextVersion'], - ['ReversionOnRelease' => {prompt => 1}], # GATHER ['Git::GatherDir' => {exclude_filename => [@gather_exclude]}], @@ -301,7 +296,6 @@ sub configure { ['License'], ['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'], @@ -334,29 +328,6 @@ 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';