Skip to content

Commit

Permalink
merge static and dynamic prereqs for report
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed May 14, 2012
1 parent fa201da commit eea0b40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -7,6 +7,9 @@ Revision history for Dist-Zilla-Plugin-Test-ReportPrereqs
- Optional CPAN::Meta requirement of generated test file is now
obscured to hide it from prerequisite scanners.

- Static requiremnents are merged with dynamic ones to ensure the
most complete report possible on modules of interest

0.002 2012-05-14 15:11:36 America/New_York

[Changed]
Expand Down
6 changes: 3 additions & 3 deletions lib/Dist/Zilla/Plugin/Test/ReportPrereqs.pm
Expand Up @@ -49,9 +49,8 @@ AUTOMATED_TESTING is true, it reports the version of all modules listed in the
distribution metadata prerequisites (including 'recommends', 'suggests', etc.).
If a MYMETA.json file exists and L<CPAN::Meta> is installed on the testing
machine, MYMETA.json will be examined for prerequisites as it would include any
dynamic prerequisites. Otherwise, a static list of prerequisites is used,
generated when distribution tarball was built.
machine, MYMETA.json will be examined for prerequisites in addition, as it
would include any dynamic prerequisites not set in the distribution metadata.
Versions are reported based on the result of C<parse_version> from
L<ExtUtils::MakeMaker>, which means prerequisite modules are not actually
Expand Down Expand Up @@ -102,6 +101,7 @@ if ( -f "MYMETA.json" && eval "require $cpan_meta" ) { ## no critic
if ( my $meta = eval { CPAN::Meta->load_file("MYMETA.json") } ) {
my $prereqs = $meta->prereqs;
my %uniq = map {$_ => 1} map { keys %$_ } map { values %$_ } values %$prereqs;
$uniq{$_} = 1 for @modules; # don't lose any static ones
@modules = sort keys %uniq;
}
}
Expand Down

0 comments on commit eea0b40

Please sign in to comment.