Codebase list libdist-zilla-plugin-ourpkgversion-perl / b71b5f1
Imported Upstream version 0.08 Axel Beckert 7 years ago
31 changed file(s) with 570 addition(s) and 305 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Dist-Zilla-Plugin-OurPkgVersion
1
2 0.08 2016-04-24
3 - Dist::Zilla 5.x / 6.x and future 7.x compatability
4
5 0.07 2016-03-07
6 - Use Dist::Zilla::Role::PPI to avoid reparsing documents (new GH #1)
7
8 0.06 2015-05-04
9 - Use [Test::ReportPrereqs] instead of [ReportVersions::Tiny] to remove
10 deprecation warning during dzil build.
11 - Use new github repository in meta
112
213 0.005001 2013-12-16
314 - update compile test so that it doesn't hang on windows GH #11 ( chorny )
0 This software is Copyright (c) 2013 by Caleb Cushing.
0 This software is Copyright (c) 2016 by Caleb Cushing.
11
22 This is free software, licensed under:
33
0 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.003.
01 Changes
12 LICENSE
23 MANIFEST
1819 lib/Dist/Zilla/Plugin/OurPkgVersion.pm
1920 perlcritic.rc
2021 t/00-compile.t
21 t/000-report-versions-tiny.t
22 t/00-report-prereqs.dd
23 t/00-report-prereqs.t
2224 t/01-basic.t
2325 t/02-vstring.t
2426 t/03-trial.t
2527 t/author-critic.t
28 t/author-eol.t
29 t/author-mojibake.t
30 t/author-pod-coverage.t
2631 t/author-pod-spell.t
27 t/author-test-eol.t
32 t/author-pod-syntax.t
33 t/author-test-version.t
2834 t/release-cpan-changes.t
2935 t/release-dist-manifest.t
3036 t/release-distmeta.t
3137 t/release-kwalitee.t
3238 t/release-meta-json.t
3339 t/release-minimum-version.t
34 t/release-mojibake.t
35 t/release-pod-coverage.t
3640 t/release-pod-linkcheck.t
37 t/release-pod-syntax.t
3841 t/release-portability.t
39 t/release-test-version.t
4042 t/release-unused-vars.t
00 {
1 "abstract" : "no line insertion and does Package version with our",
1 "abstract" : "No line insertion and does Package version with our",
22 "author" : [
3 "Caleb Cushing <xenoterracide@gmail.com>"
3 "Caleb Cushing <xenoterracide@gmail.com>",
4 "Grahan Ollis <plicease@cpan.org>"
45 ],
56 "dynamic_config" : 0,
6 "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.133380",
7 "generated_by" : "Dist::Zilla version 6.003, CPAN::Meta::Converter version 2.150005",
78 "license" : [
89 "artistic_2"
910 ],
1011 "meta-spec" : {
1112 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
12 "version" : "2"
13 "version" : 2
1314 },
1415 "name" : "Dist-Zilla-Plugin-OurPkgVersion",
1516 "no_index" : {
2324 "prereqs" : {
2425 "configure" : {
2526 "requires" : {
26 "ExtUtils::MakeMaker" : "6.30"
27 "ExtUtils::MakeMaker" : "0"
2728 }
2829 },
2930 "develop" : {
3132 "Pod::Coverage::TrustPod" : "0",
3233 "Test::CPAN::Changes" : "0.19",
3334 "Test::CPAN::Meta" : "0",
34 "Test::Kwalitee" : "1.12",
35 "Test::CPAN::Meta::JSON" : "0.16",
36 "Test::EOL" : "0",
37 "Test::Kwalitee" : "1.21",
38 "Test::Mojibake" : "0",
39 "Test::More" : "0.88",
3540 "Test::Pod" : "1.41",
3641 "Test::Pod::Coverage" : "1.08",
37 "version" : "0.9901"
42 "Test::Pod::LinkCheck" : "0",
43 "Test::Spelling" : "0.12",
44 "Test::Version" : "1"
3845 }
3946 },
4047 "runtime" : {
4148 "requires" : {
4249 "Dist::Zilla::Role::FileFinderUser" : "0",
4350 "Dist::Zilla::Role::FileMunger" : "0",
51 "Dist::Zilla::Role::PPI" : "0",
4452 "Moose" : "0",
4553 "MooseX::Types::Perl" : "0",
4654 "PPI" : "0",
5159 }
5260 },
5361 "test" : {
62 "recommends" : {
63 "CPAN::Meta" : "2.120900"
64 },
5465 "requires" : {
66 "ExtUtils::MakeMaker" : "0",
5567 "File::Spec" : "0",
5668 "IO::Handle" : "0",
5769 "IPC::Open3" : "0",
70 "Path::Class" : "0",
5871 "Test::DZil" : "0",
59 "Test::More" : "0.88",
60 "Test::Version" : "0.04"
72 "Test::More" : "0",
73 "Test::Version" : "0.04",
74 "blib" : "1.01"
6175 }
6276 }
6377 },
6478 "release_status" : "stable",
6579 "resources" : {
6680 "bugtracker" : {
67 "web" : "https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues"
81 "web" : "https://github.com/plicease/dist-zilla-plugin-ourpkgversion/issues"
6882 },
6983 "homepage" : "https://metacpan.org/dist/Dist-Zilla-Plugin-OurPkgVersion",
7084 "repository" : {
7185 "type" : "git",
72 "url" : "git://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion.git",
73 "web" : "https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion"
86 "url" : "git://github.com/plicease/dist-zilla-plugin-ourpkgversion.git",
87 "web" : "https://github.com/plicease/dist-zilla-plugin-ourpkgversion"
7488 }
7589 },
76 "version" : "0.005001",
90 "version" : "0.08",
7791 "x_contributors" : [
7892 "Alexandr Ciornii <alexchorny@gmail.com>",
7993 "Alexei Znamensky <russoz@cpan.org>",
8094 "Christian Walde <walde.christian@googlemail.com>",
8195 "Christopher J. Madsen <perl@cjmweb.net>",
82 "David Golden <dagolden@cpan.org>"
96 "David Golden <dagolden@cpan.org>",
97 "Graham Ollis <perl@wdlabs.com>",
98 "Graham Ollis <plicease@cpan.org>"
8399 ]
84100 }
85101
00 ---
1 abstract: 'no line insertion and does Package version with our'
1 abstract: 'No line insertion and does Package version with our'
22 author:
33 - 'Caleb Cushing <xenoterracide@gmail.com>'
4 - 'Grahan Ollis <plicease@cpan.org>'
45 build_requires:
5 File::Spec: 0
6 IO::Handle: 0
7 IPC::Open3: 0
8 Test::DZil: 0
9 Test::More: 0.88
10 Test::Version: 0.04
6 ExtUtils::MakeMaker: '0'
7 File::Spec: '0'
8 IO::Handle: '0'
9 IPC::Open3: '0'
10 Path::Class: '0'
11 Test::DZil: '0'
12 Test::More: '0'
13 Test::Version: '0.04'
14 blib: '1.01'
1115 configure_requires:
12 ExtUtils::MakeMaker: 6.30
16 ExtUtils::MakeMaker: '0'
1317 dynamic_config: 0
14 generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.133380'
18 generated_by: 'Dist::Zilla version 6.003, CPAN::Meta::Converter version 2.150005'
1519 license: artistic_2
1620 meta-spec:
1721 url: http://module-build.sourceforge.net/META-spec-v1.4.html
18 version: 1.4
22 version: '1.4'
1923 name: Dist-Zilla-Plugin-OurPkgVersion
2024 no_index:
2125 directory:
2327 file:
2428 - perlcritic.rc
2529 requires:
26 Dist::Zilla::Role::FileFinderUser: 0
27 Dist::Zilla::Role::FileMunger: 0
28 Moose: 0
29 MooseX::Types::Perl: 0
30 PPI: 0
31 namespace::autoclean: 0
32 perl: 5.008
33 strict: 0
34 warnings: 0
30 Dist::Zilla::Role::FileFinderUser: '0'
31 Dist::Zilla::Role::FileMunger: '0'
32 Dist::Zilla::Role::PPI: '0'
33 Moose: '0'
34 MooseX::Types::Perl: '0'
35 PPI: '0'
36 namespace::autoclean: '0'
37 perl: '5.008'
38 strict: '0'
39 warnings: '0'
3540 resources:
36 bugtracker: https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues
41 bugtracker: https://github.com/plicease/dist-zilla-plugin-ourpkgversion/issues
3742 homepage: https://metacpan.org/dist/Dist-Zilla-Plugin-OurPkgVersion
38 repository: git://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion.git
39 version: 0.005001
43 repository: git://github.com/plicease/dist-zilla-plugin-ourpkgversion.git
44 version: '0.08'
4045 x_contributors:
4146 - 'Alexandr Ciornii <alexchorny@gmail.com>'
4247 - 'Alexei Znamensky <russoz@cpan.org>'
4348 - 'Christian Walde <walde.christian@googlemail.com>'
4449 - 'Christopher J. Madsen <perl@cjmweb.net>'
4550 - 'David Golden <dagolden@cpan.org>'
51 - 'Graham Ollis <perl@wdlabs.com>'
52 - 'Graham Ollis <plicease@cpan.org>'
0
0 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.003.
11 use strict;
22 use warnings;
33
44 use 5.008;
55
6 use ExtUtils::MakeMaker 6.30;
7
8
6 use ExtUtils::MakeMaker;
97
108 my %WriteMakefileArgs = (
11 "ABSTRACT" => "no line insertion and does Package version with our",
12 "AUTHOR" => "Caleb Cushing <xenoterracide\@gmail.com>",
13 "BUILD_REQUIRES" => {},
9 "ABSTRACT" => "No line insertion and does Package version with our",
10 "AUTHOR" => "Caleb Cushing <xenoterracide\@gmail.com>, Grahan Ollis <plicease\@cpan.org>",
1411 "CONFIGURE_REQUIRES" => {
15 "ExtUtils::MakeMaker" => "6.30"
12 "ExtUtils::MakeMaker" => 0
1613 },
1714 "DISTNAME" => "Dist-Zilla-Plugin-OurPkgVersion",
18 "EXE_FILES" => [],
1915 "LICENSE" => "artistic_2",
16 "MIN_PERL_VERSION" => "5.008",
2017 "NAME" => "Dist::Zilla::Plugin::OurPkgVersion",
2118 "PREREQ_PM" => {
2219 "Dist::Zilla::Role::FileFinderUser" => 0,
2320 "Dist::Zilla::Role::FileMunger" => 0,
21 "Dist::Zilla::Role::PPI" => 0,
2422 "Moose" => 0,
2523 "MooseX::Types::Perl" => 0,
2624 "PPI" => 0,
2927 "warnings" => 0
3028 },
3129 "TEST_REQUIRES" => {
30 "ExtUtils::MakeMaker" => 0,
3231 "File::Spec" => 0,
3332 "IO::Handle" => 0,
3433 "IPC::Open3" => 0,
34 "Path::Class" => 0,
3535 "Test::DZil" => 0,
36 "Test::More" => "0.88",
37 "Test::Version" => "0.04"
36 "Test::More" => 0,
37 "Test::Version" => "0.04",
38 "blib" => "1.01"
3839 },
39 "VERSION" => "0.005001",
40 "VERSION" => "0.08",
4041 "test" => {
4142 "TESTS" => "t/*.t"
4243 }
4647 my %FallbackPrereqs = (
4748 "Dist::Zilla::Role::FileFinderUser" => 0,
4849 "Dist::Zilla::Role::FileMunger" => 0,
50 "Dist::Zilla::Role::PPI" => 0,
51 "ExtUtils::MakeMaker" => 0,
4952 "File::Spec" => 0,
5053 "IO::Handle" => 0,
5154 "IPC::Open3" => 0,
5255 "Moose" => 0,
5356 "MooseX::Types::Perl" => 0,
5457 "PPI" => 0,
58 "Path::Class" => 0,
5559 "Test::DZil" => 0,
56 "Test::More" => "0.88",
60 "Test::More" => 0,
5761 "Test::Version" => "0.04",
62 "blib" => "1.01",
5863 "namespace::autoclean" => 0,
5964 "strict" => 0,
6065 "warnings" => 0
7176 unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
7277
7378 WriteMakefile(%WriteMakefileArgs);
74
75
76
00 NAME
1 Dist::Zilla::Plugin::OurPkgVersion - no line insertion and does Package
1
2 Dist::Zilla::Plugin::OurPkgVersion - No line insertion and does Package
23 version with our
34
45 VERSION
5 version 0.005001
6
7 version 0.08
68
79 SYNOPSIS
10
811 in dist.ini
912
1013 [OurPkgVersion]
1417 # VERSION
1518
1619 DESCRIPTION
20
1721 This module was created as an alternative to
1822 Dist::Zilla::Plugin::PkgVersion and uses some code from that module.
19 This module is designed to use a the more readable format "our $VERSION
20 = $version;" as well as not change then number of lines of code in your
23 This module is designed to use a the more readable format our $VERSION
24 = $version; as well as not change then number of lines of code in your
2125 files, which will keep your repository more in sync with your CPAN
2226 release. It also allows you slightly more freedom in how you specify
2327 your version.
2428
25 EXAMPLES
29 EXAMPLES
30
2631 in dist.ini
2732
2833 ...
8691 ...
8792
8893 Also note, the package line is not in any way significant, it will
89 insert the "our $VERSION" line anywhere in the file before "# VERSION"
90 as many times as you've written "# VERSION" regardless of whether or not
94 insert the our $VERSION line anywhere in the file before # VERSION as
95 many times as you've written # VERSION regardless of whether or not
9196 inserting it there is a good idea. OurPkgVersion will not insert a
92 version unless you have "# VERSION" so it is a bit more work.
97 version unless you have # VERSION so it is a bit more work.
9398
9499 If you make a trial release, the comment will be altered to say so:
95100
100105 our $VERSION = '0.01'; # TRIAL VERSION
101106
102107 METHODS
108
103109 munge_files
104 Override the default provided by Dist::Zilla::Role::FileMunger to
105 limit the number of files to search to only be modules and
106 executables.
110
111 Override the default provided by Dist::Zilla::Role::FileMunger to
112 limit the number of files to search to only be modules and
113 executables.
107114
108115 munge_file
109 tells which files to munge, see Dist::Zilla::Role::FileMunger
116
117 tells which files to munge, see Dist::Zilla::Role::FileMunger
110118
111119 BUGS
120
112121 Please report any bugs or feature requests on the bugtracker website
113 https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues
122 https://github.com/plicease/dist-zilla-plugin-ourpkgversion/issues
114123
115124 When submitting a bug or request, please include a test-file or a patch
116125 to an existing test-file that illustrates the bug or desired feature.
117126
118127 CONTRIBUTORS
119 * Alexandr Ciornii <alexchorny@gmail.com>
120128
121 * Alexei Znamensky <russoz@cpan.org>
129 * Alexandr Ciornii <alexchorny@gmail.com>
122130
123 * Christian Walde <walde.christian@googlemail.com>
131 * Alexei Znamensky <russoz@cpan.org>
124132
125 * Christopher J. Madsen <perl@cjmweb.net>
133 * Christian Walde <walde.christian@googlemail.com>
126134
127 * David Golden <dagolden@cpan.org>
135 * Christopher J. Madsen <perl@cjmweb.net>
128136
129 AUTHOR
130 Caleb Cushing <xenoterracide@gmail.com>
137 * David Golden <dagolden@cpan.org>
138
139 * Graham Ollis <perl@wdlabs.com>
140
141 * Graham Ollis <plicease@cpan.org>
142
143 AUTHORS
144
145 * Caleb Cushing <xenoterracide@gmail.com>
146
147 * Grahan Ollis <plicease@cpan.org>
131148
132149 COPYRIGHT AND LICENSE
133 This software is Copyright (c) 2013 by Caleb Cushing.
150
151 This software is Copyright (c) 2016 by Caleb Cushing.
134152
135153 This is free software, licensed under:
136154
22 use strict;
33 use warnings;
44
5 our $VERSION = '0.005001'; # VERSION
5 our $VERSION = '0.08'; # VERSION
66
77 use Moose;
88 with (
1010 'Dist::Zilla::Role::FileFinderUser' => {
1111 default_finders => [ ':InstallModules', ':ExecFiles' ],
1212 },
13 'Dist::Zilla::Role::PPI',
1314 );
1415
1516 use PPI;
3637 confess 'invalid characters in version'
3738 unless LaxVersionStr->check( $version );
3839
39 my $content = $file->content;
40
41 my $doc = PPI::Document->new(\$content)
42 or $self->log( 'Skipping: "'
43 . $file->name
44 . '" error with PPI: '
45 . PPI::Document->errstr
46 )
47 ;
40 my $doc = $self->ppi_document_for_file($file);
4841
4942 return unless defined $doc;
5043
7871 . qq{'; $comment}
7972 ;
8073 $_->set_content("$code");
81 $file->content( $doc->serialize );
8274 $munged_version++;
8375 }
8476 }
8577 }
8678
8779 if ( $munged_version ) {
80 $self->save_ppi_document_to_file( $doc, $file);
8881 $self->log_debug([ 'adding $VERSION assignment to %s', $file->name ]);
8982 }
9083 else {
9790 }
9891 __PACKAGE__->meta->make_immutable;
9992 1;
100 # ABSTRACT: no line insertion and does Package version with our
93 # ABSTRACT: No line insertion and does Package version with our
10194
10295 __END__
10396
10598
10699 =head1 NAME
107100
108 Dist::Zilla::Plugin::OurPkgVersion - no line insertion and does Package version with our
101 Dist::Zilla::Plugin::OurPkgVersion - No line insertion and does Package version with our
109102
110103 =head1 VERSION
111104
112 version 0.005001
105 version 0.08
113106
114107 =head1 SYNOPSIS
115108
226219 =head1 BUGS
227220
228221 Please report any bugs or feature requests on the bugtracker website
229 https://github.com/xenoterracide/dist-zilla-plugin-ourpkgversion/issues
222 https://github.com/plicease/dist-zilla-plugin-ourpkgversion/issues
230223
231224 When submitting a bug or request, please include a test-file or a
232225 patch to an existing test-file that illustrates the bug or desired
234227
235228 =head1 CONTRIBUTORS
236229
230 =for stopwords Alexandr Ciornii Alexei Znamensky Christian Walde Christopher J. Madsen David Golden Graham Ollis
231
237232 =over 4
238233
239234 =item *
256251
257252 David Golden <dagolden@cpan.org>
258253
254 =item *
255
256 Graham Ollis <perl@wdlabs.com>
257
258 =item *
259
260 Graham Ollis <plicease@cpan.org>
261
259262 =back
260263
261 =head1 AUTHOR
264 =head1 AUTHORS
265
266 =over 4
267
268 =item *
262269
263270 Caleb Cushing <xenoterracide@gmail.com>
264271
272 =item *
273
274 Grahan Ollis <plicease@cpan.org>
275
276 =back
277
265278 =head1 COPYRIGHT AND LICENSE
266279
267 This software is Copyright (c) 2013 by Caleb Cushing.
280 This software is Copyright (c) 2016 by Caleb Cushing.
268281
269282 This is free software, licensed under:
270283
11 use strict;
22 use warnings;
33
4 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.039
4 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054
55
6 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
6 use Test::More;
77
8
8 plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
99
1010 my @module_files = (
1111 'Dist/Zilla/Plugin/OurPkgVersion.pm'
3535 waitpid($pid, 0);
3636 is($?, 0, "$lib loaded ok");
3737
38 shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
39 and not eval { require blib; blib->VERSION('1.01') };
40
3841 if (@_warnings)
3942 {
4043 warn @_warnings;
4447
4548
4649
47 is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
50 is(scalar(@warnings), 0, 'no warnings found')
51 or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
4852
4953
0 do { my $x = {
1 'configure' => {
2 'requires' => {
3 'ExtUtils::MakeMaker' => '0'
4 }
5 },
6 'develop' => {
7 'requires' => {
8 'Pod::Coverage::TrustPod' => '0',
9 'Test::CPAN::Changes' => '0.19',
10 'Test::CPAN::Meta' => '0',
11 'Test::CPAN::Meta::JSON' => '0.16',
12 'Test::EOL' => '0',
13 'Test::Kwalitee' => '1.21',
14 'Test::Mojibake' => '0',
15 'Test::More' => '0.88',
16 'Test::Pod' => '1.41',
17 'Test::Pod::Coverage' => '1.08',
18 'Test::Pod::LinkCheck' => '0',
19 'Test::Spelling' => '0.12',
20 'Test::Version' => '1'
21 }
22 },
23 'runtime' => {
24 'requires' => {
25 'Dist::Zilla::Role::FileFinderUser' => '0',
26 'Dist::Zilla::Role::FileMunger' => '0',
27 'Dist::Zilla::Role::PPI' => '0',
28 'Moose' => '0',
29 'MooseX::Types::Perl' => '0',
30 'PPI' => '0',
31 'namespace::autoclean' => '0',
32 'perl' => '5.008',
33 'strict' => '0',
34 'warnings' => '0'
35 }
36 },
37 'test' => {
38 'recommends' => {
39 'CPAN::Meta' => '2.120900'
40 },
41 'requires' => {
42 'ExtUtils::MakeMaker' => '0',
43 'File::Spec' => '0',
44 'IO::Handle' => '0',
45 'IPC::Open3' => '0',
46 'Path::Class' => '0',
47 'Test::DZil' => '0',
48 'Test::More' => '0',
49 'Test::Version' => '0.04',
50 'blib' => '1.01'
51 }
52 }
53 };
54 $x;
55 }
0 #!perl
1
2 use strict;
3 use warnings;
4
5 # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.024
6
7 use Test::More tests => 1;
8
9 use ExtUtils::MakeMaker;
10 use File::Spec;
11
12 # from $version::LAX
13 my $lax_version_re =
14 qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
15 |
16 (?:\.[0-9]+) (?:_[0-9]+)?
17 ) | (?:
18 v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
19 |
20 (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
21 )
22 )/x;
23
24 # hide optional CPAN::Meta modules from prereq scanner
25 # and check if they are available
26 my $cpan_meta = "CPAN::Meta";
27 my $cpan_meta_pre = "CPAN::Meta::Prereqs";
28 my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
29
30 # Verify requirements?
31 my $DO_VERIFY_PREREQS = 1;
32
33 sub _max {
34 my $max = shift;
35 $max = ( $_ > $max ) ? $_ : $max for @_;
36 return $max;
37 }
38
39 sub _merge_prereqs {
40 my ($collector, $prereqs) = @_;
41
42 # CPAN::Meta::Prereqs object
43 if (ref $collector eq $cpan_meta_pre) {
44 return $collector->with_merged_prereqs(
45 CPAN::Meta::Prereqs->new( $prereqs )
46 );
47 }
48
49 # Raw hashrefs
50 for my $phase ( keys %$prereqs ) {
51 for my $type ( keys %{ $prereqs->{$phase} } ) {
52 for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
53 $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
54 }
55 }
56 }
57
58 return $collector;
59 }
60
61 my @include = qw(
62
63 );
64
65 my @exclude = qw(
66
67 );
68
69 # Add static prereqs to the included modules list
70 my $static_prereqs = do 't/00-report-prereqs.dd';
71
72 # Merge all prereqs (either with ::Prereqs or a hashref)
73 my $full_prereqs = _merge_prereqs(
74 ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
75 $static_prereqs
76 );
77
78 # Add dynamic prereqs to the included modules list (if we can)
79 my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
80 if ( $source && $HAS_CPAN_META ) {
81 if ( my $meta = eval { CPAN::Meta->load_file($source) } ) {
82 $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
83 }
84 }
85 else {
86 $source = 'static metadata';
87 }
88
89 my @full_reports;
90 my @dep_errors;
91 my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
92
93 # Add static includes into a fake section
94 for my $mod (@include) {
95 $req_hash->{other}{modules}{$mod} = 0;
96 }
97
98 for my $phase ( qw(configure build test runtime develop other) ) {
99 next unless $req_hash->{$phase};
100 next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
101
102 for my $type ( qw(requires recommends suggests conflicts modules) ) {
103 next unless $req_hash->{$phase}{$type};
104
105 my $title = ucfirst($phase).' '.ucfirst($type);
106 my @reports = [qw/Module Want Have/];
107
108 for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
109 next if $mod eq 'perl';
110 next if grep { $_ eq $mod } @exclude;
111
112 my $file = $mod;
113 $file =~ s{::}{/}g;
114 $file .= ".pm";
115 my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
116
117 my $want = $req_hash->{$phase}{$type}{$mod};
118 $want = "undef" unless defined $want;
119 $want = "any" if !$want && $want == 0;
120
121 my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
122
123 if ($prefix) {
124 my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
125 $have = "undef" unless defined $have;
126 push @reports, [$mod, $want, $have];
127
128 if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
129 if ( $have !~ /\A$lax_version_re\z/ ) {
130 push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
131 }
132 elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
133 push @dep_errors, "$mod version '$have' is not in required range '$want'";
134 }
135 }
136 }
137 else {
138 push @reports, [$mod, $want, "missing"];
139
140 if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
141 push @dep_errors, "$mod is not installed ($req_string)";
142 }
143 }
144 }
145
146 if ( @reports ) {
147 push @full_reports, "=== $title ===\n\n";
148
149 my $ml = _max( map { length $_->[0] } @reports );
150 my $wl = _max( map { length $_->[1] } @reports );
151 my $hl = _max( map { length $_->[2] } @reports );
152
153 if ($type eq 'modules') {
154 splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
155 push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
156 }
157 else {
158 splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
159 push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
160 }
161
162 push @full_reports, "\n";
163 }
164 }
165 }
166
167 if ( @full_reports ) {
168 diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
169 }
170
171 if ( @dep_errors ) {
172 diag join("\n",
173 "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n",
174 "The following REQUIRED prerequisites were not satisfied:\n",
175 @dep_errors,
176 "\n"
177 );
178 }
179
180 pass;
181
182 # vim: ts=4 sts=4 sw=4 et:
+0
-84
t/000-report-versions-tiny.t less more
0 use strict;
1 use warnings;
2 use Test::More 0.88;
3 # This is a relatively nice way to avoid Test::NoWarnings breaking our
4 # expectations by adding extra tests, without using no_plan. It also helps
5 # avoid any other test module that feels introducing random tests, or even
6 # test plans, is a nice idea.
7 our $success = 0;
8 END { $success && done_testing; }
9
10 # List our own version used to generate this
11 my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n";
12
13 eval { # no excuses!
14 # report our Perl details
15 my $want = '5.008';
16 $v .= "perl: $] (wanted $want) on $^O from $^X\n\n";
17 };
18 defined($@) and diag("$@");
19
20 # Now, our module version dependencies:
21 sub pmver {
22 my ($module, $wanted) = @_;
23 $wanted = " (want $wanted)";
24 my $pmver;
25 eval "require $module;";
26 if ($@) {
27 if ($@ =~ m/Can't locate .* in \@INC/) {
28 $pmver = 'module not found.';
29 } else {
30 diag("${module}: $@");
31 $pmver = 'died during require.';
32 }
33 } else {
34 my $version;
35 eval { $version = $module->VERSION; };
36 if ($@) {
37 diag("${module}: $@");
38 $pmver = 'died during VERSION check.';
39 } elsif (defined $version) {
40 $pmver = "$version";
41 } else {
42 $pmver = '<undef>';
43 }
44 }
45
46 # So, we should be good, right?
47 return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n");
48 }
49
50 eval { $v .= pmver('Dist::Zilla::Role::FileFinderUser','any version') };
51 eval { $v .= pmver('Dist::Zilla::Role::FileMunger','any version') };
52 eval { $v .= pmver('ExtUtils::MakeMaker','6.30') };
53 eval { $v .= pmver('File::Spec','any version') };
54 eval { $v .= pmver('IO::Handle','any version') };
55 eval { $v .= pmver('IPC::Open3','any version') };
56 eval { $v .= pmver('Moose','any version') };
57 eval { $v .= pmver('MooseX::Types::Perl','any version') };
58 eval { $v .= pmver('PPI','any version') };
59 eval { $v .= pmver('Test::DZil','any version') };
60 eval { $v .= pmver('Test::More','0.88') };
61 eval { $v .= pmver('Test::Version','0.04') };
62 eval { $v .= pmver('namespace::autoclean','any version') };
63 eval { $v .= pmver('strict','any version') };
64 eval { $v .= pmver('warnings','any version') };
65
66
67 # All done.
68 $v .= <<'EOT';
69
70 Thanks for using my code. I hope it works for you.
71 If not, please try and include this output in the bug report.
72 That will help me reproduce the issue and solve your problem.
73
74 EOT
75
76 diag($v);
77 ok(1, "we really didn't test anything, just reporting data");
78 $success = 1;
79
80 # Work around another nasty module on CPAN. :/
81 no warnings 'once';
82 $Template::Test::NO_FLUSH = 1;
83 exit 0;
33 use Test::More;
44 use Test::DZil;
55 use Test::Version qw( version_ok );
6 use Path::Class qw( dir );
67
78 my $tzil = Builder->from_config({ dist_root => 'corpus/DZT' });
89
910 $tzil->build;
1011
11 version_ok( $tzil->tempdir->file('build/lib/DZT0.pm'));
12 version_ok( $tzil->tempdir->file('build/lib/DZT1.pm'));
12 version_ok( dir($tzil->tempdir)->file('build/lib/DZT0.pm'));
13 version_ok( dir($tzil->tempdir)->file('build/lib/DZT1.pm'));
1314
1415 my $lib_0 = $tzil->slurp_file('build/lib/DZT0.pm');
1516 my $lib_1 = $tzil->slurp_file('build/lib/DZT1.pm');
33 use Test::More;
44 use Test::DZil;
55 use Test::Version qw( version_ok );
6 use Path::Class qw( dir );
67
78 my $tzil = Builder->from_config({ dist_root => 'corpus/vDZT' });
89
910 $tzil->build;
1011
11 version_ok( $tzil->tempdir->file('build/lib/vDZT.pm'));
12 version_ok( dir($tzil->tempdir)->file('build/lib/vDZT.pm'));
1213
1314 my $lib = $tzil->slurp_file('build/lib/vDZT.pm');
1415
33 use Test::More;
44 use Test::DZil;
55 use Test::Version qw( version_ok );
6 use Path::Class qw( dir );
67
78 $ENV{TRIAL} = 1;
89
1011
1112 $tzil->build;
1213
13 version_ok( $tzil->tempdir->file('build/lib/DZT0.pm'));
14 version_ok( $tzil->tempdir->file('build/lib/DZT1.pm'));
14 version_ok( dir($tzil->tempdir)->file('build/lib/DZT0.pm'));
15 version_ok( dir($tzil->tempdir)->file('build/lib/DZT1.pm'));
1516
1617 my $lib_0 = $tzil->slurp_file('build/lib/DZT0.pm');
1718 my $lib_1 = $tzil->slurp_file('build/lib/DZT1.pm');
0
1 BEGIN {
2 unless ($ENV{AUTHOR_TESTING}) {
3 require Test::More;
4 Test::More::plan(skip_all => 'these tests are for testing by the author');
5 }
6 }
7
8 use strict;
9 use warnings;
10
11 # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18
12
13 use Test::More 0.88;
14 use Test::EOL;
15
16 my @files = (
17 'lib/Dist/Zilla/Plugin/OurPkgVersion.pm',
18 't/00-compile.t',
19 't/00-report-prereqs.dd',
20 't/00-report-prereqs.t',
21 't/01-basic.t',
22 't/02-vstring.t',
23 't/03-trial.t',
24 't/author-critic.t',
25 't/author-eol.t',
26 't/author-mojibake.t',
27 't/author-pod-coverage.t',
28 't/author-pod-spell.t',
29 't/author-pod-syntax.t',
30 't/author-test-version.t',
31 't/release-cpan-changes.t',
32 't/release-dist-manifest.t',
33 't/release-distmeta.t',
34 't/release-kwalitee.t',
35 't/release-meta-json.t',
36 't/release-minimum-version.t',
37 't/release-pod-linkcheck.t',
38 't/release-portability.t',
39 't/release-unused-vars.t'
40 );
41
42 eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
43 done_testing;
0 #!perl
1
2 BEGIN {
3 unless ($ENV{AUTHOR_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for testing by the author');
6 }
7 }
8
9
10 use strict;
11 use warnings qw(all);
12
13 use Test::More;
14 use Test::Mojibake;
15
16 all_files_encoding_ok();
0 #!perl
1
2 BEGIN {
3 unless ($ENV{AUTHOR_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for testing by the author');
6 }
7 }
8
9 # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
10
11 use Test::Pod::Coverage 1.08;
12 use Pod::Coverage::TrustPod;
13
14 all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
99 use warnings;
1010 use Test::More;
1111
12 # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001
12 # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000
1313 use Test::Spelling 0.12;
1414 use Pod::Wordlist;
1515
2525 Caleb
2626 Cushing
2727 xenoterracide
28 Grahan
29 Ollis
30 plicease
2831 Alexandr
2932 Ciornii
3033 alexchorny
4043 David
4144 Golden
4245 dagolden
46 Graham
4347 lib
4448 Dist
4549 Zilla
0 #!perl
1
2 BEGIN {
3 unless ($ENV{AUTHOR_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for testing by the author');
6 }
7 }
8
9 # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
10 use strict; use warnings;
11 use Test::More;
12 use Test::Pod 1.41;
13
14 all_pod_files_ok();
+0
-16
t/author-test-eol.t less more
0
1 BEGIN {
2 unless ($ENV{AUTHOR_TESTING}) {
3 require Test::More;
4 Test::More::plan(skip_all => 'these tests are for testing by the author');
5 }
6 }
7
8 use strict;
9 use warnings;
10 use Test::More;
11
12 # generated by Dist::Zilla::Plugin::Test::EOL 0.08
13 use Test::EOL;
14
15 all_perl_files_ok({ trailing_whitespace => 1 });
0
1 BEGIN {
2 unless ($ENV{AUTHOR_TESTING}) {
3 require Test::More;
4 Test::More::plan(skip_all => 'these tests are for testing by the author');
5 }
6 }
7
8 use strict;
9 use warnings;
10 use Test::More;
11
12 # generated by Dist::Zilla::Plugin::Test::Version 1.05
13 use Test::Version;
14
15 my @imports = qw( version_all_ok );
16
17 my $params = {
18 is_strict => 0,
19 has_version => 1,
20 multiple => 0,
21
22 };
23
24 push @imports, $params
25 if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
26
27
28 Test::Version->import(@imports);
29
30 version_all_ok;
31 done_testing;
66 }
77 }
88
9 # This file was automatically generated by Dist::Zilla::Plugin::MetaTests.
910
10 use Test::More;
11 use Test::CPAN::Meta;
1112
12 eval "use Test::CPAN::Meta";
13 plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
1413 meta_yaml_ok();
55 }
66 }
77
8 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.07
8 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12
99 use strict;
1010 use warnings;
11 use Test::Kwalitee;
11 use Test::More 0.88;
12 use Test::Kwalitee 1.21 'kwalitee_ok';
13
14 kwalitee_ok();
15
16 done_testing;
77 }
88
99
10 use Test::More;
11 eval 'use Test::CPAN::Meta::JSON';
12 plan skip_all => 'Test::CPAN::Meta::JSON required for testing META.json' if $@;
10 use Test::CPAN::Meta::JSON;
1311 meta_json_ok();
+0
-20
t/release-mojibake.t less more
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9
10 use strict;
11 use warnings qw(all);
12
13 use Test::More;
14
15 ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval)
16 eval q(use Test::Mojibake);
17 plan skip_all => q(Test::Mojibake required for source encoding testing) if $@;
18
19 all_files_encoding_ok();
+0
-21
t/release-pod-coverage.t less more
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9
10 use Test::More;
11
12 eval "use Test::Pod::Coverage 1.08";
13 plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
14 if $@;
15
16 eval "use Pod::Coverage::TrustPod";
17 plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
18 if $@;
19
20 all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
+0
-15
t/release-pod-syntax.t less more
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9 use Test::More;
10
11 eval "use Test::Pod 1.41";
12 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
13
14 all_pod_files_ok();
1515 eval 'use Test::Portability::Files';
1616 plan skip_all => 'Test::Portability::Files required for testing portability'
1717 if $@;
18
1819 run_tests();
+0
-30
t/release-test-version.t less more
0
1 BEGIN {
2 unless ($ENV{RELEASE_TESTING}) {
3 require Test::More;
4 Test::More::plan(skip_all => 'these tests are for release candidate testing');
5 }
6 }
7
8 use strict;
9 use warnings;
10 use Test::More;
11
12 # generated by Dist::Zilla::Plugin::Test::Version 0.002004
13 BEGIN { eval "use Test::Version; 1;" or die $@; }
14
15 my @imports = ( 'version_all_ok' );
16
17 my $params = {
18 is_strict => 0,
19 has_version => 1,
20 };
21
22 push @imports, $params
23 if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
24
25
26 Test::Version->import(@imports);
27
28 version_all_ok;
29 done_testing;
77 }
88
99
10 use Test::More;
10 use Test::More 0.96 tests => 1;
11 eval { require Test::Vars };
1112
12 eval "use Test::Vars";
13 plan skip_all => "Test::Vars required for testing unused vars"
14 if $@;
13 SKIP: {
14 skip 1 => 'Test::Vars required for testing for unused vars'
15 if $@;
16 Test::Vars->import;
17
18 subtest 'unused vars' => sub {
1519 all_vars_ok();
20 };
21 };