| 1 | use 5.008; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package Dist::Zilla::PluginBundle::SVK; | ||
| 6 | # ABSTRACT: all SVK plugins in one go | ||
| 7 | |||
| 8 | use Moose; | ||
| 9 | use Class::MOP; | ||
| 10 | |||
| 11 | with 'Dist::Zilla::Role::PluginBundle'; | ||
| 12 | |||
| 13 | # bundle all svk plugins | ||
| 14 | my @names = qw{ Check Commit Tag Push }; | ||
| 15 | |||
| 16 | my %multi; | ||
| 17 | for my $name (@names) { | ||
| 18 | my $class = "Dist::Zilla::Plugin::SVK::$name"; | ||
| 19 | Class::MOP::load_class($class); | ||
| 20 | @multi{$class->mvp_multivalue_args} = (); | ||
| 21 | } | ||
| 22 | |||
| 23 | sub mvp_multivalue_args { keys %multi; } | ||
| 24 | |||
| 25 | sub bundle_config { | ||
| 26 | my ($self, $section) = @_; | ||
| 27 | #my $class = ( ref $self ) || $self; | ||
| 28 | my $arg = $section->{payload}; | ||
| 29 | |||
| 30 | my @config; | ||
| 31 | |||
| 32 | for my $name (@names) { | ||
| 33 | my $class = "Dist::Zilla::Plugin::SVK::$name"; | ||
| 34 | my %payload; | ||
| 35 | foreach my $k (keys %$arg) { | ||
| 36 | $payload{$k} = $arg->{$k} if $class->can($k); | ||
| 37 | } | ||
| 38 | push @config, [ "$section->{name}/$name" => $class => \%payload ]; | ||
| 39 | } | ||
| 40 | |||
| 41 | return @config; | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | __PACKAGE__->meta->make_immutable; | ||
| 46 | no Moose; | ||
| 47 | 1; | ||
| 48 | |||
| 49 | |||
| 50 | =pod | ||
| 51 | |||
| 52 | =head1 NAME | ||
| 53 | |||
| 54 | Dist::Zilla::PluginBundle::SVK - all SVK plugins in one go | ||
| 55 | |||
| 56 | =head1 VERSION | ||
| 57 | |||
| 58 | version 0.10 | ||
| 59 | |||
| 60 | =head1 SYNOPSIS | ||
| 61 | |||
| 62 | In your F<dist.ini>: | ||
| 63 | |||
| 64 | [@SVK] | ||
| 65 | changelog = Changes ; this is the default | ||
| 66 | allow_dirty = dist.ini ; see SVK::Check... | ||
| 67 | allow_dirty = Changes ; ... and SVK::Commit | ||
| 68 | commit_msg = v%v%n%n%c ; see SVK::Commit | ||
| 69 | tag_format = %v ; see SVK::Tag | ||
| 70 | tag_message = %v ; see SVK::Tag | ||
| 71 | tag_directory = tag ; see SVK::Tag | ||
| 72 | push_to = origin ; see SVK::Push # not ported | ||
| 73 | |||
| 74 | =head1 DESCRIPTION | ||
| 75 | |||
| 76 | This is a plugin bundle to load all svk plugins. It is equivalent to: | ||
| 77 | |||
| 78 | [SVK::Check] | ||
| 79 | [SVK::Commit] | ||
| 80 | [SVK::Tag] | ||
| 81 | [SVK::Push] | ||
| 82 | |||
| 83 | The options are passed through to the plugins. | ||
| 84 | |||
| 85 | =for Pod::Coverage bundle_config | ||
| 86 | mvp_multivalue_args | ||
| 87 | |||
| 88 | =head1 AUTHOR | ||
| 89 | |||
| 90 | Dr Bean <drbean at (a) cpan dot (.) org> | ||
| 91 | |||
| 92 | =head1 COPYRIGHT AND LICENSE | ||
| 93 | |||
| 94 | This software is copyright (c) 2010 by Dr Bean. | ||
| 95 | |||
| 96 | This is free software; you can redistribute it and/or modify it under | ||
| 97 | the same terms as the Perl 5 programming language system itself. | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | |||
| 102 | __END__ |