From: Graham Knop Date: Sun, 2 Mar 2014 00:35:29 +0000 (-0500) Subject: include version number in all modules X-Git-Tag: v1.003003~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ed7eba751d629890f555d2493412c9d2aa6e286;p=gitmo%2FRole-Tiny.git include version number in all modules --- diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 9badeef..2922fc2 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -6,7 +6,7 @@ sub _getstash { \%{"$_[0]::"} } use strict; use warnings FATAL => 'all'; -our $VERSION = '1.003002'; # 1.3.2 +our $VERSION = '1.003002'; $VERSION = eval $VERSION; our %INFO; diff --git a/lib/Role/Tiny/With.pm b/lib/Role/Tiny/With.pm index d6dbdc2..db8e2d7 100644 --- a/lib/Role/Tiny/With.pm +++ b/lib/Role/Tiny/With.pm @@ -2,6 +2,10 @@ package Role::Tiny::With; use strict; use warnings FATAL => 'all'; + +our $VERSION = '1.003002'; +$VERSION = eval $VERSION; + use Role::Tiny (); use Exporter 'import'; diff --git a/maint/bump-version b/maint/bump-version index 8aa9e53..9b6b2bd 100755 --- a/maint/bump-version +++ b/maint/bump-version @@ -7,6 +7,9 @@ use autodie; chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}')); my @parts = split /\./, $LATEST; +if (@parts == 2) { + @parts[1,2] = $parts[1] =~ /(\d{1,3})(\d{1,3})/; +} my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts); @@ -20,17 +23,24 @@ die "no idea which part to bump - $ARGV[0] means nothing to me" my @new_parts = @parts; $new_parts[$bump_this]++; +$new_parts[$_] = 0 for ($bump_this+1 .. 2); my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts); warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL\n"; -my $PM_FILE = 'lib/Moo.pm'; +for my $PM_FILE (qw( + lib/Moo.pm + lib/Moo/Role.pm + lib/Sub/Defer.pm + lib/Sub/Quote.pm +)) { + my $file = do { local (@ARGV, $/) = ($PM_FILE); <> }; -my $file = do { local (@ARGV, $/) = ($PM_FILE); <> }; + $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/ + or die "unable to bump version number in $PM_FILE"; -$file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/; + open my $out, '>', $PM_FILE; -open my $out, '>', $PM_FILE; - -print $out $file; + print $out $file; +}