Codebase list libclass-insideout-perl / 7d42cef
New upstream version 1.14 Damyan Ivanov 6 years ago
53 changed file(s) with 676 addition(s) and 384 deletion(s). Raw diff Collapse all Expand all
+0
-50
CONTRIBUTING less more
0 README.PATCHING
1
2 Thank you for considering contributing to this distribution. This file
3 contains instructions that will help you work with the source code.
4
5 The distribution is managed with Dist::Zilla. This means than many of the
6 usual files you might expect are not in the repository, but are generated
7 at release time (e.g. Makefile.PL).
8
9 However, you can run tests directly using the 'prove' tool:
10
11 $ prove -l
12 $ prove -lv t/some_test_file.t
13
14 For most distributions, 'prove' is entirely sufficent for you to test any
15 patches you have.
16
17 You may need to satisfy some dependencies. See the included META.json
18 file for a list. If you install App::mymeta_requires from CPAN, it's easy
19 to satisfy any that you are missing by piping the output to your favorite
20 CPAN client:
21
22 $ mymeta-requires | cpanm
23 $ cpan `mymeta-requires`
24
25 Likewise, much of the documentation Pod is generated at release time.
26 Depending on the distribution, some documentation may be written in a Pod
27 dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to
28 submit a documentation edit, please limit yourself to the documentation you
29 see.
30
31 If you see typos or documentation issues in the generated docs, please
32 email or open a bug ticket instead of patching.
33
34 Dist::Zilla is a very powerful authoring tool, but requires a number of
35 author-specific plugins. If you would like to use it for contributing,
36 install it from CPAN, then run one of the following commands, depending on
37 your CPAN client:
38
39 $ cpan `dzil authordeps`
40 $ dzil authordeps | cpanm
41
42 Once installed, here are some dzil commands you might try:
43
44 $ dzil build
45 $ dzil test
46 $ dzil xtest
47
48 You can learn more about Dist::Zilla at http://dzil.org/
49
0 ## HOW TO CONTRIBUTE
1
2 Thank you for considering contributing to this distribution. This file
3 contains instructions that will help you work with the source code.
4
5 The distribution is managed with Dist::Zilla. This means that many of the
6 usual files you might expect are not in the repository, but are generated at
7 release time, as is much of the documentation. Some generated files are
8 kept in the repository as a convenience (e.g. Makefile.PL or cpanfile).
9
10 Generally, **you do not need Dist::Zilla to contribute patches**. You do need
11 Dist::Zilla to create a tarball. See below for guidance.
12
13 ### Getting dependencies
14
15 If you have App::cpanminus 1.6 or later installed, you can use `cpanm` to
16 satisfy dependencies like this:
17
18 $ cpanm --installdeps .
19
20 Otherwise, look for either a `Makefile.PL` or `cpanfile` file for
21 a list of dependencies to satisfy.
22
23 ### Running tests
24
25 You can run tests directly using the `prove` tool:
26
27 $ prove -l
28 $ prove -lv t/some_test_file.t
29
30 For most of my distributions, `prove` is entirely sufficient for you to test any
31 patches you have. I use `prove` for 99% of my testing during development.
32
33 ### Code style and tidying
34
35 Please try to match any existing coding style. If there is a `.perltidyrc`
36 file, please install Perl::Tidy and use perltidy before submitting patches.
37
38 If there is a `tidyall.ini` file, you can also install Code::TidyAll and run
39 `tidyall` on a file or `tidyall -a` to tidy all files.
40
41 ### Patching documentation
42
43 Much of the documentation Pod is generated at release time. Some is
44 generated boilerplate; other documentation is built from pseudo-POD
45 directives in the source like C<=method> or C<=func>.
46
47 If you would like to submit a documentation edit, please limit yourself to
48 the documentation you see.
49
50 If you see typos or documentation issues in the generated docs, please
51 email or open a bug ticket instead of patching.
52
53 ### Where to send patches and pull requests
54
55 If you found this distribution on Github, sending a pull-request is the
56 best way to contribute.
57
58 If a pull-request isn't possible, a bug ticket with a patch file is the
59 next best option.
60
61 As a last resort, an email to the author(s) is acceptable.
62
63 ## Installing and using Dist::Zilla
64
65 Dist::Zilla is not required for contributing, but if you'd like to learn
66 more, this section will get you up to speed.
67
68 Dist::Zilla is a very powerful authoring tool, optimized for maintaining a
69 large number of distributions with a high degree of automation, but it has a
70 large dependency chain, a bit of a learning curve and requires a number of
71 author-specific plugins.
72
73 To install it from CPAN, I recommend one of the following approaches for
74 the quickest installation:
75
76 # using CPAN.pm, but bypassing non-functional pod tests
77 $ cpan TAP::Harness::Restricted
78 $ PERL_MM_USE_DEFAULT=1 HARNESS_CLASS=TAP::Harness::Restricted cpan Dist::Zilla
79
80 # using cpanm, bypassing *all* tests
81 $ cpanm -n Dist::Zilla
82
83 In either case, it's probably going to take about 10 minutes. Go for a walk,
84 go get a cup of your favorite beverage, take a bathroom break, or whatever.
85 When you get back, Dist::Zilla should be ready for you.
86
87 Then you need to install any plugins specific to this distribution:
88
89 $ cpan `dzil authordeps`
90 $ dzil authordeps | cpanm
91
92 Once installed, here are some dzil commands you might try:
93
94 $ dzil build
95 $ dzil test
96 $ dzil xtest
97
98 You can learn more about Dist::Zilla at http://dzil.org/
99
00 Revision history for Perl module Class::InsideOut
1
2 1.14 2017-04-02 13:52:18-04:00 America/New_York
3
4 Fixed:
5
6 - Passes tests when '.' is not in @INC.
17
28 1.13 2013-04-25 13:59:42 America/New_York
39
0 CONTRIBUTING
0 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009.
1 CONTRIBUTING.mkdn
12 Changes
23 LICENSE
34 MANIFEST
67 Makefile.PL
78 README
89 Todo
10 cpanfile
911 dist.ini
1012 examples/README
1113 lib/Class/InsideOut.pm
1214 lib/Class/InsideOut/Manual/About.pod
1315 lib/Class/InsideOut/Manual/Advanced.pod
1416 perlcritic.rc
15 t/00-compile.t
17 t/00-report-prereqs.dd
1618 t/00-report-prereqs.t
1719 t/01_load.t
1820 t/02_register.t
6365 t/Object/WithNew.pm
6466 t/Object/WithNew/Inherited.pm
6567 t/data/testdata.txt
68 xt/author/00-compile.t
6669 xt/author/critic.t
70 xt/author/pod-coverage.t
6771 xt/author/pod-spell.t
72 xt/author/pod-syntax.t
73 xt/author/portability.t
74 xt/author/test-version.t
6875 xt/release/distmeta.t
6976 xt/release/minimum-version.t
70 xt/release/pod-coverage.t
71 xt/release/pod-syntax.t
72 xt/release/portability.t
73 xt/release/test-version.t
33 "David Golden <dagolden@cpan.org>"
44 ],
55 "dynamic_config" : 0,
6 "generated_by" : "Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.130880",
6 "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010",
77 "license" : [
88 "apache_2_0"
99 ],
1010 "meta-spec" : {
1111 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
12 "version" : "2"
12 "version" : 2
1313 },
1414 "name" : "Class-InsideOut",
1515 "no_index" : {
1616 "directory" : [
17 "corpus",
18 "examples",
1719 "t",
18 "xt",
19 "examples",
20 "corpus"
20 "xt"
2121 ],
2222 "package" : [
2323 "DB"
2626 "prereqs" : {
2727 "configure" : {
2828 "requires" : {
29 "ExtUtils::MakeMaker" : "6.30"
29 "ExtUtils::MakeMaker" : "6.17",
30 "perl" : "5.006"
3031 }
3132 },
3233 "develop" : {
3334 "requires" : {
35 "Dist::Zilla" : "5",
36 "Dist::Zilla::Plugin::ReleaseStatus::FromVersion" : "0",
37 "Dist::Zilla::Plugin::RemovePrereqs" : "0",
38 "Dist::Zilla::PluginBundle::DAGOLDEN" : "0.072",
39 "English" : "0",
40 "File::Spec" : "0",
41 "File::Temp" : "0",
42 "IO::Handle" : "0",
43 "IPC::Open3" : "0",
3444 "Pod::Coverage::TrustPod" : "0",
45 "Pod::Wordlist" : "0",
46 "Software::License::Apache_2_0" : "0",
3547 "Test::CPAN::Meta" : "0",
48 "Test::MinimumVersion" : "0",
49 "Test::More" : "0",
3650 "Test::Pod" : "1.41",
37 "Test::Pod::Coverage" : "1.08"
51 "Test::Pod::Coverage" : "1.08",
52 "Test::Portability::Files" : "0",
53 "Test::Spelling" : "0.12",
54 "Test::Version" : "1",
55 "blib" : "1.01",
56 "perl" : "5.006",
57 "warnings" : "0"
3858 }
3959 },
4060 "runtime" : {
5171 }
5272 },
5373 "test" : {
74 "recommends" : {
75 "CPAN::Meta" : "2.120900"
76 },
5477 "requires" : {
55 "Config" : "0",
5678 "DynaLoader" : "0",
5779 "ExtUtils::MakeMaker" : "0",
58 "File::Find" : "0",
5980 "File::Spec" : "0",
60 "File::Spec::Functions" : "0",
61 "File::Temp" : "0",
6281 "IO::File" : "0",
63 "List::Util" : "0",
6482 "Test::More" : "0.45",
6583 "XSLoader" : "0",
84 "lib" : "0",
85 "perl" : "5.008",
6686 "threads" : "0",
6787 "warnings" : "0"
6888 }
7191 "provides" : {
7292 "Class::InsideOut" : {
7393 "file" : "lib/Class/InsideOut.pm",
74 "version" : "1.13"
94 "version" : "1.14"
7595 }
7696 },
7797 "release_status" : "stable",
7999 "bugtracker" : {
80100 "web" : "https://github.com/dagolden/class-insideout/issues"
81101 },
82 "homepage" : "https://metacpan.org/release/Class-InsideOut",
102 "homepage" : "https://github.com/dagolden/class-insideout",
83103 "repository" : {
84104 "type" : "git",
85 "url" : "git://github.com/dagolden/class-insideout.git",
105 "url" : "https://github.com/dagolden/class-insideout.git",
86106 "web" : "https://github.com/dagolden/class-insideout"
87107 }
88108 },
89 "version" : "1.13",
109 "version" : "1.14",
110 "x_authority" : "cpan:DAGOLDEN",
90111 "x_contributors" : [
91112 "Karen Etheridge <ether@cpan.org>",
92113 "Toby Inkster <tonyink@cpan.org>"
93 ]
114 ],
115 "x_serialization_backend" : "Cpanel::JSON::XS version 3.0225"
94116 }
95117
22 author:
33 - 'David Golden <dagolden@cpan.org>'
44 build_requires:
5 Config: 0
6 DynaLoader: 0
7 ExtUtils::MakeMaker: 0
8 File::Find: 0
9 File::Spec: 0
10 File::Spec::Functions: 0
11 File::Temp: 0
12 IO::File: 0
13 List::Util: 0
14 Test::More: 0.45
15 XSLoader: 0
16 threads: 0
17 warnings: 0
5 DynaLoader: '0'
6 ExtUtils::MakeMaker: '0'
7 File::Spec: '0'
8 IO::File: '0'
9 Test::More: '0.45'
10 XSLoader: '0'
11 lib: '0'
12 perl: '5.008'
13 threads: '0'
14 warnings: '0'
1815 configure_requires:
19 ExtUtils::MakeMaker: 6.30
16 ExtUtils::MakeMaker: '6.17'
17 perl: '5.006'
2018 dynamic_config: 0
21 generated_by: 'Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.130880'
19 generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010'
2220 license: apache
2321 meta-spec:
2422 url: http://module-build.sourceforge.net/META-spec-v1.4.html
25 version: 1.4
23 version: '1.4'
2624 name: Class-InsideOut
2725 no_index:
2826 directory:
27 - corpus
28 - examples
2929 - t
3030 - xt
31 - examples
32 - corpus
3331 package:
3432 - DB
3533 provides:
3634 Class::InsideOut:
3735 file: lib/Class/InsideOut.pm
38 version: 1.13
36 version: '1.14'
3937 requires:
40 Carp: 0
41 Class::ISA: 0
42 Exporter: 0
43 Scalar::Util: 1.09
44 Storable: 0
45 overload: 0
46 perl: 5.008
47 strict: 0
48 vars: 0
38 Carp: '0'
39 Class::ISA: '0'
40 Exporter: '0'
41 Scalar::Util: '1.09'
42 Storable: '0'
43 overload: '0'
44 perl: '5.008'
45 strict: '0'
46 vars: '0'
4947 resources:
5048 bugtracker: https://github.com/dagolden/class-insideout/issues
51 homepage: https://metacpan.org/release/Class-InsideOut
52 repository: git://github.com/dagolden/class-insideout.git
53 version: 1.13
49 homepage: https://github.com/dagolden/class-insideout
50 repository: https://github.com/dagolden/class-insideout.git
51 version: '1.14'
52 x_authority: cpan:DAGOLDEN
5453 x_contributors:
5554 - 'Karen Etheridge <ether@cpan.org>'
5655 - 'Toby Inkster <tonyink@cpan.org>'
56 x_serialization_backend: 'YAML::Tiny version 1.69'
0
0 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009.
11 use strict;
22 use warnings;
33
44 use 5.008;
55
6 use ExtUtils::MakeMaker 6.30;
7
8
6 use ExtUtils::MakeMaker 6.17;
97
108 my %WriteMakefileArgs = (
119 "ABSTRACT" => "a safe, simple inside-out object construction kit",
1210 "AUTHOR" => "David Golden <dagolden\@cpan.org>",
13 "BUILD_REQUIRES" => {},
1411 "CONFIGURE_REQUIRES" => {
15 "ExtUtils::MakeMaker" => "6.30"
12 "ExtUtils::MakeMaker" => "6.17"
1613 },
1714 "DISTNAME" => "Class-InsideOut",
18 "EXE_FILES" => [],
1915 "LICENSE" => "apache",
16 "MIN_PERL_VERSION" => "5.008",
2017 "NAME" => "Class::InsideOut",
2118 "PREREQ_PM" => {
2219 "Carp" => 0,
2926 "vars" => 0
3027 },
3128 "TEST_REQUIRES" => {
32 "Config" => 0,
3329 "DynaLoader" => 0,
3430 "ExtUtils::MakeMaker" => 0,
35 "File::Find" => 0,
3631 "File::Spec" => 0,
37 "File::Spec::Functions" => 0,
38 "File::Temp" => 0,
3932 "IO::File" => 0,
40 "List::Util" => 0,
4133 "Test::More" => "0.45",
4234 "XSLoader" => 0,
35 "lib" => 0,
4336 "threads" => 0,
4437 "warnings" => 0
4538 },
46 "VERSION" => "1.13",
39 "VERSION" => "1.14",
4740 "test" => {
4841 "TESTS" => "t/*.t"
4942 }
5043 );
5144
5245
46 my %FallbackPrereqs = (
47 "Carp" => 0,
48 "Class::ISA" => 0,
49 "DynaLoader" => 0,
50 "Exporter" => 0,
51 "ExtUtils::MakeMaker" => 0,
52 "File::Spec" => 0,
53 "IO::File" => 0,
54 "Scalar::Util" => "1.09",
55 "Storable" => 0,
56 "Test::More" => "0.45",
57 "XSLoader" => 0,
58 "lib" => 0,
59 "overload" => 0,
60 "strict" => 0,
61 "threads" => 0,
62 "vars" => 0,
63 "warnings" => 0
64 );
65
66
5367 unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
54 my $tr = delete $WriteMakefileArgs{TEST_REQUIRES};
55 my $br = $WriteMakefileArgs{BUILD_REQUIRES};
56 for my $mod ( keys %$tr ) {
57 if ( exists $br->{$mod} ) {
58 $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod};
59 }
60 else {
61 $br->{$mod} = $tr->{$mod};
62 }
63 }
64 }
65
66 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
67 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
68 my $pp = $WriteMakefileArgs{PREREQ_PM};
69 for my $mod ( keys %$br ) {
70 if ( exists $pp->{$mod} ) {
71 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
72 }
73 else {
74 $pp->{$mod} = $br->{$mod};
75 }
76 }
68 delete $WriteMakefileArgs{TEST_REQUIRES};
69 delete $WriteMakefileArgs{BUILD_REQUIRES};
70 $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
7771 }
7872
7973 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
8074 unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
8175
8276 WriteMakefile(%WriteMakefileArgs);
83
84
85
11 Class::InsideOut - a safe, simple inside-out object construction kit
22
33 VERSION
4 version 1.13
4 version 1.14
55
66 SYNOPSIS
77 package My::Class;
388388
389389 <https://github.com/dagolden/class-insideout>
390390
391 git clone git://github.com/dagolden/class-insideout.git
391 git clone https://github.com/dagolden/class-insideout.git
392392
393393 AUTHOR
394394 David Golden <dagolden@cpan.org>
0 requires "Carp" => "0";
1 requires "Class::ISA" => "0";
2 requires "Exporter" => "0";
3 requires "Scalar::Util" => "1.09";
4 requires "Storable" => "0";
5 requires "overload" => "0";
6 requires "perl" => "5.008";
7 requires "strict" => "0";
8 requires "vars" => "0";
9
10 on 'test' => sub {
11 requires "DynaLoader" => "0";
12 requires "ExtUtils::MakeMaker" => "0";
13 requires "File::Spec" => "0";
14 requires "IO::File" => "0";
15 requires "Test::More" => "0.45";
16 requires "XSLoader" => "0";
17 requires "lib" => "0";
18 requires "perl" => "5.008";
19 requires "threads" => "0";
20 requires "warnings" => "0";
21 };
22
23 on 'test' => sub {
24 recommends "CPAN::Meta" => "2.120900";
25 };
26
27 on 'configure' => sub {
28 requires "ExtUtils::MakeMaker" => "6.17";
29 requires "perl" => "5.006";
30 };
31
32 on 'develop' => sub {
33 requires "Dist::Zilla" => "5";
34 requires "Dist::Zilla::Plugin::ReleaseStatus::FromVersion" => "0";
35 requires "Dist::Zilla::Plugin::RemovePrereqs" => "0";
36 requires "Dist::Zilla::PluginBundle::DAGOLDEN" => "0.072";
37 requires "English" => "0";
38 requires "File::Spec" => "0";
39 requires "File::Temp" => "0";
40 requires "IO::Handle" => "0";
41 requires "IPC::Open3" => "0";
42 requires "Pod::Coverage::TrustPod" => "0";
43 requires "Pod::Wordlist" => "0";
44 requires "Software::License::Apache_2_0" => "0";
45 requires "Test::CPAN::Meta" => "0";
46 requires "Test::MinimumVersion" => "0";
47 requires "Test::More" => "0";
48 requires "Test::Pod" => "1.41";
49 requires "Test::Pod::Coverage" => "1.08";
50 requires "Test::Portability::Files" => "0";
51 requires "Test::Spelling" => "0.12";
52 requires "Test::Version" => "1";
53 requires "blib" => "1.01";
54 requires "perl" => "5.006";
55 requires "warnings" => "0";
56 };
44 copyright_year = 2006
55
66 [@DAGOLDEN]
7 :version = 0.038
8 AutoMetaResources.bugtracker.rt = 0
9 AutoMetaResources.bugtracker.github = user:dagolden
7 :version = 0.072
108 stopwords = Etheridge
119 stopwords = Inkster
1210 stopwords = Perlmonks
2321 stopwords = rethrown
2422 stopwords = xdg
2523
24 [ReleaseStatus::FromVersion]
25 testing = second_decimal_odd
26
2627 [RemovePrereqs]
2728 remove = Types::Standard
44
55 =pod
66
7 =encoding utf-8
7 =encoding UTF-8
88
99 =head1 NAME
1010
1212
1313 =head1 VERSION
1414
15 version 1.13
15 version 1.14
1616
1717 =head1 DESCRIPTION
1818
212212
213213 David Golden <dagolden@cpan.org>
214214
215 =head1 CONTRIBUTORS
216
217 =over 4
218
219 =item *
220
221 Karen Etheridge <ether@cpan.org>
222
223 =item *
224
225 Toby Inkster <tonyink@cpan.org>
226
227 =back
228
229215 =head1 COPYRIGHT AND LICENSE
230216
231217 This software is Copyright (c) 2006 by David A. Golden.
44
55 =pod
66
7 =encoding utf-8
7 =encoding UTF-8
88
99 =head1 NAME
1010
1212
1313 =head1 VERSION
1414
15 version 1.13
15 version 1.14
1616
1717 =head1 DESCRIPTION
1818
234234
235235 David Golden <dagolden@cpan.org>
236236
237 =head1 CONTRIBUTORS
238
239 =over 4
240
241 =item *
242
243 Karen Etheridge <ether@cpan.org>
244
245 =item *
246
247 Toby Inkster <tonyink@cpan.org>
248
249 =back
250
251237 =head1 COPYRIGHT AND LICENSE
252238
253239 This software is Copyright (c) 2006 by David A. Golden.
00 package Class::InsideOut;
11 use strict;
22 # ABSTRACT: a safe, simple inside-out object construction kit
3 our $VERSION = '1.13'; # VERSION
3
4 our $VERSION = '1.14';
45
56 use vars qw/@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS/;
67
559560
560561 =pod
561562
562 =encoding utf-8
563 =encoding UTF-8
563564
564565 =head1 NAME
565566
567568
568569 =head1 VERSION
569570
570 version 1.13
571 version 1.14
571572
572573 =head1 SYNOPSIS
573574
10171018
10181019 L<https://github.com/dagolden/class-insideout>
10191020
1020 git clone git://github.com/dagolden/class-insideout.git
1021 git clone https://github.com/dagolden/class-insideout.git
10211022
10221023 =head1 AUTHOR
10231024
10251026
10261027 =head1 CONTRIBUTORS
10271028
1029 =for stopwords Karen Etheridge Toby Inkster
1030
10281031 =over 4
10291032
10301033 =item *
55
66 [TestingAndDebugging::ProhibitNoStrict]
77 allow = refs
8
9 [Variables::ProhibitEvilVariables]
10 variables = $DB::single
811
912 # Turn these off
1013 [-BuiltinFunctions::ProhibitStringyEval]
+0
-74
t/00-compile.t less more
0 #!perl
1
2 use strict;
3 use warnings;
4
5 use Test::More;
6
7
8
9 use File::Find;
10 use File::Temp qw{ tempdir };
11
12 my @modules;
13 find(
14 sub {
15 return if $File::Find::name !~ /\.pm\z/;
16 my $found = $File::Find::name;
17 $found =~ s{^lib/}{};
18 $found =~ s{[/\\]}{::}g;
19 $found =~ s/\.pm$//;
20 # nothing to skip
21 push @modules, $found;
22 },
23 'lib',
24 );
25
26 sub _find_scripts {
27 my $dir = shift @_;
28
29 my @found_scripts = ();
30 find(
31 sub {
32 return unless -f;
33 my $found = $File::Find::name;
34 # nothing to skip
35 open my $FH, '<', $_ or do {
36 note( "Unable to open $found in ( $! ), skipping" );
37 return;
38 };
39 my $shebang = <$FH>;
40 return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
41 push @found_scripts, $found;
42 },
43 $dir,
44 );
45
46 return @found_scripts;
47 }
48
49 my @scripts;
50 do { push @scripts, _find_scripts($_) if -d $_ }
51 for qw{ bin script scripts };
52
53 my $plan = scalar(@modules) + scalar(@scripts);
54 $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
55
56 {
57 # fake home for cpan-testers
58 local $ENV{HOME} = tempdir( CLEANUP => 1 );
59
60 like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
61 for sort @modules;
62
63 SKIP: {
64 eval "use Test::Script 1.05; 1;";
65 skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
66 foreach my $file ( @scripts ) {
67 my $script = $file;
68 $script =~ s!.*/!!;
69 script_compiles( $file, "$script script compiles" );
70 }
71 }
72
73 }
0 do { my $x = {
1 'configure' => {
2 'requires' => {
3 'ExtUtils::MakeMaker' => '6.17',
4 'perl' => '5.006'
5 }
6 },
7 'develop' => {
8 'requires' => {
9 'Dist::Zilla' => '5',
10 'Dist::Zilla::Plugin::ReleaseStatus::FromVersion' => '0',
11 'Dist::Zilla::Plugin::RemovePrereqs' => '0',
12 'Dist::Zilla::PluginBundle::DAGOLDEN' => '0.072',
13 'English' => '0',
14 'File::Spec' => '0',
15 'File::Temp' => '0',
16 'IO::Handle' => '0',
17 'IPC::Open3' => '0',
18 'Pod::Coverage::TrustPod' => '0',
19 'Pod::Wordlist' => '0',
20 'Software::License::Apache_2_0' => '0',
21 'Test::CPAN::Meta' => '0',
22 'Test::MinimumVersion' => '0',
23 'Test::More' => '0',
24 'Test::Pod' => '1.41',
25 'Test::Pod::Coverage' => '1.08',
26 'Test::Portability::Files' => '0',
27 'Test::Spelling' => '0.12',
28 'Test::Version' => '1',
29 'blib' => '1.01',
30 'perl' => '5.006',
31 'warnings' => '0'
32 }
33 },
34 'runtime' => {
35 'requires' => {
36 'Carp' => '0',
37 'Class::ISA' => '0',
38 'Exporter' => '0',
39 'Scalar::Util' => '1.09',
40 'Storable' => '0',
41 'overload' => '0',
42 'perl' => '5.008',
43 'strict' => '0',
44 'vars' => '0'
45 }
46 },
47 'test' => {
48 'recommends' => {
49 'CPAN::Meta' => '2.120900'
50 },
51 'requires' => {
52 'DynaLoader' => '0',
53 'ExtUtils::MakeMaker' => '0',
54 'File::Spec' => '0',
55 'IO::File' => '0',
56 'Test::More' => '0.45',
57 'XSLoader' => '0',
58 'lib' => '0',
59 'perl' => '5.008',
60 'threads' => '0',
61 'warnings' => '0'
62 }
63 }
64 };
65 $x;
66 }
22 use strict;
33 use warnings;
44
5 # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.025
6
57 use Test::More tests => 1;
68
79 use ExtUtils::MakeMaker;
8 use File::Spec::Functions;
9 use List::Util qw/max/;
10 use File::Spec;
1011
11 my @modules = qw(
12 Carp
13 Class::ISA
14 Config
15 DynaLoader
16 Exporter
17 ExtUtils::MakeMaker
18 File::Find
19 File::Spec
20 File::Spec::Functions
21 File::Temp
22 IO::File
23 List::Util
24 Scalar::Util
25 Storable
26 Test::More
27 XSLoader
28 overload
29 perl
30 strict
31 threads
32 vars
33 warnings
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
3463 );
3564
36 # replace modules with dynamic results from MYMETA.json if we can
37 # (hide CPAN::Meta from prereq scanner)
38 my $cpan_meta = "CPAN::Meta";
39 if ( -f "MYMETA.json" && eval "require $cpan_meta" ) { ## no critic
40 if ( my $meta = eval { CPAN::Meta->load_file("MYMETA.json") } ) {
41 my $prereqs = $meta->prereqs;
42 delete $prereqs->{develop};
43 my %uniq = map {$_ => 1} map { keys %$_ } map { values %$_ } values %$prereqs;
44 $uniq{$_} = 1 for @modules; # don't lose any static ones
45 @modules = sort keys %uniq;
46 }
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 && (my $meta = eval { CPAN::Meta->load_file($source) } )
82 ) {
83 $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
84 }
85 else {
86 $source = 'static metadata';
4787 }
4888
49 my @reports = [qw/Version Module/];
89 my @full_reports;
90 my @dep_errors;
91 my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
5092
51 for my $mod ( @modules ) {
52 next if $mod eq 'perl';
53 my $file = $mod;
54 $file =~ s{::}{/}g;
55 $file .= ".pm";
56 my ($prefix) = grep { -e catfile($_, $file) } @INC;
57 if ( $prefix ) {
58 my $ver = MM->parse_version( catfile($prefix, $file) );
59 $ver = "undef" unless defined $ver; # Newer MM should do this anyway
60 push @reports, [$ver, $mod];
61 }
62 else {
63 push @reports, ["missing", $mod];
64 }
93 # Add static includes into a fake section
94 for my $mod (@include) {
95 $req_hash->{other}{modules}{$mod} = 0;
6596 }
6697
67 if ( @reports ) {
68 my $vl = max map { length $_->[0] } @reports;
69 my $ml = max map { length $_->[1] } @reports;
70 splice @reports, 1, 0, ["-" x $vl, "-" x $ml];
71 diag "Prerequisite Report:\n", map {sprintf(" %*s %*s\n",$vl,$_->[0],-$ml,$_->[1])} @reports;
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 );
72178 }
73179
74180 pass;
75181
76 # vim: ts=2 sts=2 sw=2 et:
182 # vim: ts=4 sts=4 sw=4 et:
00 use strict;
1 use lib ".";
12
23 my (@api, @not_api);
34
00 use strict;
1 use lib ".";
12 use Test::More 0.45;
23 use Class::InsideOut ();
34
00 use strict;
1 use lib ".";
12 use Test::More;
23 use Class::InsideOut ();
34
00 use strict;
1 use lib ".";
12 use Config;
23
34 # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Config;
23 use Test::More;
34 $|++; # try to keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 my @export_std = qw(
00 use strict;
1 use lib ".";
12 use Test::More;
23 use Class::InsideOut ();
34
00 use strict;
1 use lib ".";
12 use Test::More;
23 use Class::InsideOut ();
34
00 use strict;
1 use lib ".";
12 use Test::More;
23 use File::Spec;
34 use Class::InsideOut ();
00 use strict;
1 use lib ".";
12 use Test::More;
23 use Class::InsideOut ();
34 use Scalar::Util qw( refaddr reftype );
00 use strict;
1 use lib ".";
12
23 BEGIN {
34 # don't run without Scalar::Util::weaken()
00 use strict;
1 use lib ".";
12 use Test::More;
23 use Class::InsideOut ();
34 use Scalar::Util qw( refaddr reftype );
00 use strict;
1 use lib ".";
12 use Test::More tests => 5;
23
34 $|++; # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 $|++; # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 local $^W = 1;
23 use Test::More;
34
00 use strict;
1 use lib ".";
12 local $^W = 1;
23 use Test::More;
34
00 use strict;
1 use lib ".";
12 local $^W = 1;
23 use Test::More;
34
00 use strict;
1 use lib ".";
12 local $^W = 1;
23 use Test::More;
34 use Scalar::Util qw( refaddr );
00 use strict;
1 use lib ".";
12 local $^W = 1;
23 use Test::More;
34 use Scalar::Util qw( refaddr );
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 select STDERR; $|++;
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 # keep stdout and stderr in order on Win32
00 use strict;
1 use lib ".";
12 use Test::More;
23
34 # keep stdout and stderr in order on Win32
0 use 5.006;
1 use strict;
2 use warnings;
3
4 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056
5
6 use Test::More;
7
8 plan tests => 2;
9
10 my @module_files = (
11 'Class/InsideOut.pm'
12 );
13
14
15
16 # fake home for cpan-testers
17 use File::Temp;
18 local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 );
19
20
21 my @switches = (
22 -d 'blib' ? '-Mblib' : '-Ilib',
23 );
24
25 use File::Spec;
26 use IPC::Open3;
27 use IO::Handle;
28
29 open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
30
31 my @warnings;
32 for my $lib (@module_files)
33 {
34 # see L<perlfaq8/How can I capture STDERR from an external command?>
35 my $stderr = IO::Handle->new;
36
37 diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
38 $^X, @switches, '-e', "require q[$lib]"))
39 if $ENV{PERL_COMPILE_TEST_DEBUG};
40
41 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
42 binmode $stderr, ':crlf' if $^O eq 'MSWin32';
43 my @_warnings = <$stderr>;
44 waitpid($pid, 0);
45 is($?, 0, "$lib loaded ok");
46
47 shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
48 and not eval { require blib; blib->VERSION('1.01') };
49
50 if (@_warnings)
51 {
52 warn @_warnings;
53 push @warnings, @_warnings;
54 }
55 }
56
57
58
59 is(scalar(@warnings), 0, 'no warnings found')
60 or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) );
61
62
0 #!perl
1 # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
2
3 use Test::Pod::Coverage 1.08;
4 use Pod::Coverage::TrustPod;
5
6 all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
11 use warnings;
22 use Test::More;
33
4 # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.004003
5 eval "use Test::Spelling 0.12; use Pod::Wordlist::hanekomu; 1" or die $@;
4 # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007004
5 use Test::Spelling 0.12;
6 use Pod::Wordlist;
67
78
89 add_stopwords(<DATA>);
9 all_pod_files_spelling_ok( qw( bin lib ) );
10 all_pod_files_spelling_ok( qw( bin lib ) );
1011 __DATA__
12 About
13 Advanced
14 Class
15 David
1116 Etheridge
17 Golden
1218 Inkster
19 InsideOut
20 Karen
21 Manual
1322 Perlmonks
1423 ROADMAP
1524 Subclasses
25 Toby
1626 accessable
27 dagolden
1728 dclone
1829 demerphq
1930 deregistered
2031 destructor
32 ether
2133 initializers
2234 jdhedden
35 lib
2336 readonly
2437 rethrown
38 tonyink
2539 xdg
26 David
27 Golden
28 dagolden
29 lib
30 Class
31 InsideOut
32 Manual
33 About
34 Advanced
0 #!perl
1 # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
2 use strict; use warnings;
3 use Test::More;
4 use Test::Pod 1.41;
5
6 all_pod_files_ok();
0 use strict;
1 use warnings;
2
3 use Test::More;
4
5 eval 'use Test::Portability::Files';
6 plan skip_all => 'Test::Portability::Files required for testing portability'
7 if $@;
8 options(test_one_dot => 0);
9 run_tests();
0 use strict;
1 use warnings;
2 use Test::More;
3
4 # generated by Dist::Zilla::Plugin::Test::Version 1.09
5 use Test::Version;
6
7 my @imports = qw( version_all_ok );
8
9 my $params = {
10 is_strict => 0,
11 has_version => 1,
12 multiple => 0,
13
14 };
15
16 push @imports, $params
17 if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
18
19 Test::Version->import(@imports);
20
21 version_all_ok;
22 done_testing;
00 #!perl
1 # This file was automatically generated by Dist::Zilla::Plugin::MetaTests.
12
2 use Test::More;
3 use Test::CPAN::Meta;
34
4 eval "use Test::CPAN::Meta";
5 plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
65 meta_yaml_ok();
+0
-13
xt/release/pod-coverage.t less more
0 #!perl
1
2 use Test::More;
3
4 eval "use Test::Pod::Coverage 1.08";
5 plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
6 if $@;
7
8 eval "use Pod::Coverage::TrustPod";
9 plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
10 if $@;
11
12 all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
+0
-7
xt/release/pod-syntax.t less more
0 #!perl
1 use Test::More;
2
3 eval "use Test::Pod 1.41";
4 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
5
6 all_pod_files_ok();
+0
-12
xt/release/portability.t less more
0 #!perl
1
2 use strict;
3 use warnings;
4
5 use Test::More;
6
7 eval 'use Test::Portability::Files';
8 plan skip_all => 'Test::Portability::Files required for testing portability'
9 if $@;
10 options(test_one_dot => 0);
11 run_tests();
+0
-22
xt/release/test-version.t less more
0 use strict;
1 use warnings;
2 use Test::More;
3
4 # generated by Dist::Zilla::Plugin::Test::Version 0.002004
5 BEGIN { eval "use Test::Version; 1;" or die $@; }
6
7 my @imports = ( 'version_all_ok' );
8
9 my $params = {
10 is_strict => 0,
11 has_version => 1,
12 };
13
14 push @imports, $params
15 if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
16
17
18 Test::Version->import(@imports);
19
20 version_all_ok;
21 done_testing;