version::dev - Set $VERSION based on version from git tags
This document describes version 0.001 of version::dev (from Perl distribution version-dev), released on 2019-04-14.
package MyModule; # VERSION ...
Your git tags:
% git tag v0.003 v0.002 v0.001
When running script that uses your module:
% perl -Ilib -Mversion::dev -MMyModule E'...'
$MyModule::VERSION will be set to
0.003_001 (if not already set).
Sometimes you do not explicitly set
$VERSION in the module source code that you're working on. For example, you're using Dist::Zilla with a plugin that will set
$VERSION during build, so only your built version of modules will have their
$VERSION set. Wen working with the unbuilt version, this sometimes creates problem or annoyances when other modules or other code expect your module to set
This pragma solves that annoyances. It installs a require hook that will check if the module being loaded is: 1) inside the working directory; and 2) the module's package does not have
If the conditions are met, then first it will: 1) execute
git tag to list tags that look like a version number; 2) grab the most recent version; 3) bump the version's dev part, e.g. v1.1 becomes v1.1_001 and v1.1_001 becomes v1.1_002; 3) set the module's package
$VERSION with this version.
Please visit the project's homepage at https://metacpan.org/release/version-dev.
Source repository is at https://github.com/perlancar/perl-version-dev.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=version-dev
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This software is copyright (c) 2019 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.