4 use warnings FATAL => 'all';
7 chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}'));
9 my @parts = split /\./, $LATEST;
11 my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts);
13 my %bump_part = (major => 0, minor => 1, bugfix => 2);
15 my $bump_this = $bump_part{$ARGV[0]||'bugfix'};
17 die "no idea which part to bump - $ARGV[0] means nothing to me"
18 unless defined($bump_this);
20 my @new_parts = @parts;
22 $new_parts[$bump_this]++;
24 my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts);
26 warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL\n";
28 my $PM_FILE = 'lib/Moo.pm';
30 my $file = do { local (@ARGV, $/) = ($PM_FILE); <> };
32 $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/;
34 open my $out, '>', $PM_FILE;