Dist::Zilla::Plugin::RewriteVersion - Get and/or rewrite module versions to match distribution version
version 0.002
# in your code, declare $VERSION like this: package Foo; our $VERSION = '1.23'; # in your dist.ini [RewriteVersion]
This module is both a VersionProvider and FileMunger.
VersionProvider
FileMunger
This module finds a version in a specific format from the main module file and munges all gathered files to match. You can override the version found with the V environment variable, similar to Git::NextVersion, in which case all the gathered files have their $VERSION set to that value.
V
$VERSION
Only the first occurrence of a $VERSION declaration in each file is relevant and/or affected and it must exactly match this regular expression:
qr{^our \s+ \$VERSION \s* = \s* '$version::LAX'}mx
It must be at the start of a line and any trailing comments are deleted. The original may have double-quotes, but the re-written line will have single quotes.
The very restrictive regular expression format is intentional to avoid the various ways finding a version assignment could go wrong and to avoid using PPI, which has similar complexity issues.
For most modules, this should work just fine.
See BumpVersionAfterRelease for more details and usage examples.
David Golden <dagolden@cpan.org>
This software is Copyright (c) 2014 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Dist::Zilla::Plugin::BumpVersionAfterRelease, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::BumpVersionAfterRelease
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::BumpVersionAfterRelease
For more information on module installation, please visit the detailed CPAN module installation guide.