Dist::Zilla::Plugin::AutoVersion::Relative - Time-Relative versioning
version 1.001001
Like all things, time is relative. This plugin is to allow you to auto-increment versions based on a relative time point.
It doesn't do it all for you, you can choose, its mostly like The AutoVersion Plugin except there's a few more user-visible entities, and a few more visible options.
AutoVersion
To configure this, you specify the date that the version is to be relative to.
[AutoVersion::Relative] major = 1 minor = 1 year = 2009 ; when we did our last major rev month = 08 ; " " day = 23 ; " " hour = 05 ; " " minute = 30 ; " " second = 00 ; If you're that picky. time_zone = Pacific/Auckland ; You really want to set this. ; 1.0110012 format = {{$major}}.{{sprintf('%02d%04d%02d', $minor, days, hours }}
For the list of tuneables and how to use them, see "ATTRIBUTES" and "DATE ATTRIBUTES"
There are a handful of things we inject into the template for you
# Just to give you an idea, you don't really want to be using this though. {{ $major }}.{{ $minor }}{{ days }}{{ hours }}{{ $relative->seconds }}
See "FORMAT FIELDS" for the available fields and their use.
If you don't specify Y/M/D, it will default to Jan 01, 2000 , because I couldn't think of a more sane default. But you're setting that anyway, because if you don't,you be cargo cultin' the bad way
See "FORMATING"
You want this.
Formatting is like, "Pacific/Auckland" , or merely "+1200" format.
The value set for major
The value set for minor
A DateTime::Duration object
DateTime::Duration
CLDR for the current time. See "format_cldr" in DateTime
See "days_accurate"
Used to use the algorithm as used in "days_square" but uses the algorithm in "days_accurate" since 0.03000000
An approximation of the number of days passed since milestone.
Note that for this approximation, it is assumed all months are 31 days long, and years as such, have 372 days.
This is a legacy way of computing dates, superseded by days_accurate since 0.03000000
The number of days passed since the milestone.
The remainder number of hours elapsed.
returns the formatted version string to satisfy the roles.
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::AutoVersion::Relative, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::AutoVersion::Relative
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::AutoVersion::Relative
For more information on module installation, please visit the detailed CPAN module installation guide.