Dist-Zilla-Plugin-OurPkgVersion-0.005001000755001750001750 012253634276 22607 5ustar00xenoterracidexenoterracide000000000000README100644001750001750 656312253634276 23562 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001NAME 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 * Alexei Znamensky * Christian Walde * Christopher J. Madsen * David Golden AUTHOR Caleb Cushing 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) Changes100644001750001750 426712253634276 24174 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001Revision history for Dist-Zilla-Plugin-OurPkgVersion 0.005001 2013-12-16 - update compile test so that it doesn't hang on windows GH #11 ( chorny ) - add contributors plugins 0.005000 2013-09-07 - allow comment to be #VERSION - Github Issue #9 - Reported by Jakob Voss ( nichtich ) 0.004000 2012-05-31 - skip parsing .pod files Github Issue #6 - Change comment to read TRIAL VERSION for trial releases Github Issue #7 Patch by Christopher J. Madsen 0.003002 2012-01-02 - skip if PPI unable to parse 0.003001 2012-01-01 - Provide a better error message if PPI fails v0.3.0 2011-08-10 - Allow text after # VERSION comment, see docs for example Github Issue #5 Reported by David Golden 0.2.0 2011-07-31 - Add debug logging of successfully adding versions Github Issue #4 Patch by Christian Walde 0.1.9 2011-07-23 - Always warn about missing # VERSION comment Github Issue #3 Patch by David Golden 0.1.8 2011-06-01 - Testing depends on Test::Version 0.04 or later 0.1.7 2011-05-31 - use Test::Version::version_ok to regression test gh issue #1 0.1.6 2011-05-09 - version sanity checking now done the same way as PkgVersion - above allows for vstring, e.g 'v3.3.2', style versions, Github Issue #2 Reported by Mike Doherty - use TestMania - add MetaJSON 0.1.5 2011-02-21 - CRITICAL: fix bug where version number wasn't quoted. This would make multipart versions (e.g. 0.1.0) not evaluate correctly, if you've used a multipart version with OurPkgVersion, please re-release your module. - make module conform to l3 strictness of Perl::Critic - make changes conform to CPAN::Changes::Spec 0.1.4 2010-11-06 - Remove AutoPrereqs from corpus, don't want to depend on that 0.1.3 2010-11-06 - Add basic tests specific to this distribution - Add better error handling if no comments present GitHub Issue #1 Reported by Stephen Clouse - remove cruft copied from PkgVersion that wasn't necessary 0.1.2 2010-08-07 - All Prerequisites were not properly defined, this is corrected. 0.1.1 2010-08-07 - override munges files to narrow which files will even be looked at 0.1.0 2010-08-03 - initial release LICENSE100644001750001750 2152212253634276 23717 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001This software is Copyright (c) 2013 by Caleb Cushing. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) The Artistic License 2.0 Copyright (c) 2000-2006, The Perl Foundation. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. META.yml100644001750001750 243212253634276 24142 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001--- abstract: 'no line insertion and does Package version with our' author: - 'Caleb Cushing ' build_requires: File::Spec: 0 IO::Handle: 0 IPC::Open3: 0 Test::DZil: 0 Test::More: 0.88 Test::Version: 0.04 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.133380' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Dist-Zilla-Plugin-OurPkgVersion no_index: directory: - corpus file: - perlcritic.rc requires: Dist::Zilla::Role::FileFinderUser: 0 Dist::Zilla::Role::FileMunger: 0 Moose: 0 MooseX::Types::Perl: 0 PPI: 0 namespace::autoclean: 0 perl: 5.008 strict: 0 warnings: 0 resources: bugtracker: https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues homepage: https://metacpan.org/dist/Dist-Zilla-Plugin-OurPkgVersion repository: git://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion.git version: 0.005001 x_contributors: - 'Alexandr Ciornii ' - 'Alexei Znamensky ' - 'Christian Walde ' - 'Christopher J. Madsen ' - 'David Golden ' MANIFEST100644001750001750 146212253634276 24024 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001Changes LICENSE MANIFEST META.json META.yml Makefile.PL README corpus/DZT/dist.ini corpus/DZT/lib/DZT0.pm corpus/DZT/lib/DZT1.pm corpus/DZT/lib/DZT2.pm corpus/DZT/lib/DZT3.pm corpus/DZT/lib/DZT4.pm corpus/DZT/lib/DZT5.pm corpus/DZT/lib/DZT6.pm corpus/DZT/t/basic.t corpus/vDZT/dist.ini corpus/vDZT/lib/vDZT.pm lib/Dist/Zilla/Plugin/OurPkgVersion.pm perlcritic.rc t/00-compile.t t/000-report-versions-tiny.t t/01-basic.t t/02-vstring.t t/03-trial.t t/author-critic.t t/author-pod-spell.t t/author-test-eol.t t/release-cpan-changes.t t/release-dist-manifest.t t/release-distmeta.t t/release-kwalitee.t t/release-meta-json.t t/release-minimum-version.t t/release-mojibake.t t/release-pod-coverage.t t/release-pod-linkcheck.t t/release-pod-syntax.t t/release-portability.t t/release-test-version.t t/release-unused-vars.t META.json100644001750001750 467512253634276 24325 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001{ "abstract" : "no line insertion and does Package version with our", "author" : [ "Caleb Cushing " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.133380", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Dist-Zilla-Plugin-OurPkgVersion", "no_index" : { "directory" : [ "corpus" ], "file" : [ "perlcritic.rc" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::Kwalitee" : "1.12", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "version" : "0.9901" } }, "runtime" : { "requires" : { "Dist::Zilla::Role::FileFinderUser" : "0", "Dist::Zilla::Role::FileMunger" : "0", "Moose" : "0", "MooseX::Types::Perl" : "0", "PPI" : "0", "namespace::autoclean" : "0", "perl" : "5.008", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::DZil" : "0", "Test::More" : "0.88", "Test::Version" : "0.04" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues" }, "homepage" : "https://metacpan.org/dist/Dist-Zilla-Plugin-OurPkgVersion", "repository" : { "type" : "git", "url" : "git://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion.git", "web" : "https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion" } }, "version" : "0.005001", "x_contributors" : [ "Alexandr Ciornii ", "Alexei Znamensky ", "Christian Walde ", "Christopher J. Madsen ", "David Golden " ] } Makefile.PL100644001750001750 324112253634276 24642 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001 use strict; use warnings; use 5.008; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "no line insertion and does Package version with our", "AUTHOR" => "Caleb Cushing ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Dist-Zilla-Plugin-OurPkgVersion", "EXE_FILES" => [], "LICENSE" => "artistic_2", "NAME" => "Dist::Zilla::Plugin::OurPkgVersion", "PREREQ_PM" => { "Dist::Zilla::Role::FileFinderUser" => 0, "Dist::Zilla::Role::FileMunger" => 0, "Moose" => 0, "MooseX::Types::Perl" => 0, "PPI" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::DZil" => 0, "Test::More" => "0.88", "Test::Version" => "0.04" }, "VERSION" => "0.005001", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Dist::Zilla::Role::FileFinderUser" => 0, "Dist::Zilla::Role::FileMunger" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moose" => 0, "MooseX::Types::Perl" => 0, "PPI" => 0, "Test::DZil" => 0, "Test::More" => "0.88", "Test::Version" => "0.04", "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); t000755001750001750 012253634276 22773 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.00500103-trial.t100644001750001750 425612253634276 24662 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!/usr/bin/perl use strict; use warnings; use Test::More; use Test::DZil; use Test::Version qw( version_ok ); $ENV{TRIAL} = 1; my $tzil = Builder->from_config({ dist_root => 'corpus/DZT' }); $tzil->build; version_ok( $tzil->tempdir->file('build/lib/DZT0.pm')); version_ok( $tzil->tempdir->file('build/lib/DZT1.pm')); my $lib_0 = $tzil->slurp_file('build/lib/DZT0.pm'); my $lib_1 = $tzil->slurp_file('build/lib/DZT1.pm'); my $lib_2 = $tzil->slurp_file('build/lib/DZT2.pm'); my $lib_3 = $tzil->slurp_file('build/lib/DZT3.pm'); my $lib_4 = $tzil->slurp_file('build/lib/DZT4.pm'); my $lib_5 = $tzil->slurp_file('build/lib/DZT5.pm'); my $tst_0 = $tzil->slurp_file('build/t/basic.t' ); # e short for expected files # ------------------------------------------------------------------- my $elib_0 = <<'END LIB0'; use strict; use warnings; package DZT0; our $VERSION = '0.1.0'; # TRIAL VERSION # ABSTRACT: my abstract 1; END LIB0 my $elib_1 = <<'END LIB1'; use strict; use warnings; package DZT1; BEGIN { our $VERSION = '0.1.0'; # TRIAL VERSION } # ABSTRACT: my abstract 1; END LIB1 my $elib_2 = <<'END LIB2'; use strict; use warnings; package DZT2; 1; END LIB2 my $elib_3 = <<'END LIB3'; use strict; use warnings; package DZT3; # This is a comment 1; END LIB3 my $elib_4 = <<'END LIB4'; use strict; use warnings; package DZT4; our $VERSION = '0.1.0'; # TRIAL VERSION package DZT4::Inner; our $VERSION = '0.1.0'; # TRIAL VERSION 1; END LIB4 my $elib_5 = <<'END LIB5'; package DZT5; use strict; use warnings; our $VERSION = '0.1.0'; # TRIAL VERSION: foo 1; END LIB5 my $etst_0 = <<'END TST0'; #!/usr/bin/perl # VERSION END TST0 # ------------------------------------------------------------------- is ( $lib_0, $elib_0, 'check DZT0.pm' ); is ( $lib_1, $elib_1, 'check DZT1.pm' ); is ( $lib_2, $elib_2, 'check DZT2.pm' ); is ( $lib_3, $elib_3, 'check DZT3.pm' ); is ( $lib_4, $elib_4, 'check DZT4.pm' ); is ( $lib_5, $elib_5, 'check DZT5.pm' ); is ( $tst_0, $etst_0, 'check basic.t' ); for my $file ( qw/DZT2 DZT3/ ) { like ( join( "\n", map { $_->{message} } @{ $tzil->chrome->logger->events } ), qr{Skipping: "lib/$file\.pm" has no "# VERSION" comment}, "warn no #VERSION in $file.pm" ); } done_testing; 01-basic.t100644001750001750 451412253634276 24623 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!/usr/bin/perl use strict; use warnings; use Test::More; use Test::DZil; use Test::Version qw( version_ok ); my $tzil = Builder->from_config({ dist_root => 'corpus/DZT' }); $tzil->build; version_ok( $tzil->tempdir->file('build/lib/DZT0.pm')); version_ok( $tzil->tempdir->file('build/lib/DZT1.pm')); my $lib_0 = $tzil->slurp_file('build/lib/DZT0.pm'); my $lib_1 = $tzil->slurp_file('build/lib/DZT1.pm'); my $lib_2 = $tzil->slurp_file('build/lib/DZT2.pm'); my $lib_3 = $tzil->slurp_file('build/lib/DZT3.pm'); my $lib_4 = $tzil->slurp_file('build/lib/DZT4.pm'); my $lib_5 = $tzil->slurp_file('build/lib/DZT5.pm'); my $lib_6 = $tzil->slurp_file('build/lib/DZT6.pm'); my $tst_0 = $tzil->slurp_file('build/t/basic.t' ); # e short for expected files # ------------------------------------------------------------------- my $elib_0 = <<'END LIB0'; use strict; use warnings; package DZT0; our $VERSION = '0.1.0'; # VERSION # ABSTRACT: my abstract 1; END LIB0 my $elib_1 = <<'END LIB1'; use strict; use warnings; package DZT1; BEGIN { our $VERSION = '0.1.0'; # VERSION } # ABSTRACT: my abstract 1; END LIB1 my $elib_2 = <<'END LIB2'; use strict; use warnings; package DZT2; 1; END LIB2 my $elib_3 = <<'END LIB3'; use strict; use warnings; package DZT3; # This is a comment 1; END LIB3 my $elib_4 = <<'END LIB4'; use strict; use warnings; package DZT4; our $VERSION = '0.1.0'; # VERSION package DZT4::Inner; our $VERSION = '0.1.0'; # VERSION 1; END LIB4 my $elib_5 = <<'END LIB5'; package DZT5; use strict; use warnings; our $VERSION = '0.1.0'; # VERSION: foo 1; END LIB5 my $elib_6 = <<'END LIB6'; package DZT6; use strict; use warnings; our $VERSION = '0.1.0'; #VERSION 1; END LIB6 my $etst_0 = <<'END TST0'; #!/usr/bin/perl # VERSION END TST0 # ------------------------------------------------------------------- is ( $lib_0, $elib_0, 'check DZT0.pm' ); is ( $lib_1, $elib_1, 'check DZT1.pm' ); is ( $lib_2, $elib_2, 'check DZT2.pm' ); is ( $lib_3, $elib_3, 'check DZT3.pm' ); is ( $lib_4, $elib_4, 'check DZT4.pm' ); is ( $lib_5, $elib_5, 'check DZT5.pm' ); is ( $lib_6, $elib_6, 'check DZT6.pm' ); is ( $tst_0, $etst_0, 'check basic.t' ); for my $file ( qw/DZT2 DZT3/ ) { like ( join( "\n", map { $_->{message} } @{ $tzil->chrome->logger->events } ), qr{Skipping: "lib/$file\.pm" has no "# VERSION" comment}, "warn no #VERSION in $file.pm" ); } done_testing; perlcritic.rc100644001750001750 12412253634276 25333 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001severity = 3 verbose = 9 exclude = ValuesAndExpressions::ProhibitImplicitNewlines 02-vstring.t100644001750001750 73512253634276 25220 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!/usr/bin/perl use strict; use warnings; use Test::More; use Test::DZil; use Test::Version qw( version_ok ); my $tzil = Builder->from_config({ dist_root => 'corpus/vDZT' }); $tzil->build; version_ok( $tzil->tempdir->file('build/lib/vDZT.pm')); my $lib = $tzil->slurp_file('build/lib/vDZT.pm'); my $expected_lib = <<'END LIB'; package vDZT; our $VERSION = 'v0.1.0'; # VERSION 1; # ABSTRACT: my abstract END LIB is ( $lib, $expected_lib, 'check vDZT.pm' ); done_testing; 00-compile.t100644001750001750 174412253634276 25173 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.039 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Dist/Zilla/Plugin/OurPkgVersion.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; author-critic.t100644001750001750 66612253634276 26065 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); DZT000755001750001750 012253634276 24504 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpusdist.ini100644001750001750 31012253634276 26262 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZTname = DZT0 author = Caleb Cushing license = Artistic_2_0 version = 0.1.0 copyright_holder = Caleb Cushing [@Filter] -bundle = @Basic -remove = Readme [OurPkgVersion] author-test-eol.t100644001750001750 47012253634276 26335 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::EOL 0.08 use Test::EOL; all_perl_files_ok({ trailing_whitespace => 1 }); t000755001750001750 012253634276 24747 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZTbasic.t100644001750001750 3212253634276 26310 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/t#!/usr/bin/perl # VERSION vDZT000755001750001750 012253634276 24672 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpusdist.ini100644001750001750 24512253634276 26457 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/vDZTname = vDZT author = Caleb Cushing license = Artistic_2_0 version = v0.1.0 copyright_holder = Caleb Cushing [@Basic] [OurPkgVersion] release-kwalitee.t100644001750001750 42412253634276 26523 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.07 use strict; use warnings; use Test::Kwalitee; release-mojibake.t100644001750001750 64412253634276 26503 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) eval q(use Test::Mojibake); plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; all_files_encoding_ok(); release-distmeta.t100644001750001750 45512253634276 26534 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); author-pod-spell.t100644001750001750 113512253634276 26517 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ SubmittingPatches dzil OurPkgVersion ini executables Caleb Cushing xenoterracide Alexandr Ciornii alexchorny Alexei Znamensky russoz Christian Walde walde Christopher Madsen perl David Golden dagolden lib Dist Zilla Plugin release-meta-json.t100644001750001750 47112253634276 26615 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval 'use Test::CPAN::Meta::JSON'; plan skip_all => 'Test::CPAN::Meta::JSON required for testing META.json' if $@; meta_json_ok(); lib000755001750001750 012253634276 25252 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZTDZT5.pm100644001750001750 7212253634276 26435 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libpackage DZT5; use strict; use warnings; # VERSION: foo 1; DZT3.pm100644001750001750 7712253634276 26440 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libuse strict; use warnings; package DZT3; # This is a comment 1; DZT2.pm100644001750001750 5312253634276 26431 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libuse strict; use warnings; package DZT2; 1; DZT1.pm100644001750001750 13012253634276 26444 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libuse strict; use warnings; package DZT1; BEGIN { # VERSION } # ABSTRACT: my abstract 1; DZT6.pm100644001750001750 6412253634276 26437 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libpackage DZT6; use strict; use warnings; #VERSION 1; DZT4.pm100644001750001750 12412253634276 26452 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libuse strict; use warnings; package DZT4; # VERSION package DZT4::Inner; # VERSION 1; DZT0.pm100644001750001750 11512253634276 26446 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/DZT/libuse strict; use warnings; package DZT0; # VERSION # ABSTRACT: my abstract 1; release-pod-syntax.t100644001750001750 45012253634276 27023 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); lib000755001750001750 012253634276 25440 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/vDZTvDZT.pm100644001750001750 6312253634276 26724 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/corpus/vDZT/libpackage vDZT; # VERSION 1; # ABSTRACT: my abstract release-unused-vars.t100644001750001750 44512253634276 27175 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Vars"; plan skip_all => "Test::Vars required for testing unused vars" if $@; all_vars_ok(); release-portability.t100644001750001750 53412253634276 27262 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); release-test-version.t100644001750001750 110112253634276 27371 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.002004 BEGIN { eval "use Test::Version; 1;" or die $@; } my @imports = ( 'version_all_ok' ); my $params = { is_strict => 0, has_version => 1, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; release-cpan-changes.t100644001750001750 52112253634276 27243 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); release-pod-coverage.t100644001750001750 76512253634276 27301 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); release-pod-linkcheck.t100644001750001750 77512253634276 27442 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } release-dist-manifest.t100644001750001750 46612253634276 27473 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); release-minimum-version.t100644001750001750 52612253634276 30057 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_from_metayml_ok(); 000-report-versions-tiny.t100644001750001750 514112253634276 27760 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/tuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = '5.008'; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Dist::Zilla::Role::FileFinderUser','any version') }; eval { $v .= pmver('Dist::Zilla::Role::FileMunger','any version') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('IO::Handle','any version') }; eval { $v .= pmver('IPC::Open3','any version') }; eval { $v .= pmver('Moose','any version') }; eval { $v .= pmver('MooseX::Types::Perl','any version') }; eval { $v .= pmver('PPI','any version') }; eval { $v .= pmver('Test::DZil','any version') }; eval { $v .= pmver('Test::More','0.88') }; eval { $v .= pmver('Test::Version','0.04') }; eval { $v .= pmver('namespace::autoclean','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; Plugin000755001750001750 012253634276 26512 5ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/lib/Dist/ZillaOurPkgVersion.pm100644001750001750 1237612253634276 32016 0ustar00xenoterracidexenoterracide000000000000Dist-Zilla-Plugin-OurPkgVersion-0.005001/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::OurPkgVersion; use 5.008; use strict; use warnings; our $VERSION = '0.005001'; # VERSION use Moose; with ( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, ); use PPI; use MooseX::Types::Perl qw( LaxVersionStr ); use namespace::autoclean; sub munge_files { my $self = shift; $self->munge_file($_) for @{ $self->found_files }; return; } sub munge_file { my ( $self, $file ) = @_; if ( $file->name =~ m/\.pod$/ixms ) { $self->log_debug( 'Skipping: "' . $file->name . '" is pod only'); return; } my $version = $self->zilla->version; confess 'invalid characters in version' unless LaxVersionStr->check( $version ); my $content = $file->content; my $doc = PPI::Document->new(\$content) or $self->log( 'Skipping: "' . $file->name . '" error with PPI: ' . PPI::Document->errstr ) ; return unless defined $doc; my $comments = $doc->find('PPI::Token::Comment'); my $version_regex = q{ ^ (\s*) # capture all whitespace before comment ( \#\s*VERSION # capture # VERSION \b # and ensure it ends on a word boundary [ # conditionally [:print:] # all printable characters after VERSION \s # any whitespace including newlines see GH #5 ]* # as many of the above as there are ) $ # until the EOL} ; my $munged_version = 0; if ( ref($comments) eq 'ARRAY' ) { foreach ( @{ $comments } ) { if ( /$version_regex/xms ) { my ( $ws, $comment ) = ( $1, $2 ); $comment =~ s/(?=\bVERSION\b)/TRIAL /x if $self->zilla->is_trial; my $code = "$ws" . q{our $VERSION = '} . $version . qq{'; $comment} ; $_->set_content("$code"); $file->content( $doc->serialize ); $munged_version++; } } } if ( $munged_version ) { $self->log_debug([ 'adding $VERSION assignment to %s', $file->name ]); } else { $self->log( 'Skipping: "' . $file->name . '" has no "# VERSION" comment' ); } return; } __PACKAGE__->meta->make_immutable; 1; # ABSTRACT: no line insertion and does Package version with our __END__ =pod =head1 NAME Dist::Zilla::Plugin::OurPkgVersion - no line insertion and does Package version with our =head1 VERSION version 0.005001 =head1 SYNOPSIS in dist.ini [OurPkgVersion] in your modules # VERSION =head1 DESCRIPTION This module was created as an alternative to L and uses some code from that module. This module is designed to use a the more readable format C 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. =head2 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 C line anywhere in the file before C<# VERSION> as many times as you've written C<# VERSION> regardless of whether or not inserting it there is a good idea. OurPkgVersion will not insert a version unless you have C<# 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 =head1 METHODS =over =item munge_files Override the default provided by L to limit the number of files to search to only be modules and executables. =item munge_file tells which files to munge, see L =back =head1 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. =head1 CONTRIBUTORS =over 4 =item * Alexandr Ciornii =item * Alexei Znamensky =item * Christian Walde =item * Christopher J. Madsen =item * David Golden =back =head1 AUTHOR Caleb Cushing =head1 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) =cut