9 dagolden-reversion-gist
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 Found at https://gist.github.com/dagolden/858394
35 From shebang to Local Variables it is dagolden, the rest is mine.
41 use lib
"$FindBin::Bin/../lib";
47 use File
::Basename
qw(dirname);
48 use File
::Path
qw(mkpath);
53 use Hash
::Util
qw(lock_keys);
56 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
70 use File
::Find
::Rule
();
71 use File
::Find
::Rule
::Perl
();
74 or die "Usage: $0 <tag>\n";
76 my $git = Git
::Wrapper
->new(".");
78 my @files = File
::Find
::Rule
->perl_file->in("lib");
80 for my $file ( @files ) {
81 my @diff = $git->diff( "$tag", "--", $file );
83 say "$file: " . scalar @diff . " diff lines";
84 my @version_lines = map { " $_" } grep { /\$(?:(?:\w+::)+)*VERSION\s*=\s*/ } @diff;
85 if ( @version_lines ) {
86 say for @version_lines;
89 say " *** NEEDS VERSION BUMP! ***";
97 # cperl-indent-level: 4