Make super() carp if you pass it arguments
[gitmo/Moose.git] / inc / RequireAuthorDeps.pm
CommitLineData
b7838518 1package inc::RequireAuthorDeps;
2
b5ae7c00 3use Class::Load qw(load_class);
b7838518 4use Moose;
5
1ebf2c00 6use CPAN::Meta::Requirements;
b7838518 7use Try::Tiny;
8
9with 'Dist::Zilla::Role::BeforeRelease';
10
11sub before_release {
12 my $self = shift;
13
14 $self->log("Ensuring all author dependencies are installed");
1ebf2c00 15 my $req = CPAN::Meta::Requirements->new;
b7838518 16 my $prereqs = $self->zilla->prereqs;
17
18 for my $phase (qw(build test configure runtime develop)) {
19 $req->add_requirements($prereqs->requirements_for($phase, 'requires'));
20 }
21
22 for my $mod (grep { $_ ne 'perl' } $req->required_modules) {
b5ae7c00 23 load_class($mod);
b7838518 24 }
25}
26
271;