https://github.com/kentnl/cpan-changes-group-dependencies-stats
Create a Dependencies::Stats section detailing summarised differences
https://github.com/kentnl/cpan-changes-group-dependencies-stats
perl
Last synced: 16 days ago
JSON representation
Create a Dependencies::Stats section detailing summarised differences
- Host: GitHub
- URL: https://github.com/kentnl/cpan-changes-group-dependencies-stats
- Owner: kentnl
- License: other
- Created: 2014-07-16T09:46:03.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T08:45:58.000Z (over 9 years ago)
- Last Synced: 2025-01-09T18:56:57.602Z (over 1 year ago)
- Topics: perl
- Language: Perl
- Size: 173 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- Contributing: CONTRIBUTING.pod
- License: LICENSE
Awesome Lists containing this project
README
# NAME
CPAN::Changes::Group::Dependencies::Stats - Create a Dependencies::Stats section detailing summarized differences
# VERSION
version 0.002009
# SYNOPSIS
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)
# DESCRIPTION
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.
# METHODS
## `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`
`%optlabel` is one of `recommends`, `suggests`
`%requiredstats` and `%optstats` are strings of stat changes:
%symbol%number %symbol%number ...
`%symbol` is:
+ 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](https://metacpan.org/diff/file?target=ETHER/Moose-2.1210/META.json&source=ETHER/Moose-2.1005/META.json) 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 ☺
# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.