Created
March 7, 2011 11:20
-
-
Save dagolden/858394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.010; | |
use strict; | |
use warnings; | |
use autodie; | |
use Git::Wrapper; | |
use File::Find::Rule (); | |
use File::Find::Rule::Perl (); | |
my $tag = shift | |
or die "Usage: $0 <tag>\n"; | |
my $git = Git::Wrapper->new("."); | |
my @files = File::Find::Rule->perl_file->in("lib"); | |
for my $file ( @files ) { | |
my @diff = $git->diff( "$tag", "--", $file ); | |
next unless @diff; | |
say "$file: " . scalar @diff . " diff lines"; | |
my @version_lines = map { " $_" } grep { /\$(?:(?:\w+::)+)*VERSION\s*=\s*/ } @diff; | |
if ( @version_lines ) { | |
say for @version_lines; | |
} | |
else { | |
say " *** NEEDS VERSION BUMP! ***"; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment