Browse files

Add remove_plugin param

You can't pass multivalue params to @Filter, so I have to do my own
filtering.
  • Loading branch information...
1 parent b24cae1 commit f7a183d269bf765e7364b90421c59abdf5790ec8 @madsen committed Nov 6, 2011
Showing with 16 additions and 1 deletion.
  1. +1 −0 Changes
  2. +15 −1 lib/Dist/Zilla/PluginBundle/Author/CJM.pm
View
1 Changes
@@ -3,6 +3,7 @@ Revision history for Dist-Zilla-PluginBundle-Author-CJM
4.11 NOT
- Add CheckPrereqsIndexed
- Pass check_recommend param to RecommendedPrereqs
+ - Add remove_plugin param (Can't pass multivalue params to @Filter)
- Improve documentation
4.10 November 1, 2011
View
16 lib/Dist/Zilla/PluginBundle/Author/CJM.pm
@@ -102,6 +102,12 @@ If true, VersionFromModule is omitted.
Passed to PodLoom as its C<template>.
+=attr remove_plugin
+
+The named plugin is removed from the bundle (may be specified multiple
+times). This exists because you can't pass multi-value parameters
+through L<@Filter|Dist::Zilla::PluginBundle::Filter>.
+
=attr skip_index_check
Passed to CheckPrereqsIndexed as its C<skips>.
@@ -169,9 +175,17 @@ sub configure
'UploadToCPAN',
[ ArchiveRelease => { directory => 'cjm_releases' } ],
);
+
+ if (my $remove = $arg->{remove_plugin}) {
+ my $prefix = $self->name . '/';
+ my %remove = map { $prefix . $_ => 1 } @$remove;
+ my $plugins = $self->plugins;
+ @$plugins = grep { not $remove{$_->[0]} } @$plugins;
+ }
} # end configure
-sub mvp_multivalue_args { qw(check_files check_recommend skip_index_check) }
+sub mvp_multivalue_args { qw(check_files check_recommend remove_plugin
+ skip_index_check) }
no Moose;
__PACKAGE__->meta->make_immutable;

0 comments on commit f7a183d

Please sign in to comment.