CPAN::Changes::Group::Dependencies::Stats - Create a Dependencies::Stats section detailing summarized differences
version 0.002008
use CPAN::Changes::Release 0.29; use CPAN::Changes::Group::Dependencies::Stats; my $s = CPAN::Changes::Group::Dependencies::Stats->new( prelude => [ 'Change statistics since 1.00' ], new_prereqs => CPAN::Meta->load_file('Dist-Foo-1.01/META.json')->effective_prereqs, old_prereqs => CPAN::Meta->load_file('Dist-Foo-1.00/META.json')->effective_prereqs, ); # Currently slightly complicated due to groups themselves # not presently being pluggable. my $rel = CPAN::Changes::Release->new( version => '1.01' ); $rel->attach( $s ) if $s->has_changes; $rel->serialize(); # RESULT # # [ Dependencies::Stats ] # - Change statistics since 1.00 # - build: -1 (recommends: -1) # - configure: +1 -1 (recommends: +1 -1) # - develop: +5 -5 (suggests: +2 -1) # - test: (recommends: +1 ↑1)
This module is a utility tool that produces short, summarized details about changes in dependencies between two sets of prerequisites such that one can visually identify at a glance the general nature of the dependency changes without being swamped by the specifics, only looking into the specifics when the summary indicates it is warranted.
This aims to be a utility to assist downstream in quickly assessing effort when performing manual updates.
has_changes
Returns whether this group has any interesting changes or not.
if ( $group->has_changes ) { $release->attach_group( $group ); } else { $release->delete_group( $group->name ); }
changes
Returns a list of change entries.
my $changes = $object->changes; say $_ for @{$changes};
Format:
%phase: %requiredstats (%optlabel: %optstats, ...)
%phase is one of configure, build, runtime, develop, test
%phase
configure
build
runtime
develop
test
%optlabel is one of recommends, suggests
%optlabel
recommends
suggests
%requiredstats and %optstats are strings of stat changes:
%requiredstats
%optstats
%symbol%number %symbol%number ...
%symbol is:
%symbol
+ a dependency previously unseen in this phase/rel was added. ↑ a dependency in this phase/rel had its version requirement increased. ↓ a dependency in this phase/rel had its version requirement decreased. - this phase/rel had a dependency removed ~ a dependency type where either side was a complex version requirement changed in some way.
For instance, this diff would display as:
[ Dependencies::Stats ] - configure: +2 - develop: +12 ↑3 -2 (suggests: +58) - runtime: +3 - test: +1 ↓1 -1 (recommends: +2)
Which is far less scary ☺
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CPAN::Changes::Group::Dependencies::Stats, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Changes::Group::Dependencies::Stats
CPAN shell
perl -MCPAN -e shell install CPAN::Changes::Group::Dependencies::Stats
For more information on module installation, please visit the detailed CPAN module installation guide.