1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
NAME
Dist::Zilla::Plugin::OurPkgVersion - no line insertion and does Package
version with our
VERSION
version 0.005001
SYNOPSIS
in dist.ini
[OurPkgVersion]
in your modules
# VERSION
DESCRIPTION
This module was created as an alternative to
Dist::Zilla::Plugin::PkgVersion and uses some code from that module.
This module is designed to use a the more readable format "our $VERSION
= $version;" as well as not change then number of lines of code in your
files, which will keep your repository more in sync with your CPAN
release. It also allows you slightly more freedom in how you specify
your version.
EXAMPLES
in dist.ini
...
version = 0.01;
[OurPkgVersion]
in lib/My/Module.pm
package My::Module;
# VERSION
...
output lib/My/Module.pm
package My::Module;
our $VERSION = '0.01'; # VERSION
...
please note that whitespace before the comment is significant so
package My::Module;
BEGIN {
# VERSION
}
...
becomes
package My::Module;
BEGIN {
our $VERSION = '0.01'; # VERSION
}
...
while
package My::Module;
BEGIN {
# VERSION
}
...
becomes
package My::Module;
BEGIN {
our $VERSION = '0.01'; # VERSION
}
...
you can also add additional comments to your comment
...
# VERSION: generated by DZP::OurPkgVersion
...
becomes
...
our $VERSION = '0.1.0'; # VERSION: generated by DZP::OurPkgVersion
...
Also note, the package line is not in any way significant, it will
insert the "our $VERSION" line anywhere in the file before "# VERSION"
as many times as you've written "# VERSION" regardless of whether or not
inserting it there is a good idea. OurPkgVersion will not insert a
version unless you have "# VERSION" so it is a bit more work.
If you make a trial release, the comment will be altered to say so:
# VERSION
becomes
our $VERSION = '0.01'; # TRIAL VERSION
METHODS
munge_files
Override the default provided by Dist::Zilla::Role::FileMunger to
limit the number of files to search to only be modules and
executables.
munge_file
tells which files to munge, see Dist::Zilla::Role::FileMunger
BUGS
Please report any bugs or feature requests on the bugtracker website
https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues
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.
CONTRIBUTORS
* Alexandr Ciornii <alexchorny@gmail.com>
* Alexei Znamensky <russoz@cpan.org>
* Christian Walde <walde.christian@googlemail.com>
* Christopher J. Madsen <perl@cjmweb.net>
* David Golden <dagolden@cpan.org>
AUTHOR
Caleb Cushing <xenoterracide@gmail.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by Caleb Cushing.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
|