Skip to content

Commit

Permalink
Merge aff9037 into 009f5ab
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed May 17, 2020
2 parents 009f5ab + aff9037 commit d600ffd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ before_install:
- build-perl
- perl -V
install:
- perl -M5.014 -e1 2>/dev/null || cpan-install Dist::Zilla@5.048
- cpan-install --deps # installs prereqs, including recommends
- cpan-install --coverage # installs converage prereqs, if enabled
before_script:
Expand Down
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Revision history for Dist-Zilla-Plugin-Prereqs-AuthorDeps

{{$NEXT}}

[CHANGED]

- plugins that exist in the local build root are not added as prereqs.

0.006 2016-05-02 11:06:55-04:00 America/New_York

[CHANGED]
Expand Down
2 changes: 2 additions & 0 deletions corpus/DZ/dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ exclude = Dist::Zilla::Plugin::RemovePrereqs
[RemovePrereqs]
remove = MostlyHarmless

[=inc::Foo]

; authordep Devel::Foo = 0.123
5 changes: 5 additions & 0 deletions corpus/DZ/inc/Foo.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package inc::Foo;
use Moose;
with 'Dist::Zilla::Role::BeforeBuild';
sub before_build { 1 }
1;
5 changes: 5 additions & 0 deletions lib/Dist/Zilla/Plugin/Prereqs/AuthorDeps.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ our $VERSION = '0.007';
use Moose;
use MooseX::Types::Moose qw( HashRef ArrayRef Str );
use List::Util qw/min/;
use Path::Tiny;

use Dist::Zilla::Util::AuthorDeps 5.021;
use Dist::Zilla 4;
Expand Down Expand Up @@ -81,6 +82,10 @@ sub register_prereqs {
for my $req (@$authordeps) {
my ( $mod, $version ) = each %$req;
next if $self->_exclude_hash->{$mod};

(my $filename = $mod) =~ s{::}{/}g;
next if path($self->zilla->root, $filename.'.pm')->exists;

$zilla->register_prereqs( { phase => $phase, type => $relation }, $mod, $version );
}

Expand Down
3 changes: 3 additions & 0 deletions t/prereqs.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ use CPAN::Meta;

require Dist::Zilla; # for VERSION

plan skip_all => '$cwd needs to be $zilla->root for these tests (requires Dist::Zilla 6.003)'
if not eval { Dist::Zilla->VERSION('6.003') };

my $root = 'corpus/DZ';
my $dz_version = min( 5, int( Dist::Zilla->VERSION ) );

Expand Down

0 comments on commit d600ffd

Please sign in to comment.