From 6539e1597d9860954f232512436b7bc2c13d13cf Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 16 2020 14:50:33 +0000 Subject: perl-Module-Metadata-1.000033 base --- diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..a22a29f --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,100 @@ + +CONTRIBUTING + +Thank you for considering contributing to this distribution. This file +contains instructions that will help you work with the source code. + +PLEASE NOTE that if you have any questions or difficulties, you can reach the +maintainer(s) through the bug queue described later in this document +(preferred), or by emailing the releaser directly. You are not required to +follow any of the steps in this document to submit a patch or bug report; +these are just recommendations, intended to help you (and help us help you +faster). + +The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). +This means than many of the usual files you might expect are not in the +repository, but are generated at release time (e.g. Makefile.PL). + +However, you can run tests directly using the 'prove' tool: + + $ prove -l + $ prove -lv t/some_test_file.t + $ prove -lvr t/ + +In most cases, 'prove' is entirely sufficent for you to test any +patches you have. + +You may need to satisfy some dependencies. The easiest way to satisfy +dependencies is to install the last release -- this is available at +https://metacpan.org/release/Module-Metadata + +If you use cpanminus, you can do it without downloading the tarball first: + + $ cpanm --reinstall --installdeps --with-recommends Module::Metadata + +Dist::Zilla is a very powerful authoring tool, but requires a number of +author-specific plugins. If you would like to use it for contributing, +install it from CPAN, then run one of the following commands, depending on +your CPAN client: + + $ cpan `dzil authordeps --missing` +or + $ dzil authordeps --missing | cpanm + +You should then also install any additional requirements not needed by the +dzil build but may be needed by tests or other development: + + $ cpan `dzil listdeps --author --missing` +or + $ dzil listdeps --author --missing | cpanm + +Or, you can use the 'dzil stale' command to install all requirements at once: + + $ cpan Dist::Zilla::App::Command::stale + $ cpan `dzil stale --all` +or + $ cpanm Dist::Zilla::App::Command::stale + $ dzil stale --all | cpanm + +You can also do this via cpanm directly: + + $ cpanm --reinstall --installdeps --with-develop --with-recommends Module::Metadata + +Once installed, here are some dzil commands you might try: + + $ dzil build + $ dzil test + $ dzil test --release + $ dzil xtest + $ dzil listdeps --json + $ dzil build --notgz + +You can learn more about Dist::Zilla at http://dzil.org/. + +The code for this distribution is hosted at GitHub. The repository is: +https://github.com/Perl-Toolchain-Gang/Module-Metadata +You can submit code changes by forking the repository, pushing your code +changes to your clone, and then submitting a pull request. Detailed +instructions for doing that is available here: + +https://help.github.com/articles/creating-a-pull-request + +If you have found a bug, but do not have an accompanying patch to fix it, you +can submit an issue report here: +https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Metadata +or via email: bug-Module-Metadata@rt.cpan.org + +There is also a mailing list available for users of this distribution, at +http://lists.perl.org/list/cpan-workers.html +There is also an irc channel available for users of this distribution, at +irc://irc.perl.org/#toolchain + +If you send me a patch or pull request, your name and email address will be +included in the documentation as a contributor (using the attribution on the +commit or patch), unless you specifically request for it not to be. If you +wish to be listed under a different name or address, you should submit a pull +request to the .mailmap file to contain the correct mapping. + + +This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.012 from a +template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.117. diff --git a/Changes b/Changes new file mode 100644 index 0000000..969780c --- /dev/null +++ b/Changes @@ -0,0 +1,163 @@ +Revision history for Module-Metadata + +1.000033 2016-07-24 23:32:58Z + - fix file operation in tests for VMS + +1.000032 2016-04-23 22:36:24Z (TRIAL RELEASE) + - use a more strict matching heuristic when attempting to infer the + "primary" module name in a parsed .pm file + - only report "main" as the module name if code was seen outside another + namespace, fixing bad results for pod files (RT#107525) + +1.000031 2015-11-24 03:57:55Z (TRIAL RELEASE) + - be less noisy on failure when building as part of perl core (see perl + RT#126685) + +1.000030 2015-11-20 03:03:24Z (TRIAL RELEASE) + - temp dirs cleaned up during tests (Steve Hay) + - more accurately mark tests as TODO, so as to have a quieter and less + confusing test run without passing TODO tests. This release is primarily + intended for the perl 5.23.5 release. + +1.000029 2015-09-11 16:25:43Z (TRIAL RELEASE) + - fix missing "use" statement in refactored test helper (only affected older + perls, due to other module interactions) + +1.000028 2015-09-11 04:24:39Z (TRIAL RELEASE) + - refactored and expanded test cases + - fixed a $VERSION extraction issue on perl 5.6.2 (RT#105978, PR#17) + - fix the detection of package Foo when $Foo::VERSION is set (RT#85961) + +1.000027 2015-04-11 00:21:26Z + - work around issues with an unconfigured Log::Contextual (Kent Fredric) + - allow tests to pass in a perl with no taint support (James Raspass) + +1.000026 2015-01-17 19:22:34Z + - patched tests to be less noisy in blead builds (Dave Mitchell, RT#101491) + +1.000025 2015-01-04 18:56:00Z + - evaluate version assignment in a clean environment, to fix assignment in a + block (RT#101095) + +1.000024 2014-06-03 01:52:46Z + - fix inaccurate prerequisite declaration on Test::More (in 1.000023) + +1.000023 2014-06-02 02:37:17Z + - support installations on older perls with an ExtUtils::MakeMaker earlier + than 6.63_03 + +1.000022 - 2014-04-29 + - work around change in comparison behaviour in Test::More 0.95_01 by being + more explicit with our tests - now explicitly checking the string form of + the extracted version, rather than the entire version object + - ensure the extracted version is returned as a version object in all cases + (RT#87782, Randy Stauner) + +1.000021 - 2014-04-29 + - fix use of newer interface from File::Path, to avoid another prereq on + older perls (Graham Knop, PR#7) + - fixed all out of date prereq declarations + +1.000020 - 2014-04-27 + - new is_indexable() object method (ether, RT#84357) + - eliminated dependency on IO::File (and by virtue, XS) - thanks, leont! + - removed cruft in test infrastructure left behind from separation from + Module::Build (ether) + - repository moved to https://github.com/Perl-Toolchain-Gang/Module-Metadata + - .pm file is now wholly ascii, for nicer fatpacking (RT#95086) + - some code micro-optimizations (Olivier Mengué, PR#4) + +1.000019 - 2013-10-06 + - warnings now disabled inside during the evaluation of generated version + sub (BinGOs, RT#89282) + +1.000018 - 2013-09-11 + - re-release of detainting fix without unstated non-core test dependencies + +1.000017 - 2013-09-10 + - detaint version, if needed (RT#88576, Chris Williams) + +1.000016 - 2013-08-21 + - Re-release to fix prereqs and other metadata + +1.000015 - 2013-08-21 + - Change wording about safety/security to satisfy CVE-2013-1437 + +1.000014 - 2013-05-09 + - Remove "now installs to 'site' for perl 5.12+" from last version + +1.000013 - 2013-05-08 + - Fix reliance on recent Test::Builder + - Make tests perl 5.6 compatible + - now installs to 'site' for perl 5.12+, as per p5p recommendation + +1.000012 - 2013-05-04 + - improved package detection heuristics (thanks, Edward Zborowski!) + - fix ->contains_pod (RT#84932, Tokuhiro Matsuno) + - fix detection of pod after __END__ (RT79656, Tokuhiro Matsuno) + +1.000011 - 2012-08-16 + - LEONT++ hasn't found any issues with my changes; mark it done (or at + least ready for smoking). (APEIRON) + +1.000010_003 - 2012-08-16 01:00:00 + - Remove other spurious message (APEIRON) + +1.000010_002 - 2012-08-15 20:15:00 + - APEIRON is an idiot (APEIRON) + +1.000010_001 - 2012-08-15 20:00:00 + - Dev release to test removing a warning about modules not using the + 'eval $VERSION' syntax which causes lots of spew. (APEIRON) + +1.000010 - 2012-07-29 19:30:00 + - Performance improvement: the creation of a Module::Metadata object + for a typical module file has been sped up by about 40% (VPIT) + - Fix t/metadata.t failure under Cygwin (JDHEDDEN) + - Portability fix-ups for new_from_module() and test failures on VMS (CBERRY) + +1.000009 - 2012-02-08 12:00:00 + - API of 'provides' changed to require a 'version' argument to future + proof the function against CPAN Meta Spec changes (DAGOLDEN) + - Fatal errors now use 'croak' instead of 'die'; Carp added as + prerequisite (DAGOLDEN) + +1.000008 - 2012-02-07 22:30:00 + - Adds 'provides' method to generate a CPAN META provides data structure + correctly; use of package_versions_from_directory is discouraged (DAGOLDEN) + +1.000007 - 2011-09-07 12:00:00 + - Apply VMS fixes backported from blead (Craig A. Berry) + +1.000006 - 2011-08-29 04:00:00 + - Support PACKAGE BLOCK syntax (VPIT) + +1.000005 - 2011-08-02 09:45:00 + - Localize $package::VERSION during version discovery (MIYAGAWA) + - Fix references to Module::Build::ModuleInfo [RT #66133] (DAGOLDEN) + - Added 'new_from_handle()' method [RT #68875] (DAGOLDEN) + - Improved documentation (SYNOPSIS, broke out class/object method, and + other minor edits) (DAGOLDEN) + +1.000004 - 2011-02-03 07:55:00 + - Fix broken metadata.t when @INC has relative paths (JJORE) + +1.000003 - 2011-01-06 21:35:00 + - Pod cleanup (DAGOLDEN) + +1.000002 - 2010-12-10 12:00:00 + - Remove Module::Metadata::Version and depend directly on version.pm + (DAGOLDEN) + - Munge versions that fail even "lax" version number rules to try + to return something sensible (DAGOLDEN) + +1.000001 - 2010-07-09 00:52:37 + - fix build code to prevent Author.PL being mistakenly run during make + and add some extra author-side tools (MSTROUT) + +1.000000 - 2010-07-07 + - Initial release (MSTROUT) + - Code extracted from Module::Build + Module::Build::Version (MSTROUT) + - Tests extracted from Module::Build (DAGOLDEN) + - POD coverage (MSTROUT) + - Use of Log::Contextual when loaded with fallback to warn() (MSTROUT) diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..466c7dc --- /dev/null +++ b/INSTALL @@ -0,0 +1,43 @@ +This is the Perl distribution Module-Metadata. + +Installing Module-Metadata is straightforward. + +## Installation with cpanm + +If you have cpanm, you only need one line: + + % cpanm Module::Metadata + +If it does not have permission to install modules to the current perl, cpanm +will automatically set up and install to a local::lib in your home directory. +See the local::lib documentation (https://metacpan.org/pod/local::lib) for +details on enabling it in your environment. + +## Installing with the CPAN shell + +Alternatively, if your CPAN shell is set up, you should just be able to do: + + % cpan Module::Metadata + +## Manual installation + +As a last resort, you can manually install it. Download the tarball, untar it, +then build it: + + % perl Makefile.PL + % make && make test + +Then install it: + + % make install + +If your perl is system-managed, you can create a local::lib in your home +directory to install modules to. For details, see the local::lib documentation: +https://metacpan.org/pod/local::lib + +## Documentation + +Module-Metadata documentation is available as POD. +You can run perldoc from a shell to read the documentation: + + % perldoc Module::Metadata diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..82f76a8 --- /dev/null +++ b/LICENCE @@ -0,0 +1,379 @@ +This software is copyright (c) 2010 by Perl Toolchain Gang. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +Terms of the Perl programming language system itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2010 by Perl Toolchain Gang. + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2010 by Perl Toolchain Gang. + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..963463a --- /dev/null +++ b/MANIFEST @@ -0,0 +1,44 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.006. +CONTRIBUTING +Changes +INSTALL +LICENCE +MANIFEST +META.json +META.yml +Makefile.PL +README +corpus/BOMTest/UTF16BE.pm +corpus/BOMTest/UTF16LE.pm +corpus/BOMTest/UTF8.pm +dist.ini +lib/Module/Metadata.pm +t/00-report-prereqs.dd +t/00-report-prereqs.t +t/contains_pod.t +t/encoding.t +t/endpod.t +t/extract-package.t +t/extract-version.t +t/lib/0_1/Foo.pm +t/lib/0_2/Foo.pm +t/lib/ENDPOD.pm +t/lib/GeneratePackage.pm +t/metadata.t +t/taint.t +t/version.t +weaver.ini +xt/author/00-compile.t +xt/author/compat_lc.t +xt/author/eol.t +xt/author/kwalitee.t +xt/author/mojibake.t +xt/author/no-tabs.t +xt/author/pod-coverage.t +xt/author/pod-no404s.t +xt/author/pod-syntax.t +xt/author/portability.t +xt/release/changes_has_content.t +xt/release/cpan-changes.t +xt/release/distmeta.t +xt/release/minimum-version.t diff --git a/META.json b/META.json new file mode 100644 index 0000000..dee625a --- /dev/null +++ b/META.json @@ -0,0 +1,1191 @@ +{ + "abstract" : "Gather package and POD information from perl module files", + "author" : [ + "Ken Williams ", + "Randy W. Sims " + ], + "dynamic_config" : 1, + "generated_by" : "Dist::Zilla version 6.006, CPAN::Meta::Converter version 2.150009", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "Module-Metadata", + "no_index" : { + "directory" : [ + "corpus", + "t", + "xt" + ] + }, + "prereqs" : { + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0", + "perl" : "5.006" + } + }, + "develop" : { + "recommends" : { + "Dist::Zilla::PluginBundle::Author::ETHER" : "0.117" + }, + "requires" : { + "Dist::Zilla" : "5", + "Dist::Zilla::Plugin::Authority" : "1.009", + "Dist::Zilla::Plugin::AutoMetaResources" : "0", + "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", + "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", + "Dist::Zilla::Plugin::CheckIssues" : "0", + "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0", + "Dist::Zilla::Plugin::CheckSelfDependency" : "0", + "Dist::Zilla::Plugin::CheckStrictVersion" : "0", + "Dist::Zilla::Plugin::ConfirmRelease" : "0", + "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", + "Dist::Zilla::Plugin::DynamicPrereqs" : "0.016", + "Dist::Zilla::Plugin::Encoding" : "0", + "Dist::Zilla::Plugin::FileFinder::ByName" : "0", + "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", + "Dist::Zilla::Plugin::Git::Check" : "0", + "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", + "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", + "Dist::Zilla::Plugin::Git::Commit" : "2.020", + "Dist::Zilla::Plugin::Git::Contributors" : "0.004", + "Dist::Zilla::Plugin::Git::Describe" : "0.004", + "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", + "Dist::Zilla::Plugin::Git::Push" : "0", + "Dist::Zilla::Plugin::Git::Remote::Check" : "0", + "Dist::Zilla::Plugin::Git::Tag" : "0", + "Dist::Zilla::Plugin::GitHub::Update" : "0.40", + "Dist::Zilla::Plugin::GithubMeta" : "0.54", + "Dist::Zilla::Plugin::InstallGuide" : "1.200005", + "Dist::Zilla::Plugin::Keywords" : "0.004", + "Dist::Zilla::Plugin::License" : "5.038", + "Dist::Zilla::Plugin::MakeMaker" : "0", + "Dist::Zilla::Plugin::Manifest" : "0", + "Dist::Zilla::Plugin::MetaConfig" : "0", + "Dist::Zilla::Plugin::MetaJSON" : "0", + "Dist::Zilla::Plugin::MetaNoIndex" : "0", + "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", + "Dist::Zilla::Plugin::MetaResources" : "0", + "Dist::Zilla::Plugin::MetaTests" : "0", + "Dist::Zilla::Plugin::MetaYAML" : "0", + "Dist::Zilla::Plugin::MinimumPerl" : "1.006", + "Dist::Zilla::Plugin::MojibakeTests" : "0.8", + "Dist::Zilla::Plugin::NextRelease" : "5.033", + "Dist::Zilla::Plugin::OnlyCorePrereqs" : "0.014", + "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", + "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", + "Dist::Zilla::Plugin::PodWeaver" : "4.005", + "Dist::Zilla::Plugin::Prereqs" : "0", + "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", + "Dist::Zilla::Plugin::PromptIfStale" : "0", + "Dist::Zilla::Plugin::Readme" : "0", + "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", + "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.004", + "Dist::Zilla::Plugin::Run::AfterBuild" : "0.038", + "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", + "Dist::Zilla::Plugin::RunExtraTests" : "0.024", + "Dist::Zilla::Plugin::StaticInstall" : "0.005", + "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.012", + "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", + "Dist::Zilla::Plugin::Test::Compile" : "2.039", + "Dist::Zilla::Plugin::Test::EOL" : "0.17", + "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", + "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000003", + "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", + "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.003", + "Dist::Zilla::Plugin::Test::Portability" : "2.000007", + "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.022", + "Dist::Zilla::Plugin::TestRelease" : "0", + "Dist::Zilla::Plugin::UploadToCPAN" : "0", + "Dist::Zilla::PluginBundle::Author::ETHER" : "0.094", + "File::Spec" : "0", + "IO::Handle" : "0", + "IPC::Open3" : "0", + "Pod::Coverage::TrustPod" : "0", + "Pod::Weaver::Section::AllowOverride" : "0", + "Software::License::Perl_5" : "0", + "Test::Builder" : "0.90", + "Test::CPAN::Changes" : "0.19", + "Test::CPAN::Meta" : "0", + "Test::EOL" : "0", + "Test::Kwalitee" : "1.21", + "Test::Mojibake" : "0", + "Test::More" : "0.96", + "Test::NoTabs" : "0", + "Test::Pod" : "1.41", + "Test::Pod::Coverage" : "1.08", + "Test::Pod::No404s" : "0", + "Test::Portability::Files" : "0", + "blib" : "1.01", + "perl" : "5.006" + } + }, + "runtime" : { + "requires" : { + "Carp" : "0", + "Fcntl" : "0", + "File::Find" : "0", + "File::Spec" : "0", + "perl" : "5.006", + "strict" : "0", + "version" : "0.87", + "warnings" : "0" + } + }, + "test" : { + "recommends" : { + "CPAN::Meta" : "2.120900" + }, + "requires" : { + "Cwd" : "0", + "Exporter" : "0", + "ExtUtils::MakeMaker" : "0", + "File::Basename" : "0", + "File::Path" : "0", + "File::Spec" : "0", + "File::Temp" : "0", + "IO::File" : "0", + "Test::More" : "0.82", + "base" : "0", + "lib" : "0", + "perl" : "5.006" + } + } + }, + "provides" : { + "Module::Metadata" : { + "file" : "lib/Module/Metadata.pm", + "version" : "1.000033" + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "mailto" : "bug-Module-Metadata@rt.cpan.org", + "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Metadata" + }, + "homepage" : "https://github.com/Perl-Toolchain-Gang/Module-Metadata", + "repository" : { + "type" : "git", + "url" : "https://github.com/Perl-Toolchain-Gang/Module-Metadata.git", + "web" : "https://github.com/Perl-Toolchain-Gang/Module-Metadata" + }, + "x_IRC" : "irc://irc.perl.org/#toolchain", + "x_MailingList" : "http://lists.perl.org/list/cpan-workers.html" + }, + "version" : "1.000033", + "x_Dist_Zilla" : { + "perl" : { + "version" : 5.025003 + }, + "plugins" : [ + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "develop", + "type" : "requires" + } + }, + "name" : "@Author::ETHER/bundle_plugins", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", + "config" : { + "Dist::Zilla::Plugin::RewriteVersion" : { + "add_tarball_name" : 0, + "finders" : [ + ":ExecFiles", + ":InstallModules" + ], + "global" : 1, + "skip_version_provider" : 0 + }, + "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} + }, + "name" : "@Author::ETHER/RewriteVersion::Transitional", + "version" : "0.007" + }, + { + "class" : "Dist::Zilla::Plugin::PromptIfStale", + "config" : { + "Dist::Zilla::Plugin::PromptIfStale" : { + "check_all_plugins" : 0, + "check_all_prereqs" : 0, + "modules" : [ + "Dist::Zilla::PluginBundle::Author::ETHER" + ], + "phase" : "build", + "run_under_travis" : 0, + "skip" : [] + } + }, + "name" : "@Author::ETHER/stale modules, build", + "version" : "0.051" + }, + { + "class" : "Dist::Zilla::Plugin::PromptIfStale", + "config" : { + "Dist::Zilla::Plugin::PromptIfStale" : { + "check_all_plugins" : 1, + "check_all_prereqs" : 1, + "modules" : [], + "phase" : "release", + "run_under_travis" : 0, + "skip" : [] + } + }, + "name" : "@Author::ETHER/stale modules, release", + "version" : "0.051" + }, + { + "class" : "Dist::Zilla::Plugin::FileFinder::ByName", + "name" : "@Author::ETHER/Examples", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Git::GatherDir", + "config" : { + "Dist::Zilla::Plugin::GatherDir" : { + "exclude_filename" : [ + "CONTRIBUTING", + "INSTALL", + "LICENCE", + "README.pod" + ], + "exclude_match" : [], + "follow_symlinks" : 0, + "include_dotfiles" : 0, + "prefix" : "", + "prune_directory" : [], + "root" : "." + }, + "Dist::Zilla::Plugin::Git::GatherDir" : { + "include_untracked" : 0 + } + }, + "name" : "@Author::ETHER/Git::GatherDir", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::MetaYAML", + "name" : "@Author::ETHER/MetaYAML", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::MetaJSON", + "name" : "@Author::ETHER/MetaJSON", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Readme", + "name" : "@Author::ETHER/Readme", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Manifest", + "name" : "@Author::ETHER/Manifest", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::License", + "name" : "@Author::ETHER/License", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", + "config" : { + "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { + "destination_filename" : "CONTRIBUTING", + "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", + "encoding" : "UTF-8", + "has_xs" : 0, + "location" : "build", + "source_filename" : "CONTRIBUTING" + }, + "Dist::Zilla::Role::RepoFileInjector" : { + "allow_overwrite" : 1, + "repo_root" : ".", + "version" : "0.007" + } + }, + "name" : "@Author::ETHER/generate CONTRIBUTING", + "version" : "0.012" + }, + { + "class" : "Dist::Zilla::Plugin::InstallGuide", + "name" : "@Author::ETHER/InstallGuide", + "version" : "1.200007" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Compile", + "config" : { + "Dist::Zilla::Plugin::Test::Compile" : { + "bail_out_on_fail" : 1, + "fail_on_warning" : "author", + "fake_home" : 0, + "filename" : "xt/author/00-compile.t", + "module_finder" : [ + ":InstallModules" + ], + "needs_display" : 0, + "phase" : "develop", + "script_finder" : [ + ":PerlExecFiles", + "@Author::ETHER/Examples" + ], + "skips" : [] + } + }, + "name" : "@Author::ETHER/Test::Compile", + "version" : "2.054" + }, + { + "class" : "Dist::Zilla::Plugin::Test::NoTabs", + "config" : { + "Dist::Zilla::Plugin::Test::NoTabs" : { + "filename" : "xt/author/no-tabs.t", + "finder" : [ + ":InstallModules", + ":ExecFiles", + "@Author::ETHER/Examples", + ":TestFiles", + ":ExtraTestFiles" + ] + } + }, + "name" : "@Author::ETHER/Test::NoTabs", + "version" : "0.15" + }, + { + "class" : "Dist::Zilla::Plugin::Test::EOL", + "config" : { + "Dist::Zilla::Plugin::Test::EOL" : { + "filename" : "xt/author/eol.t", + "finder" : [ + ":ExecFiles", + ":ExtraTestFiles", + ":InstallModules", + ":TestFiles", + "@Author::ETHER/Examples" + ], + "trailing_whitespace" : 1 + } + }, + "name" : "@Author::ETHER/Test::EOL", + "version" : "0.19" + }, + { + "class" : "Dist::Zilla::Plugin::MetaTests", + "name" : "@Author::ETHER/MetaTests", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", + "config" : { + "Dist::Zilla::Plugin::Test::CPAN::Changes" : { + "changelog" : "Changes" + } + }, + "name" : "@Author::ETHER/Test::CPAN::Changes", + "version" : "0.012" + }, + { + "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", + "name" : "@Author::ETHER/Test::ChangesHasContent", + "version" : "0.010" + }, + { + "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", + "name" : "@Author::ETHER/Test::MinimumVersion", + "version" : "2.000006" + }, + { + "class" : "Dist::Zilla::Plugin::PodSyntaxTests", + "name" : "@Author::ETHER/PodSyntaxTests", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::PodCoverageTests", + "name" : "@Author::ETHER/PodCoverageTests", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", + "name" : "@Author::ETHER/Test::Pod::No404s", + "version" : "1.003" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Kwalitee", + "config" : { + "Dist::Zilla::Plugin::Test::Kwalitee" : { + "filename" : "xt/author/kwalitee.t", + "skiptest" : [] + } + }, + "name" : "@Author::ETHER/Test::Kwalitee", + "version" : "2.12" + }, + { + "class" : "Dist::Zilla::Plugin::MojibakeTests", + "name" : "@Author::ETHER/MojibakeTests", + "version" : "0.8" + }, + { + "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", + "name" : "@Author::ETHER/Test::ReportPrereqs", + "version" : "0.025" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Portability", + "name" : "@Author::ETHER/Test::Portability", + "version" : "2.000007" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Describe", + "name" : "@Author::ETHER/Git::Describe", + "version" : "0.007" + }, + { + "class" : "Dist::Zilla::Plugin::PodWeaver", + "config" : { + "Dist::Zilla::Plugin::PodWeaver" : { + "finder" : [ + ":InstallModules", + ":ExecFiles" + ], + "plugins" : [ + { + "class" : "Pod::Weaver::Plugin::EnsurePod5", + "name" : "@Author::ETHER/EnsurePod5", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Plugin::H1Nester", + "name" : "@Author::ETHER/H1Nester", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Plugin::SingleEncoding", + "name" : "@Author::ETHER/SingleEncoding", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Plugin::Transformer", + "name" : "@Author::ETHER/List", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Plugin::Transformer", + "name" : "@Author::ETHER/Verbatim", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Author::ETHER/header", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Name", + "name" : "@Author::ETHER/Name", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Version", + "name" : "@Author::ETHER/Version", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Author::ETHER/prelude", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "SYNOPSIS", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "DESCRIPTION", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "OVERVIEW", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "ATTRIBUTES", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "METHODS", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "FUNCTIONS", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "TYPES", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Leftovers", + "name" : "@Author::ETHER/Leftovers", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Author::ETHER/postlude", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::GenerateSection", + "name" : "@Author::ETHER/generate SUPPORT", + "version" : "1.02" + }, + { + "class" : "Pod::Weaver::Section::AllowOverride", + "name" : "@Author::ETHER/allow override SUPPORT", + "version" : "0.05" + }, + { + "class" : "Pod::Weaver::Section::Authors", + "name" : "@Author::ETHER/Authors", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Contributors", + "name" : "@Author::ETHER/Contributors", + "version" : "0.009" + }, + { + "class" : "Pod::Weaver::Section::Legal", + "name" : "@Author::ETHER/Legal", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Author::ETHER/footer", + "version" : "4.013" + }, + { + "class" : "Pod::Weaver::Section::AllowOverride", + "name" : "OverrideAuthors", + "version" : "0.05" + }, + { + "class" : "Pod::Weaver::Section::AllowOverride", + "name" : "OverrideLegal", + "version" : "0.05" + } + ] + } + }, + "name" : "@Author::ETHER/PodWeaver", + "version" : "4.008" + }, + { + "class" : "Dist::Zilla::Plugin::GithubMeta", + "name" : "@Author::ETHER/GithubMeta", + "version" : "0.54" + }, + { + "class" : "Dist::Zilla::Plugin::AutoMetaResources", + "name" : "@Author::ETHER/AutoMetaResources", + "version" : "1.21" + }, + { + "class" : "Dist::Zilla::Plugin::Authority", + "name" : "@Author::ETHER/Authority", + "version" : "1.009" + }, + { + "class" : "Dist::Zilla::Plugin::MetaNoIndex", + "name" : "@Author::ETHER/MetaNoIndex", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::MetaProvides::Package", + "config" : { + "Dist::Zilla::Plugin::MetaProvides::Package" : { + "finder" : [ + ":InstallModules" + ], + "finder_objects" : [ + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":InstallModules", + "version" : "6.006" + } + ] + }, + "Dist::Zilla::Role::MetaProvider::Provider" : { + "Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.001011", + "inherit_missing" : 0, + "inherit_version" : 0, + "meta_noindex" : 1 + } + }, + "name" : "@Author::ETHER/MetaProvides::Package", + "version" : "2.003002" + }, + { + "class" : "Dist::Zilla::Plugin::MetaConfig", + "name" : "@Author::ETHER/MetaConfig", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Keywords", + "config" : { + "Dist::Zilla::Plugin::Keywords" : { + "keywords" : [] + } + }, + "name" : "@Author::ETHER/Keywords", + "version" : "0.007" + }, + { + "class" : "Dist::Zilla::Plugin::AutoPrereqs", + "name" : "@Author::ETHER/AutoPrereqs", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", + "name" : "@Author::ETHER/Prereqs::AuthorDeps", + "version" : "0.006" + }, + { + "class" : "Dist::Zilla::Plugin::MinimumPerl", + "name" : "@Author::ETHER/MinimumPerl", + "version" : "1.006" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "develop", + "type" : "recommends" + } + }, + "name" : "@Author::ETHER/pluginbundle_version", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::MakeMaker", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : 9 + } + }, + "name" : "@Author::ETHER/MakeMaker", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Contributors", + "config" : { + "Dist::Zilla::Plugin::Git::Contributors" : { + "include_authors" : 0, + "include_releaser" : 1, + "order_by" : "commits", + "paths" : [ + "." + ] + } + }, + "name" : "@Author::ETHER/Git::Contributors", + "version" : "0.023" + }, + { + "class" : "Dist::Zilla::Plugin::StaticInstall", + "config" : { + "Dist::Zilla::Plugin::StaticInstall" : { + "dry_run" : 0, + "mode" : "off" + } + }, + "name" : "@Author::ETHER/StaticInstall", + "version" : "0.009" + }, + { + "class" : "Dist::Zilla::Plugin::RunExtraTests", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : 9 + } + }, + "name" : "@Author::ETHER/RunExtraTests", + "version" : "0.029" + }, + { + "class" : "Dist::Zilla::Plugin::CheckSelfDependency", + "config" : { + "Dist::Zilla::Plugin::CheckSelfDependency" : { + "finder" : [ + ":InstallModules" + ] + }, + "Dist::Zilla::Role::ModuleMetadata" : { + "Module::Metadata" : "1.000032", + "version" : "0.004" + } + }, + "name" : "@Author::ETHER/CheckSelfDependency", + "version" : "0.011" + }, + { + "class" : "Dist::Zilla::Plugin::Run::AfterBuild", + "config" : { + "Dist::Zilla::Plugin::Run::Role::Runner" : { + "fatal_errors" : 1, + "quiet" : 1, + "run" : [ + "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" + ] + } + }, + "name" : "@Author::ETHER/.ackrc", + "version" : "0.043" + }, + { + "class" : "Dist::Zilla::Plugin::Run::AfterBuild", + "config" : { + "Dist::Zilla::Plugin::Run::Role::Runner" : { + "eval" : [ + "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" + ], + "fatal_errors" : 1, + "quiet" : 1 + } + }, + "name" : "@Author::ETHER/.latest", + "version" : "0.043" + }, + { + "class" : "Dist::Zilla::Plugin::CheckStrictVersion", + "name" : "@Author::ETHER/CheckStrictVersion", + "version" : "0.001" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Check", + "config" : { + "Dist::Zilla::Plugin::Git::Check" : { + "untracked_files" : "die" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "@Author::ETHER/initial check", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", + "config" : { + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", + "version" : "0.013" + }, + { + "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", + "config" : { + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", + "version" : "0.013" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Remote::Check", + "name" : "@Author::ETHER/Git::Remote::Check", + "version" : "0.1.2" + }, + { + "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", + "name" : "@Author::ETHER/CheckPrereqsIndexed", + "version" : "0.018" + }, + { + "class" : "Dist::Zilla::Plugin::TestRelease", + "name" : "@Author::ETHER/TestRelease", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Check", + "config" : { + "Dist::Zilla::Plugin::Git::Check" : { + "untracked_files" : "die" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "@Author::ETHER/after tests", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::CheckIssues", + "name" : "@Author::ETHER/CheckIssues", + "version" : "0.010" + }, + { + "class" : "Dist::Zilla::Plugin::UploadToCPAN", + "name" : "@Author::ETHER/UploadToCPAN", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", + "config" : { + "Dist::Zilla::Plugin::CopyFilesFromRelease" : { + "filename" : [ + "CONTRIBUTING", + "Changes", + "INSTALL", + "LICENCE", + "LICENSE", + "ppport.h" + ], + "match" : [] + } + }, + "name" : "@Author::ETHER/CopyFilesFromRelease", + "version" : "0.006" + }, + { + "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", + "config" : { + "Dist::Zilla::Role::FileWatcher" : { + "version" : "0.006" + } + }, + "name" : "@Author::ETHER/ReadmeAnyFromPod", + "version" : "0.161170" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Commit", + "config" : { + "Dist::Zilla::Plugin::Git::Commit" : { + "add_files_in" : [ + "." + ], + "commit_msg" : "%N-%v%t%n%n%c" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "CONTRIBUTING", + "Changes", + "INSTALL", + "LICENCE", + "README.pod" + ], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + }, + "Dist::Zilla::Role::Git::StringFormatter" : { + "time_zone" : "local" + } + }, + "name" : "@Author::ETHER/release snapshot", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Tag", + "config" : { + "Dist::Zilla::Plugin::Git::Tag" : { + "branch" : null, + "changelog" : "Changes", + "signed" : 0, + "tag" : "v1.000033", + "tag_format" : "v%v", + "tag_message" : "v%v%t" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + }, + "Dist::Zilla::Role::Git::StringFormatter" : { + "time_zone" : "local" + } + }, + "name" : "@Author::ETHER/Git::Tag", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::GitHub::Update", + "config" : { + "Dist::Zilla::Plugin::GitHub::Update" : { + "metacpan" : 1 + } + }, + "name" : "@Author::ETHER/GitHub::Update", + "version" : "0.42" + }, + { + "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", + "config" : { + "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { + "finders" : [ + ":ExecFiles", + ":InstallModules" + ], + "global" : 1, + "munge_makefile_pl" : 1 + }, + "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} + }, + "name" : "@Author::ETHER/BumpVersionAfterRelease::Transitional", + "version" : "0.007" + }, + { + "class" : "Dist::Zilla::Plugin::NextRelease", + "name" : "@Author::ETHER/NextRelease", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Commit", + "config" : { + "Dist::Zilla::Plugin::Git::Commit" : { + "add_files_in" : [], + "commit_msg" : "increment $VERSION after %v release" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "Changes" + ], + "allow_dirty_match" : [ + "(?^:^lib/.*\\.pm$)" + ], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + }, + "Dist::Zilla::Role::Git::StringFormatter" : { + "time_zone" : "local" + } + }, + "name" : "@Author::ETHER/post-release commit", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Push", + "config" : { + "Dist::Zilla::Plugin::Git::Push" : { + "push_to" : [ + "origin" + ], + "remotes_must_exist" : 1 + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "@Author::ETHER/Git::Push", + "version" : "2.039" + }, + { + "class" : "Dist::Zilla::Plugin::Run::AfterRelease", + "config" : { + "Dist::Zilla::Plugin::Run::Role::Runner" : { + "fatal_errors" : 0, + "quiet" : 0, + "run" : [ + "REDACTED" + ] + } + }, + "name" : "@Author::ETHER/install release", + "version" : "0.043" + }, + { + "class" : "Dist::Zilla::Plugin::Run::AfterRelease", + "config" : { + "Dist::Zilla::Plugin::Run::Role::Runner" : { + "eval" : [ + "print \"release complete!\\xa\"" + ], + "fatal_errors" : 1, + "quiet" : 1 + } + }, + "name" : "@Author::ETHER/release complete", + "version" : "0.043" + }, + { + "class" : "Dist::Zilla::Plugin::ConfirmRelease", + "name" : "@Author::ETHER/ConfirmRelease", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::Encoding", + "name" : "Encoding", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::MetaResources", + "name" : "MetaResources", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::OnlyCorePrereqs", + "config" : { + "Dist::Zilla::Plugin::OnlyCorePrereqs" : { + "also_disallow" : [], + "check_dual_life_versions" : "0", + "deprecated_ok" : 0, + "phases" : [ + "configure", + "build", + "runtime", + "test" + ], + "skips" : [], + "starting_version" : "to be determined from perl prereq" + } + }, + "name" : "OnlyCorePrereqs", + "version" : "0.024" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "develop", + "type" : "requires" + } + }, + "name" : "DevelopRequires", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::DynamicPrereqs", + "config" : { + "Dist::Zilla::Role::ModuleMetadata" : { + "Module::Metadata" : "1.000032", + "version" : "0.004" + } + }, + "name" : "DynamicPrereqs", + "version" : "0.031" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":InstallModules", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":IncModules", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":TestFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ExtraTestFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ExecFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":PerlExecFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ShareFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":MainModule", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":AllFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":NoFiles", + "version" : "6.006" + }, + { + "class" : "Dist::Zilla::Plugin::VerifyPhases", + "name" : "@Author::ETHER/PHASE VERIFICATION", + "version" : "0.014" + } + ], + "zilla" : { + "class" : "Dist::Zilla::Dist::Builder", + "config" : { + "is_trial" : 0 + }, + "version" : "6.006" + } + }, + "x_authority" : "cpan:MSTROUT", + "x_contributors" : [ + "Karen Etheridge ", + "David Golden ", + "Vincent Pit ", + "Matt S Trout ", + "Chris Nehren ", + "Graham Knop ", + "Olivier Mengu\u00e9 ", + "Tomas Doran ", + "Tatsuhiko Miyagawa ", + "tokuhirom ", + "Kent Fredric ", + "Peter Rabbitson ", + "Steve Hay ", + "Jerry D. Hedden ", + "Craig A. Berry ", + "Craig A. Berry ", + "David Mitchell ", + "David Steinbrunner ", + "Edward Zborowski ", + "Gareth Harper ", + "James Raspass ", + "Chris 'BinGOs' Williams ", + "Josh Jore " + ], + "x_serialization_backend" : "Cpanel::JSON::XS version 3.0217", + "x_static_install" : 0 +} + diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..0ad4a1d --- /dev/null +++ b/META.yml @@ -0,0 +1,824 @@ +--- +abstract: 'Gather package and POD information from perl module files' +author: + - 'Ken Williams ' + - 'Randy W. Sims ' +build_requires: + Cwd: '0' + Exporter: '0' + ExtUtils::MakeMaker: '0' + File::Basename: '0' + File::Path: '0' + File::Spec: '0' + File::Temp: '0' + IO::File: '0' + Test::More: '0.82' + base: '0' + lib: '0' + perl: '5.006' +configure_requires: + ExtUtils::MakeMaker: '0' + perl: '5.006' +dynamic_config: 1 +generated_by: 'Dist::Zilla version 6.006, CPAN::Meta::Converter version 2.150009' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Module-Metadata +no_index: + directory: + - corpus + - t + - xt +provides: + Module::Metadata: + file: lib/Module/Metadata.pm + version: '1.000033' +requires: + Carp: '0' + Fcntl: '0' + File::Find: '0' + File::Spec: '0' + perl: '5.006' + strict: '0' + version: '0.87' + warnings: '0' +resources: + IRC: irc://irc.perl.org/#toolchain + MailingList: http://lists.perl.org/list/cpan-workers.html + bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Metadata + homepage: https://github.com/Perl-Toolchain-Gang/Module-Metadata + repository: https://github.com/Perl-Toolchain-Gang/Module-Metadata.git +version: '1.000033' +x_Dist_Zilla: + perl: + version: '5.025003' + plugins: + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: develop + type: requires + name: '@Author::ETHER/bundle_plugins' + version: '6.006' + - + class: Dist::Zilla::Plugin::RewriteVersion::Transitional + config: + Dist::Zilla::Plugin::RewriteVersion: + add_tarball_name: 0 + finders: + - ':ExecFiles' + - ':InstallModules' + global: 1 + skip_version_provider: 0 + Dist::Zilla::Plugin::RewriteVersion::Transitional: {} + name: '@Author::ETHER/RewriteVersion::Transitional' + version: '0.007' + - + class: Dist::Zilla::Plugin::PromptIfStale + config: + Dist::Zilla::Plugin::PromptIfStale: + check_all_plugins: 0 + check_all_prereqs: 0 + modules: + - Dist::Zilla::PluginBundle::Author::ETHER + phase: build + run_under_travis: 0 + skip: [] + name: '@Author::ETHER/stale modules, build' + version: '0.051' + - + class: Dist::Zilla::Plugin::PromptIfStale + config: + Dist::Zilla::Plugin::PromptIfStale: + check_all_plugins: 1 + check_all_prereqs: 1 + modules: [] + phase: release + run_under_travis: 0 + skip: [] + name: '@Author::ETHER/stale modules, release' + version: '0.051' + - + class: Dist::Zilla::Plugin::FileFinder::ByName + name: '@Author::ETHER/Examples' + version: '6.006' + - + class: Dist::Zilla::Plugin::Git::GatherDir + config: + Dist::Zilla::Plugin::GatherDir: + exclude_filename: + - CONTRIBUTING + - INSTALL + - LICENCE + - README.pod + exclude_match: [] + follow_symlinks: 0 + include_dotfiles: 0 + prefix: '' + prune_directory: [] + root: . + Dist::Zilla::Plugin::Git::GatherDir: + include_untracked: 0 + name: '@Author::ETHER/Git::GatherDir' + version: '2.039' + - + class: Dist::Zilla::Plugin::MetaYAML + name: '@Author::ETHER/MetaYAML' + version: '6.006' + - + class: Dist::Zilla::Plugin::MetaJSON + name: '@Author::ETHER/MetaJSON' + version: '6.006' + - + class: Dist::Zilla::Plugin::Readme + name: '@Author::ETHER/Readme' + version: '6.006' + - + class: Dist::Zilla::Plugin::Manifest + name: '@Author::ETHER/Manifest' + version: '6.006' + - + class: Dist::Zilla::Plugin::License + name: '@Author::ETHER/License' + version: '6.006' + - + class: Dist::Zilla::Plugin::GenerateFile::FromShareDir + config: + Dist::Zilla::Plugin::GenerateFile::FromShareDir: + destination_filename: CONTRIBUTING + dist: Dist-Zilla-PluginBundle-Author-ETHER + encoding: UTF-8 + has_xs: 0 + location: build + source_filename: CONTRIBUTING + Dist::Zilla::Role::RepoFileInjector: + allow_overwrite: 1 + repo_root: . + version: '0.007' + name: '@Author::ETHER/generate CONTRIBUTING' + version: '0.012' + - + class: Dist::Zilla::Plugin::InstallGuide + name: '@Author::ETHER/InstallGuide' + version: '1.200007' + - + class: Dist::Zilla::Plugin::Test::Compile + config: + Dist::Zilla::Plugin::Test::Compile: + bail_out_on_fail: '1' + fail_on_warning: author + fake_home: 0 + filename: xt/author/00-compile.t + module_finder: + - ':InstallModules' + needs_display: 0 + phase: develop + script_finder: + - ':PerlExecFiles' + - '@Author::ETHER/Examples' + skips: [] + name: '@Author::ETHER/Test::Compile' + version: '2.054' + - + class: Dist::Zilla::Plugin::Test::NoTabs + config: + Dist::Zilla::Plugin::Test::NoTabs: + filename: xt/author/no-tabs.t + finder: + - ':InstallModules' + - ':ExecFiles' + - '@Author::ETHER/Examples' + - ':TestFiles' + - ':ExtraTestFiles' + name: '@Author::ETHER/Test::NoTabs' + version: '0.15' + - + class: Dist::Zilla::Plugin::Test::EOL + config: + Dist::Zilla::Plugin::Test::EOL: + filename: xt/author/eol.t + finder: + - ':ExecFiles' + - ':ExtraTestFiles' + - ':InstallModules' + - ':TestFiles' + - '@Author::ETHER/Examples' + trailing_whitespace: 1 + name: '@Author::ETHER/Test::EOL' + version: '0.19' + - + class: Dist::Zilla::Plugin::MetaTests + name: '@Author::ETHER/MetaTests' + version: '6.006' + - + class: Dist::Zilla::Plugin::Test::CPAN::Changes + config: + Dist::Zilla::Plugin::Test::CPAN::Changes: + changelog: Changes + name: '@Author::ETHER/Test::CPAN::Changes' + version: '0.012' + - + class: Dist::Zilla::Plugin::Test::ChangesHasContent + name: '@Author::ETHER/Test::ChangesHasContent' + version: '0.010' + - + class: Dist::Zilla::Plugin::Test::MinimumVersion + name: '@Author::ETHER/Test::MinimumVersion' + version: '2.000006' + - + class: Dist::Zilla::Plugin::PodSyntaxTests + name: '@Author::ETHER/PodSyntaxTests' + version: '6.006' + - + class: Dist::Zilla::Plugin::PodCoverageTests + name: '@Author::ETHER/PodCoverageTests' + version: '6.006' + - + class: Dist::Zilla::Plugin::Test::Pod::No404s + name: '@Author::ETHER/Test::Pod::No404s' + version: '1.003' + - + class: Dist::Zilla::Plugin::Test::Kwalitee + config: + Dist::Zilla::Plugin::Test::Kwalitee: + filename: xt/author/kwalitee.t + skiptest: [] + name: '@Author::ETHER/Test::Kwalitee' + version: '2.12' + - + class: Dist::Zilla::Plugin::MojibakeTests + name: '@Author::ETHER/MojibakeTests' + version: '0.8' + - + class: Dist::Zilla::Plugin::Test::ReportPrereqs + name: '@Author::ETHER/Test::ReportPrereqs' + version: '0.025' + - + class: Dist::Zilla::Plugin::Test::Portability + name: '@Author::ETHER/Test::Portability' + version: '2.000007' + - + class: Dist::Zilla::Plugin::Git::Describe + name: '@Author::ETHER/Git::Describe' + version: '0.007' + - + class: Dist::Zilla::Plugin::PodWeaver + config: + Dist::Zilla::Plugin::PodWeaver: + finder: + - ':InstallModules' + - ':ExecFiles' + plugins: + - + class: Pod::Weaver::Plugin::EnsurePod5 + name: '@Author::ETHER/EnsurePod5' + version: '4.013' + - + class: Pod::Weaver::Plugin::H1Nester + name: '@Author::ETHER/H1Nester' + version: '4.013' + - + class: Pod::Weaver::Plugin::SingleEncoding + name: '@Author::ETHER/SingleEncoding' + version: '4.013' + - + class: Pod::Weaver::Plugin::Transformer + name: '@Author::ETHER/List' + version: '4.013' + - + class: Pod::Weaver::Plugin::Transformer + name: '@Author::ETHER/Verbatim' + version: '4.013' + - + class: Pod::Weaver::Section::Region + name: '@Author::ETHER/header' + version: '4.013' + - + class: Pod::Weaver::Section::Name + name: '@Author::ETHER/Name' + version: '4.013' + - + class: Pod::Weaver::Section::Version + name: '@Author::ETHER/Version' + version: '4.013' + - + class: Pod::Weaver::Section::Region + name: '@Author::ETHER/prelude' + version: '4.013' + - + class: Pod::Weaver::Section::Generic + name: SYNOPSIS + version: '4.013' + - + class: Pod::Weaver::Section::Generic + name: DESCRIPTION + version: '4.013' + - + class: Pod::Weaver::Section::Generic + name: OVERVIEW + version: '4.013' + - + class: Pod::Weaver::Section::Collect + name: ATTRIBUTES + version: '4.013' + - + class: Pod::Weaver::Section::Collect + name: METHODS + version: '4.013' + - + class: Pod::Weaver::Section::Collect + name: FUNCTIONS + version: '4.013' + - + class: Pod::Weaver::Section::Collect + name: TYPES + version: '4.013' + - + class: Pod::Weaver::Section::Leftovers + name: '@Author::ETHER/Leftovers' + version: '4.013' + - + class: Pod::Weaver::Section::Region + name: '@Author::ETHER/postlude' + version: '4.013' + - + class: Pod::Weaver::Section::GenerateSection + name: '@Author::ETHER/generate SUPPORT' + version: '1.02' + - + class: Pod::Weaver::Section::AllowOverride + name: '@Author::ETHER/allow override SUPPORT' + version: '0.05' + - + class: Pod::Weaver::Section::Authors + name: '@Author::ETHER/Authors' + version: '4.013' + - + class: Pod::Weaver::Section::Contributors + name: '@Author::ETHER/Contributors' + version: '0.009' + - + class: Pod::Weaver::Section::Legal + name: '@Author::ETHER/Legal' + version: '4.013' + - + class: Pod::Weaver::Section::Region + name: '@Author::ETHER/footer' + version: '4.013' + - + class: Pod::Weaver::Section::AllowOverride + name: OverrideAuthors + version: '0.05' + - + class: Pod::Weaver::Section::AllowOverride + name: OverrideLegal + version: '0.05' + name: '@Author::ETHER/PodWeaver' + version: '4.008' + - + class: Dist::Zilla::Plugin::GithubMeta + name: '@Author::ETHER/GithubMeta' + version: '0.54' + - + class: Dist::Zilla::Plugin::AutoMetaResources + name: '@Author::ETHER/AutoMetaResources' + version: '1.21' + - + class: Dist::Zilla::Plugin::Authority + name: '@Author::ETHER/Authority' + version: '1.009' + - + class: Dist::Zilla::Plugin::MetaNoIndex + name: '@Author::ETHER/MetaNoIndex' + version: '6.006' + - + class: Dist::Zilla::Plugin::MetaProvides::Package + config: + Dist::Zilla::Plugin::MetaProvides::Package: + finder: + - ':InstallModules' + finder_objects: + - + class: Dist::Zilla::Plugin::FinderCode + name: ':InstallModules' + version: '6.006' + Dist::Zilla::Role::MetaProvider::Provider: + Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.001011' + inherit_missing: '0' + inherit_version: '0' + meta_noindex: '1' + name: '@Author::ETHER/MetaProvides::Package' + version: '2.003002' + - + class: Dist::Zilla::Plugin::MetaConfig + name: '@Author::ETHER/MetaConfig' + version: '6.006' + - + class: Dist::Zilla::Plugin::Keywords + config: + Dist::Zilla::Plugin::Keywords: + keywords: [] + name: '@Author::ETHER/Keywords' + version: '0.007' + - + class: Dist::Zilla::Plugin::AutoPrereqs + name: '@Author::ETHER/AutoPrereqs' + version: '6.006' + - + class: Dist::Zilla::Plugin::Prereqs::AuthorDeps + name: '@Author::ETHER/Prereqs::AuthorDeps' + version: '0.006' + - + class: Dist::Zilla::Plugin::MinimumPerl + name: '@Author::ETHER/MinimumPerl' + version: '1.006' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: develop + type: recommends + name: '@Author::ETHER/pluginbundle_version' + version: '6.006' + - + class: Dist::Zilla::Plugin::MakeMaker + config: + Dist::Zilla::Role::TestRunner: + default_jobs: 9 + name: '@Author::ETHER/MakeMaker' + version: '6.006' + - + class: Dist::Zilla::Plugin::Git::Contributors + config: + Dist::Zilla::Plugin::Git::Contributors: + include_authors: 0 + include_releaser: 1 + order_by: commits + paths: + - . + name: '@Author::ETHER/Git::Contributors' + version: '0.023' + - + class: Dist::Zilla::Plugin::StaticInstall + config: + Dist::Zilla::Plugin::StaticInstall: + dry_run: 0 + mode: off + name: '@Author::ETHER/StaticInstall' + version: '0.009' + - + class: Dist::Zilla::Plugin::RunExtraTests + config: + Dist::Zilla::Role::TestRunner: + default_jobs: 9 + name: '@Author::ETHER/RunExtraTests' + version: '0.029' + - + class: Dist::Zilla::Plugin::CheckSelfDependency + config: + Dist::Zilla::Plugin::CheckSelfDependency: + finder: + - ':InstallModules' + Dist::Zilla::Role::ModuleMetadata: + Module::Metadata: '1.000032' + version: '0.004' + name: '@Author::ETHER/CheckSelfDependency' + version: '0.011' + - + class: Dist::Zilla::Plugin::Run::AfterBuild + config: + Dist::Zilla::Plugin::Run::Role::Runner: + fatal_errors: 1 + quiet: 1 + run: + - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" + name: '@Author::ETHER/.ackrc' + version: '0.043' + - + class: Dist::Zilla::Plugin::Run::AfterBuild + config: + Dist::Zilla::Plugin::Run::Role::Runner: + eval: + - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" + fatal_errors: 1 + quiet: 1 + name: '@Author::ETHER/.latest' + version: '0.043' + - + class: Dist::Zilla::Plugin::CheckStrictVersion + name: '@Author::ETHER/CheckStrictVersion' + version: '0.001' + - + class: Dist::Zilla::Plugin::Git::Check + config: + Dist::Zilla::Plugin::Git::Check: + untracked_files: die + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: [] + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: '@Author::ETHER/initial check' + version: '2.039' + - + class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts + config: + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: '@Author::ETHER/Git::CheckFor::MergeConflicts' + version: '0.013' + - + class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch + config: + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: '@Author::ETHER/Git::CheckFor::CorrectBranch' + version: '0.013' + - + class: Dist::Zilla::Plugin::Git::Remote::Check + name: '@Author::ETHER/Git::Remote::Check' + version: 0.1.2 + - + class: Dist::Zilla::Plugin::CheckPrereqsIndexed + name: '@Author::ETHER/CheckPrereqsIndexed' + version: '0.018' + - + class: Dist::Zilla::Plugin::TestRelease + name: '@Author::ETHER/TestRelease' + version: '6.006' + - + class: Dist::Zilla::Plugin::Git::Check + config: + Dist::Zilla::Plugin::Git::Check: + untracked_files: die + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: [] + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: '@Author::ETHER/after tests' + version: '2.039' + - + class: Dist::Zilla::Plugin::CheckIssues + name: '@Author::ETHER/CheckIssues' + version: '0.010' + - + class: Dist::Zilla::Plugin::UploadToCPAN + name: '@Author::ETHER/UploadToCPAN' + version: '6.006' + - + class: Dist::Zilla::Plugin::CopyFilesFromRelease + config: + Dist::Zilla::Plugin::CopyFilesFromRelease: + filename: + - CONTRIBUTING + - Changes + - INSTALL + - LICENCE + - LICENSE + - ppport.h + match: [] + name: '@Author::ETHER/CopyFilesFromRelease' + version: '0.006' + - + class: Dist::Zilla::Plugin::ReadmeAnyFromPod + config: + Dist::Zilla::Role::FileWatcher: + version: '0.006' + name: '@Author::ETHER/ReadmeAnyFromPod' + version: '0.161170' + - + class: Dist::Zilla::Plugin::Git::Commit + config: + Dist::Zilla::Plugin::Git::Commit: + add_files_in: + - . + commit_msg: '%N-%v%t%n%n%c' + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - CONTRIBUTING + - Changes + - INSTALL + - LICENCE + - README.pod + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + Dist::Zilla::Role::Git::StringFormatter: + time_zone: local + name: '@Author::ETHER/release snapshot' + version: '2.039' + - + class: Dist::Zilla::Plugin::Git::Tag + config: + Dist::Zilla::Plugin::Git::Tag: + branch: ~ + changelog: Changes + signed: 0 + tag: v1.000033 + tag_format: v%v + tag_message: v%v%t + Dist::Zilla::Role::Git::Repo: + repo_root: . + Dist::Zilla::Role::Git::StringFormatter: + time_zone: local + name: '@Author::ETHER/Git::Tag' + version: '2.039' + - + class: Dist::Zilla::Plugin::GitHub::Update + config: + Dist::Zilla::Plugin::GitHub::Update: + metacpan: 1 + name: '@Author::ETHER/GitHub::Update' + version: '0.42' + - + class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional + config: + Dist::Zilla::Plugin::BumpVersionAfterRelease: + finders: + - ':ExecFiles' + - ':InstallModules' + global: 1 + munge_makefile_pl: 1 + Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} + name: '@Author::ETHER/BumpVersionAfterRelease::Transitional' + version: '0.007' + - + class: Dist::Zilla::Plugin::NextRelease + name: '@Author::ETHER/NextRelease' + version: '6.006' + - + class: Dist::Zilla::Plugin::Git::Commit + config: + Dist::Zilla::Plugin::Git::Commit: + add_files_in: [] + commit_msg: 'increment $VERSION after %v release' + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - Changes + allow_dirty_match: + - (?^:^lib/.*\.pm$) + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + Dist::Zilla::Role::Git::StringFormatter: + time_zone: local + name: '@Author::ETHER/post-release commit' + version: '2.039' + - + class: Dist::Zilla::Plugin::Git::Push + config: + Dist::Zilla::Plugin::Git::Push: + push_to: + - origin + remotes_must_exist: 1 + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: '@Author::ETHER/Git::Push' + version: '2.039' + - + class: Dist::Zilla::Plugin::Run::AfterRelease + config: + Dist::Zilla::Plugin::Run::Role::Runner: + fatal_errors: 0 + quiet: 0 + run: + - REDACTED + name: '@Author::ETHER/install release' + version: '0.043' + - + class: Dist::Zilla::Plugin::Run::AfterRelease + config: + Dist::Zilla::Plugin::Run::Role::Runner: + eval: + - 'print "release complete!\xa"' + fatal_errors: 1 + quiet: 1 + name: '@Author::ETHER/release complete' + version: '0.043' + - + class: Dist::Zilla::Plugin::ConfirmRelease + name: '@Author::ETHER/ConfirmRelease' + version: '6.006' + - + class: Dist::Zilla::Plugin::Encoding + name: Encoding + version: '6.006' + - + class: Dist::Zilla::Plugin::MetaResources + name: MetaResources + version: '6.006' + - + class: Dist::Zilla::Plugin::OnlyCorePrereqs + config: + Dist::Zilla::Plugin::OnlyCorePrereqs: + also_disallow: [] + check_dual_life_versions: '0' + deprecated_ok: '0' + phases: + - configure + - build + - runtime + - test + skips: [] + starting_version: 'to be determined from perl prereq' + name: OnlyCorePrereqs + version: '0.024' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: develop + type: requires + name: DevelopRequires + version: '6.006' + - + class: Dist::Zilla::Plugin::DynamicPrereqs + config: + Dist::Zilla::Role::ModuleMetadata: + Module::Metadata: '1.000032' + version: '0.004' + name: DynamicPrereqs + version: '0.031' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':InstallModules' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':IncModules' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':TestFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ExtraTestFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ExecFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':PerlExecFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ShareFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':MainModule' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':AllFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':NoFiles' + version: '6.006' + - + class: Dist::Zilla::Plugin::VerifyPhases + name: '@Author::ETHER/PHASE VERIFICATION' + version: '0.014' + zilla: + class: Dist::Zilla::Dist::Builder + config: + is_trial: '0' + version: '6.006' +x_authority: cpan:MSTROUT +x_contributors: + - 'Karen Etheridge ' + - 'David Golden ' + - 'Vincent Pit ' + - 'Matt S Trout ' + - 'Chris Nehren ' + - 'Graham Knop ' + - 'Olivier Mengué ' + - 'Tomas Doran ' + - 'Tatsuhiko Miyagawa ' + - 'tokuhirom ' + - 'Kent Fredric ' + - 'Peter Rabbitson ' + - 'Steve Hay ' + - 'Jerry D. Hedden ' + - 'Craig A. Berry ' + - 'Craig A. Berry ' + - 'David Mitchell ' + - 'David Steinbrunner ' + - 'Edward Zborowski ' + - 'Gareth Harper ' + - 'James Raspass ' + - "Chris 'BinGOs' Williams " + - 'Josh Jore ' +x_serialization_backend: 'YAML::Tiny version 1.69' +x_static_install: 0 diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..26cd078 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,100 @@ +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.006. +use strict; +use warnings; + +use 5.006; + +use ExtUtils::MakeMaker; + +my %WriteMakefileArgs = ( + "ABSTRACT" => "Gather package and POD information from perl module files", + "AUTHOR" => "Ken Williams , Randy W. Sims ", + "CONFIGURE_REQUIRES" => { + "ExtUtils::MakeMaker" => 0 + }, + "DISTNAME" => "Module-Metadata", + "LICENSE" => "perl", + "MIN_PERL_VERSION" => "5.006", + "NAME" => "Module::Metadata", + "PREREQ_PM" => { + "Carp" => 0, + "Fcntl" => 0, + "File::Find" => 0, + "File::Spec" => 0, + "strict" => 0, + "version" => "0.87", + "warnings" => 0 + }, + "TEST_REQUIRES" => { + "Cwd" => 0, + "Exporter" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Basename" => 0, + "File::Path" => 0, + "File::Spec" => 0, + "File::Temp" => 0, + "IO::File" => 0, + "Test::More" => "0.82", + "base" => 0, + "lib" => 0 + }, + "VERSION" => "1.000033", + "test" => { + "TESTS" => "t/*.t" + } +); + + +my %FallbackPrereqs = ( + "Carp" => 0, + "Cwd" => 0, + "Exporter" => 0, + "ExtUtils::MakeMaker" => 0, + "Fcntl" => 0, + "File::Basename" => 0, + "File::Find" => 0, + "File::Path" => 0, + "File::Spec" => 0, + "File::Temp" => 0, + "IO::File" => 0, + "Test::More" => "0.82", + "base" => 0, + "lib" => 0, + "strict" => 0, + "version" => "0.87", + "warnings" => 0 +); + +# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.031 +requires('IO::Scalar') if "$]" < '5.008'; + + +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); + +# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.031 +sub _add_prereq { + my ($mm_key, $module, $version_or_range) = @_; + warn "$module already exists in $mm_key -- need to do a sane metamerge!" + if exists $WriteMakefileArgs{$mm_key}{$module} + and $WriteMakefileArgs{$mm_key}{$module} ne ($version_or_range || 0); + warn "$module already exists in FallbackPrereqs -- need to do a sane metamerge!" + if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne ($version_or_range || 0); + $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range || 0; + return; +} + +sub requires { goto &runtime_requires } + +sub runtime_requires { + my ($module, $version_or_range) = @_; + _add_prereq(PREREQ_PM => $module, $version_or_range); +} diff --git a/README b/README new file mode 100644 index 0000000..bd37d3b --- /dev/null +++ b/README @@ -0,0 +1,15 @@ + + +This archive contains the distribution Module-Metadata, +version 1.000033: + + Gather package and POD information from perl module files + +This software is copyright (c) 2010 by Perl Toolchain Gang. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + + +This README file was generated by Dist::Zilla::Plugin::Readme v6.006. + diff --git a/corpus/BOMTest/UTF16BE.pm b/corpus/BOMTest/UTF16BE.pm new file mode 100644 index 0000000..17c6a4a Binary files /dev/null and b/corpus/BOMTest/UTF16BE.pm differ diff --git a/corpus/BOMTest/UTF16LE.pm b/corpus/BOMTest/UTF16LE.pm new file mode 100644 index 0000000..a46de6d Binary files /dev/null and b/corpus/BOMTest/UTF16LE.pm differ diff --git a/corpus/BOMTest/UTF8.pm b/corpus/BOMTest/UTF8.pm new file mode 100644 index 0000000..9062ac6 --- /dev/null +++ b/corpus/BOMTest/UTF8.pm @@ -0,0 +1,13 @@ +package Heart; + +our $VERSION = 1; + +package BOMTest::UTF8; + +our $VERSION = 3; + +package Cœur; + +our $VERSION = 2; + +1; diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..4766460 --- /dev/null +++ b/dist.ini @@ -0,0 +1,38 @@ +name = Module-Metadata +author = Ken Williams +author = Randy W. Sims +license = Perl_5 +copyright_holder = Perl Toolchain Gang +copyright_year = 2010 + +[@Author::ETHER] +:version = 0.094 +installer = MakeMaker +Authority.authority = cpan:MSTROUT +Test::MinimumVersion.max_target_perl = 5.006 +AutoPrereqs.skip = ^Foo$ +Test::ReportPrereqs.version_extractor = ExtUtils::MakeMaker ; so MMD is not added to test prereqs +StaticInstall.mode = off ; dynamic prereqs +-remove = Test::PodSpelling +-remove = Test::CleanNamespaces + +; authordep Pod::Weaver::Section::AllowOverride + +[Encoding] +match = ^corpus +encoding = bytes + +[MetaResources] +x_IRC = irc://irc.perl.org/#toolchain +x_MailingList = http://lists.perl.org/list/cpan-workers.html + +[OnlyCorePrereqs] +:version = 0.014 +check_dual_life_versions = 0 + +[Prereqs / DevelopRequires] +Test::Builder = 0.90 ; for is_passing + +[DynamicPrereqs] +:version = 0.016 +-raw = requires('IO::Scalar') if "$]" < '5.008'; diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm new file mode 100644 index 0000000..7f49da6 --- /dev/null +++ b/lib/Module/Metadata.pm @@ -0,0 +1,1180 @@ +# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- +# vim:ts=8:sw=2:et:sta:sts=2:tw=78 +package Module::Metadata; # git description: v1.000032-7-gb4e8a3f +# ABSTRACT: Gather package and POD information from perl module files + +# Adapted from Perl-licensed code originally distributed with +# Module-Build by Ken Williams + +# This module provides routines to gather information about +# perl modules (assuming this may be expanded in the distant +# parrot future to look at other types of modules). + +sub __clean_eval { eval $_[0] } +use strict; +use warnings; + +our $VERSION = '1.000033'; + +use Carp qw/croak/; +use File::Spec; +BEGIN { + # Try really hard to not depend ony any DynaLoaded module, such as IO::File or Fcntl + eval { + require Fcntl; Fcntl->import('SEEK_SET'); 1; + } or *SEEK_SET = sub { 0 } +} +use version 0.87; +BEGIN { + if ($INC{'Log/Contextual.pm'}) { + require "Log/Contextual/WarnLogger.pm"; # Hide from AutoPrereqs + Log::Contextual->import('log_info', + '-default_logger' => Log::Contextual::WarnLogger->new({ env_prefix => 'MODULE_METADATA', }), + ); + } + else { + *log_info = sub (&) { warn $_[0]->() }; + } +} +use File::Find qw(find); + +my $V_NUM_REGEXP = qr{v?[0-9._]+}; # crudely, a v-string or decimal + +my $PKG_FIRST_WORD_REGEXP = qr{ # the FIRST word in a package name + [a-zA-Z_] # the first word CANNOT start with a digit + (?: + [\w']? # can contain letters, digits, _, or ticks + \w # But, NO multi-ticks or trailing ticks + )* +}x; + +my $PKG_ADDL_WORD_REGEXP = qr{ # the 2nd+ word in a package name + \w # the 2nd+ word CAN start with digits + (?: + [\w']? # and can contain letters or ticks + \w # But, NO multi-ticks or trailing ticks + )* +}x; + +my $PKG_NAME_REGEXP = qr{ # match a package name + (?: :: )? # a pkg name can start with arisdottle + $PKG_FIRST_WORD_REGEXP # a package word + (?: + (?: :: )+ ### arisdottle (allow one or many times) + $PKG_ADDL_WORD_REGEXP ### a package word + )* # ^ zero, one or many times + (?: + :: # allow trailing arisdottle + )? +}x; + +my $PKG_REGEXP = qr{ # match a package declaration + ^[\s\{;]* # intro chars on a line + package # the word 'package' + \s+ # whitespace + ($PKG_NAME_REGEXP) # a package name + \s* # optional whitespace + ($V_NUM_REGEXP)? # optional version number + \s* # optional whitesapce + [;\{] # semicolon line terminator or block start (since 5.16) +}x; + +my $VARNAME_REGEXP = qr{ # match fully-qualified VERSION name + ([\$*]) # sigil - $ or * + ( + ( # optional leading package name + (?:::|\')? # possibly starting like just :: (a la $::VERSION) + (?:\w+(?:::|\'))* # Foo::Bar:: ... + )? + VERSION + )\b +}x; + +my $VERS_REGEXP = qr{ # match a VERSION definition + (?: + \(\s*$VARNAME_REGEXP\s*\) # with parens + | + $VARNAME_REGEXP # without parens + ) + \s* + =[^=~>] # = but not ==, nor =~, nor => +}x; + +sub new_from_file { + my $class = shift; + my $filename = File::Spec->rel2abs( shift ); + + return undef unless defined( $filename ) && -f $filename; + return $class->_init(undef, $filename, @_); +} + +sub new_from_handle { + my $class = shift; + my $handle = shift; + my $filename = shift; + return undef unless defined($handle) && defined($filename); + $filename = File::Spec->rel2abs( $filename ); + + return $class->_init(undef, $filename, @_, handle => $handle); + +} + + +sub new_from_module { + my $class = shift; + my $module = shift; + my %props = @_; + + $props{inc} ||= \@INC; + my $filename = $class->find_module_by_name( $module, $props{inc} ); + return undef unless defined( $filename ) && -f $filename; + return $class->_init($module, $filename, %props); +} + +{ + + my $compare_versions = sub { + my ($v1, $op, $v2) = @_; + $v1 = version->new($v1) + unless UNIVERSAL::isa($v1,'version'); + + my $eval_str = "\$v1 $op \$v2"; + my $result = eval $eval_str; + log_info { "error comparing versions: '$eval_str' $@" } if $@; + + return $result; + }; + + my $normalize_version = sub { + my ($version) = @_; + if ( $version =~ /[=<>!,]/ ) { # logic, not just version + # take as is without modification + } + elsif ( ref $version eq 'version' ) { # version objects + $version = $version->is_qv ? $version->normal : $version->stringify; + } + elsif ( $version =~ /^[^v][^.]*\.[^.]+\./ ) { # no leading v, multiple dots + # normalize string tuples without "v": "1.2.3" -> "v1.2.3" + $version = "v$version"; + } + else { + # leave alone + } + return $version; + }; + + # separate out some of the conflict resolution logic + + my $resolve_module_versions = sub { + my $packages = shift; + + my( $file, $version ); + my $err = ''; + foreach my $p ( @$packages ) { + if ( defined( $p->{version} ) ) { + if ( defined( $version ) ) { + if ( $compare_versions->( $version, '!=', $p->{version} ) ) { + $err .= " $p->{file} ($p->{version})\n"; + } + else { + # same version declared multiple times, ignore + } + } + else { + $file = $p->{file}; + $version = $p->{version}; + } + } + $file ||= $p->{file} if defined( $p->{file} ); + } + + if ( $err ) { + $err = " $file ($version)\n" . $err; + } + + my %result = ( + file => $file, + version => $version, + err => $err + ); + + return \%result; + }; + + sub provides { + my $class = shift; + + croak "provides() requires key/value pairs \n" if @_ % 2; + my %args = @_; + + croak "provides() takes only one of 'dir' or 'files'\n" + if $args{dir} && $args{files}; + + croak "provides() requires a 'version' argument" + unless defined $args{version}; + + croak "provides() does not support version '$args{version}' metadata" + unless grep { $args{version} eq $_ } qw/1.4 2/; + + $args{prefix} = 'lib' unless defined $args{prefix}; + + my $p; + if ( $args{dir} ) { + $p = $class->package_versions_from_directory($args{dir}); + } + else { + croak "provides() requires 'files' to be an array reference\n" + unless ref $args{files} eq 'ARRAY'; + $p = $class->package_versions_from_directory($args{files}); + } + + # Now, fix up files with prefix + if ( length $args{prefix} ) { # check in case disabled with q{} + $args{prefix} =~ s{/$}{}; + for my $v ( values %$p ) { + $v->{file} = "$args{prefix}/$v->{file}"; + } + } + + return $p + } + + sub package_versions_from_directory { + my ( $class, $dir, $files ) = @_; + + my @files; + + if ( $files ) { + @files = @$files; + } + else { + find( { + wanted => sub { + push @files, $_ if -f $_ && /\.pm$/; + }, + no_chdir => 1, + }, $dir ); + } + + # First, we enumerate all packages & versions, + # separating into primary & alternative candidates + my( %prime, %alt ); + foreach my $file (@files) { + my $mapped_filename = File::Spec::Unix->abs2rel( $file, $dir ); + my @path = split( /\//, $mapped_filename ); + (my $prime_package = join( '::', @path )) =~ s/\.pm$//; + + my $pm_info = $class->new_from_file( $file ); + + foreach my $package ( $pm_info->packages_inside ) { + next if $package eq 'main'; # main can appear numerous times, ignore + next if $package eq 'DB'; # special debugging package, ignore + next if grep /^_/, split( /::/, $package ); # private package, ignore + + my $version = $pm_info->version( $package ); + + $prime_package = $package if lc($prime_package) eq lc($package); + if ( $package eq $prime_package ) { + if ( exists( $prime{$package} ) ) { + croak "Unexpected conflict in '$package'; multiple versions found.\n"; + } + else { + $mapped_filename = "$package.pm" if lc("$package.pm") eq lc($mapped_filename); + $prime{$package}{file} = $mapped_filename; + $prime{$package}{version} = $version if defined( $version ); + } + } + else { + push( @{$alt{$package}}, { + file => $mapped_filename, + version => $version, + } ); + } + } + } + + # Then we iterate over all the packages found above, identifying conflicts + # and selecting the "best" candidate for recording the file & version + # for each package. + foreach my $package ( keys( %alt ) ) { + my $result = $resolve_module_versions->( $alt{$package} ); + + if ( exists( $prime{$package} ) ) { # primary package selected + + if ( $result->{err} ) { + # Use the selected primary package, but there are conflicting + # errors among multiple alternative packages that need to be + # reported + log_info { + "Found conflicting versions for package '$package'\n" . + " $prime{$package}{file} ($prime{$package}{version})\n" . + $result->{err} + }; + + } + elsif ( defined( $result->{version} ) ) { + # There is a primary package selected, and exactly one + # alternative package + + if ( exists( $prime{$package}{version} ) && + defined( $prime{$package}{version} ) ) { + # Unless the version of the primary package agrees with the + # version of the alternative package, report a conflict + if ( $compare_versions->( + $prime{$package}{version}, '!=', $result->{version} + ) + ) { + + log_info { + "Found conflicting versions for package '$package'\n" . + " $prime{$package}{file} ($prime{$package}{version})\n" . + " $result->{file} ($result->{version})\n" + }; + } + + } + else { + # The prime package selected has no version so, we choose to + # use any alternative package that does have a version + $prime{$package}{file} = $result->{file}; + $prime{$package}{version} = $result->{version}; + } + + } + else { + # no alt package found with a version, but we have a prime + # package so we use it whether it has a version or not + } + + } + else { # No primary package was selected, use the best alternative + + if ( $result->{err} ) { + log_info { + "Found conflicting versions for package '$package'\n" . + $result->{err} + }; + } + + # Despite possible conflicting versions, we choose to record + # something rather than nothing + $prime{$package}{file} = $result->{file}; + $prime{$package}{version} = $result->{version} + if defined( $result->{version} ); + } + } + + # Normalize versions. Can't use exists() here because of bug in YAML::Node. + # XXX "bug in YAML::Node" comment seems irrelevant -- dagolden, 2009-05-18 + for (grep defined $_->{version}, values %prime) { + $_->{version} = $normalize_version->( $_->{version} ); + } + + return \%prime; + } +} + + +sub _init { + my $class = shift; + my $module = shift; + my $filename = shift; + my %props = @_; + + my $handle = delete $props{handle}; + my( %valid_props, @valid_props ); + @valid_props = qw( collect_pod inc ); + @valid_props{@valid_props} = delete( @props{@valid_props} ); + warn "Unknown properties: @{[keys %props]}\n" if scalar( %props ); + + my %data = ( + module => $module, + filename => $filename, + version => undef, + packages => [], + versions => {}, + pod => {}, + pod_headings => [], + collect_pod => 0, + + %valid_props, + ); + + my $self = bless(\%data, $class); + + if ( not $handle ) { + my $filename = $self->{filename}; + open $handle, '<', $filename + or croak( "Can't open '$filename': $!" ); + + $self->_handle_bom($handle, $filename); + } + $self->_parse_fh($handle); + + @{$self->{packages}} = __uniq(@{$self->{packages}}); + + unless($self->{module} and length($self->{module})) { + # CAVEAT (possible TODO): .pmc files not treated the same as .pm + if ($self->{filename} =~ /\.pm$/) { + my ($v, $d, $f) = File::Spec->splitpath($self->{filename}); + $f =~ s/\..+$//; + my @candidates = grep /(^|::)$f$/, @{$self->{packages}}; + $self->{module} = shift(@candidates); # this may be undef + } + else { + # this seems like an atrocious heuristic, albeit marginally better than + # what was here before. It should be rewritten entirely to be more like + # "if it's not a .pm file, it's not require()able as a name, therefore + # name() should be undef." + if ((grep /main/, @{$self->{packages}}) + or (grep /main/, keys %{$self->{versions}})) { + $self->{module} = 'main'; + } + else { + # TODO: this should maybe default to undef instead + $self->{module} = $self->{packages}[0] || ''; + } + } + } + + $self->{version} = $self->{versions}{$self->{module}} + if defined( $self->{module} ); + + return $self; +} + +# class method +sub _do_find_module { + my $class = shift; + my $module = shift || croak 'find_module_by_name() requires a package name'; + my $dirs = shift || \@INC; + + my $file = File::Spec->catfile(split( /::/, $module)); + foreach my $dir ( @$dirs ) { + my $testfile = File::Spec->catfile($dir, $file); + return [ File::Spec->rel2abs( $testfile ), $dir ] + if -e $testfile and !-d _; # For stuff like ExtUtils::xsubpp + # CAVEAT (possible TODO): .pmc files are not discoverable here + $testfile .= '.pm'; + return [ File::Spec->rel2abs( $testfile ), $dir ] + if -e $testfile; + } + return; +} + +# class method +sub find_module_by_name { + my $found = shift()->_do_find_module(@_) or return; + return $found->[0]; +} + +# class method +sub find_module_dir_by_name { + my $found = shift()->_do_find_module(@_) or return; + return $found->[1]; +} + + +# given a line of perl code, attempt to parse it if it looks like a +# $VERSION assignment, returning sigil, full name, & package name +sub _parse_version_expression { + my $self = shift; + my $line = shift; + + my( $sigil, $variable_name, $package); + if ( $line =~ /$VERS_REGEXP/o ) { + ( $sigil, $variable_name, $package) = $2 ? ( $1, $2, $3 ) : ( $4, $5, $6 ); + if ( $package ) { + $package = ($package eq '::') ? 'main' : $package; + $package =~ s/::$//; + } + } + + return ( $sigil, $variable_name, $package ); +} + +# Look for a UTF-8/UTF-16BE/UTF-16LE BOM at the beginning of the stream. +# If there's one, then skip it and set the :encoding layer appropriately. +sub _handle_bom { + my ($self, $fh, $filename) = @_; + + my $pos = tell $fh; + return unless defined $pos; + + my $buf = ' ' x 2; + my $count = read $fh, $buf, length $buf; + return unless defined $count and $count >= 2; + + my $encoding; + if ( $buf eq "\x{FE}\x{FF}" ) { + $encoding = 'UTF-16BE'; + } + elsif ( $buf eq "\x{FF}\x{FE}" ) { + $encoding = 'UTF-16LE'; + } + elsif ( $buf eq "\x{EF}\x{BB}" ) { + $buf = ' '; + $count = read $fh, $buf, length $buf; + if ( defined $count and $count >= 1 and $buf eq "\x{BF}" ) { + $encoding = 'UTF-8'; + } + } + + if ( defined $encoding ) { + if ( "$]" >= 5.008 ) { + binmode( $fh, ":encoding($encoding)" ); + } + } + else { + seek $fh, $pos, SEEK_SET + or croak( sprintf "Can't reset position to the top of '$filename'" ); + } + + return $encoding; +} + +sub _parse_fh { + my ($self, $fh) = @_; + + my( $in_pod, $seen_end, $need_vers ) = ( 0, 0, 0 ); + my( @packages, %vers, %pod, @pod ); + my $package = 'main'; + my $pod_sect = ''; + my $pod_data = ''; + my $in_end = 0; + + while (defined( my $line = <$fh> )) { + my $line_num = $.; + + chomp( $line ); + + # From toke.c : any line that begins by "=X", where X is an alphabetic + # character, introduces a POD segment. + my $is_cut; + if ( $line =~ /^=([a-zA-Z].*)/ ) { + my $cmd = $1; + # Then it goes back to Perl code for "=cutX" where X is a non-alphabetic + # character (which includes the newline, but here we chomped it away). + $is_cut = $cmd =~ /^cut(?:[^a-zA-Z]|$)/; + $in_pod = !$is_cut; + } + + if ( $in_pod ) { + + if ( $line =~ /^=head[1-4]\s+(.+)\s*$/ ) { + push( @pod, $1 ); + if ( $self->{collect_pod} && length( $pod_data ) ) { + $pod{$pod_sect} = $pod_data; + $pod_data = ''; + } + $pod_sect = $1; + } + elsif ( $self->{collect_pod} ) { + $pod_data .= "$line\n"; + } + next; + } + elsif ( $is_cut ) { + if ( $self->{collect_pod} && length( $pod_data ) ) { + $pod{$pod_sect} = $pod_data; + $pod_data = ''; + } + $pod_sect = ''; + next; + } + + # Skip after __END__ + next if $in_end; + + # Skip comments in code + next if $line =~ /^\s*#/; + + # Would be nice if we could also check $in_string or something too + if ($line eq '__END__') { + $in_end++; + next; + } + + last if $line eq '__DATA__'; + + # parse $line to see if it's a $VERSION declaration + my( $version_sigil, $version_fullname, $version_package ) = + index($line, 'VERSION') >= 1 + ? $self->_parse_version_expression( $line ) + : (); + + if ( $line =~ /$PKG_REGEXP/o ) { + $package = $1; + my $version = $2; + push( @packages, $package ) unless grep( $package eq $_, @packages ); + $need_vers = defined $version ? 0 : 1; + + if ( not exists $vers{$package} and defined $version ){ + # Upgrade to a version object. + my $dwim_version = eval { _dwim_version($version) }; + croak "Version '$version' from $self->{filename} does not appear to be valid:\n$line\n\nThe fatal error was: $@\n" + unless defined $dwim_version; # "0" is OK! + $vers{$package} = $dwim_version; + } + } + + # VERSION defined with full package spec, i.e. $Module::VERSION + elsif ( $version_fullname && $version_package ) { + # we do NOT save this package in found @packages + $need_vers = 0 if $version_package eq $package; + + unless ( defined $vers{$version_package} && length $vers{$version_package} ) { + $vers{$version_package} = $self->_evaluate_version_line( $version_sigil, $version_fullname, $line ); + } + } + + # first non-comment line in undeclared package main is VERSION + elsif ( $package eq 'main' && $version_fullname && !exists($vers{main}) ) { + $need_vers = 0; + my $v = $self->_evaluate_version_line( $version_sigil, $version_fullname, $line ); + $vers{$package} = $v; + push( @packages, 'main' ); + } + + # first non-comment line in undeclared package defines package main + elsif ( $package eq 'main' && !exists($vers{main}) && $line =~ /\w/ ) { + $need_vers = 1; + $vers{main} = ''; + push( @packages, 'main' ); + } + + # only keep if this is the first $VERSION seen + elsif ( $version_fullname && $need_vers ) { + $need_vers = 0; + my $v = $self->_evaluate_version_line( $version_sigil, $version_fullname, $line ); + + unless ( defined $vers{$package} && length $vers{$package} ) { + $vers{$package} = $v; + } + } + } # end loop over each line + + if ( $self->{collect_pod} && length($pod_data) ) { + $pod{$pod_sect} = $pod_data; + } + + $self->{versions} = \%vers; + $self->{packages} = \@packages; + $self->{pod} = \%pod; + $self->{pod_headings} = \@pod; +} + +sub __uniq (@) +{ + my (%seen, $key); + grep { not $seen{ $key = $_ }++ } @_; +} + +{ +my $pn = 0; +sub _evaluate_version_line { + my $self = shift; + my( $sigil, $variable_name, $line ) = @_; + + # We compile into a local sub because 'use version' would cause + # compiletime/runtime issues with local() + $pn++; # everybody gets their own package + my $eval = qq{ my \$dummy = q# Hide from _packages_inside() + #; package Module::Metadata::_version::p${pn}; + use version; + sub { + local $sigil$variable_name; + $line; + return \$$variable_name if defined \$$variable_name; + return \$Module::Metadata::_version::p${pn}::$variable_name; + }; + }; + + $eval = $1 if $eval =~ m{^(.+)}s; + + local $^W; + # Try to get the $VERSION + my $vsub = __clean_eval($eval); + # some modules say $VERSION $Foo::Bar::VERSION, but Foo::Bar isn't + # installed, so we need to hunt in ./lib for it + if ( $@ =~ /Can't locate/ && -d 'lib' ) { + local @INC = ('lib',@INC); + $vsub = __clean_eval($eval); + } + warn "Error evaling version line '$eval' in $self->{filename}: $@\n" + if $@; + + (ref($vsub) eq 'CODE') or + croak "failed to build version sub for $self->{filename}"; + + my $result = eval { $vsub->() }; + # FIXME: $eval is not the right thing to print here + croak "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n" + if $@; + + # Upgrade it into a version object + my $version = eval { _dwim_version($result) }; + + # FIXME: $eval is not the right thing to print here + croak "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n" + unless defined $version; # "0" is OK! + + return $version; +} +} + +# Try to DWIM when things fail the lax version test in obvious ways +{ + my @version_prep = ( + # Best case, it just works + sub { return shift }, + + # If we still don't have a version, try stripping any + # trailing junk that is prohibited by lax rules + sub { + my $v = shift; + $v =~ s{([0-9])[a-z-].*$}{$1}i; # 1.23-alpha or 1.23b + return $v; + }, + + # Activestate apparently creates custom versions like '1.23_45_01', which + # cause version.pm to think it's an invalid alpha. So check for that + # and strip them + sub { + my $v = shift; + my $num_dots = () = $v =~ m{(\.)}g; + my $num_unders = () = $v =~ m{(_)}g; + my $leading_v = substr($v,0,1) eq 'v'; + if ( ! $leading_v && $num_dots < 2 && $num_unders > 1 ) { + $v =~ s{_}{}g; + $num_unders = () = $v =~ m{(_)}g; + } + return $v; + }, + + # Worst case, try numifying it like we would have before version objects + sub { + my $v = shift; + no warnings 'numeric'; + return 0 + $v; + }, + + ); + + sub _dwim_version { + my ($result) = shift; + + return $result if ref($result) eq 'version'; + + my ($version, $error); + for my $f (@version_prep) { + $result = $f->($result); + $version = eval { version->new($result) }; + $error ||= $@ if $@; # capture first failure + last if defined $version; + } + + croak $error unless defined $version; + + return $version; + } +} + +############################################################ + +# accessors +sub name { $_[0]->{module} } + +sub filename { $_[0]->{filename} } +sub packages_inside { @{$_[0]->{packages}} } +sub pod_inside { @{$_[0]->{pod_headings}} } +sub contains_pod { 0+@{$_[0]->{pod_headings}} } + +sub version { + my $self = shift; + my $mod = shift || $self->{module}; + my $vers; + if ( defined( $mod ) && length( $mod ) && + exists( $self->{versions}{$mod} ) ) { + return $self->{versions}{$mod}; + } + else { + return undef; + } +} + +sub pod { + my $self = shift; + my $sect = shift; + if ( defined( $sect ) && length( $sect ) && + exists( $self->{pod}{$sect} ) ) { + return $self->{pod}{$sect}; + } + else { + return undef; + } +} + +sub is_indexable { + my ($self, $package) = @_; + + my @indexable_packages = grep { $_ ne 'main' } $self->packages_inside; + + # check for specific package, if provided + return !! grep { $_ eq $package } @indexable_packages if $package; + + # otherwise, check for any indexable packages at all + return !! @indexable_packages; +} + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Module::Metadata - Gather package and POD information from perl module files + +=head1 VERSION + +version 1.000033 + +=head1 SYNOPSIS + + use Module::Metadata; + + # information about a .pm file + my $info = Module::Metadata->new_from_file( $file ); + my $version = $info->version; + + # CPAN META 'provides' field for .pm files in a directory + my $provides = Module::Metadata->provides( + dir => 'lib', version => 2 + ); + +=head1 DESCRIPTION + +This module provides a standard way to gather metadata about a .pm file through +(mostly) static analysis and (some) code execution. When determining the +version of a module, the C<$VERSION> assignment is Ced, as is traditional +in the CPAN toolchain. + +=head1 CLASS METHODS + +=head2 C<< new_from_file($filename, collect_pod => 1) >> + +Constructs a C object given the path to a file. Returns +undef if the filename does not exist. + +C is a optional boolean argument that determines whether POD +data is collected and stored for reference. POD data is not collected by +default. POD headings are always collected. + +If the file begins by an UTF-8, UTF-16BE or UTF-16LE byte-order mark, then +it is skipped before processing, and the content of the file is also decoded +appropriately starting from perl 5.8. + +=head2 C<< new_from_handle($handle, $filename, collect_pod => 1) >> + +This works just like C, except that a handle can be provided +as the first argument. + +Note that there is no validation to confirm that the handle is a handle or +something that can act like one. Passing something that isn't a handle will +cause a exception when trying to read from it. The C argument is +mandatory or undef will be returned. + +You are responsible for setting the decoding layers on C<$handle> if +required. + +=head2 C<< new_from_module($module, collect_pod => 1, inc => \@dirs) >> + +Constructs a C object given a module or package name. +Returns undef if the module cannot be found. + +In addition to accepting the C argument as described above, +this method accepts a C argument which is a reference to an array of +directories to search for the module. If none are given, the default is +@INC. + +If the file that contains the module begins by an UTF-8, UTF-16BE or +UTF-16LE byte-order mark, then it is skipped before processing, and the +content of the file is also decoded appropriately starting from perl 5.8. + +=head2 C<< find_module_by_name($module, \@dirs) >> + +Returns the path to a module given the module or package name. A list +of directories can be passed in as an optional parameter, otherwise +@INC is searched. + +Can be called as either an object or a class method. + +=head2 C<< find_module_dir_by_name($module, \@dirs) >> + +Returns the entry in C<@dirs> (or C<@INC> by default) that contains +the module C<$module>. A list of directories can be passed in as an +optional parameter, otherwise @INC is searched. + +Can be called as either an object or a class method. + +=head2 C<< provides( %options ) >> + +This is a convenience wrapper around C +to generate a CPAN META C data structure. It takes key/value +pairs. Valid option keys include: + +=over + +=item version B<(required)> + +Specifies which version of the L should be used as +the format of the C output. Currently only '1.4' and '2' +are supported (and their format is identical). This may change in +the future as the definition of C changes. + +The C option is required. If it is omitted or if +an unsupported version is given, then C will throw an error. + +=item dir + +Directory to search recursively for F<.pm> files. May not be specified with +C. + +=item files + +Array reference of files to examine. May not be specified with C. + +=item prefix + +String to prepend to the C field of the resulting output. This defaults +to F, which is the common case for most CPAN distributions with their +F<.pm> files in F. This option ensures the META information has the +correct relative path even when the C or C arguments are +absolute or have relative paths from a location other than the distribution +root. + +=back + +For example, given C of 'lib' and C of 'lib', the return value +is a hashref of the form: + + { + 'Package::Name' => { + version => '0.123', + file => 'lib/Package/Name.pm' + }, + 'OtherPackage::Name' => ... + } + +=head2 C<< package_versions_from_directory($dir, \@files?) >> + +Scans C<$dir> for .pm files (unless C<@files> is given, in which case looks +for those files in C<$dir> - and reads each file for packages and versions, +returning a hashref of the form: + + { + 'Package::Name' => { + version => '0.123', + file => 'Package/Name.pm' + }, + 'OtherPackage::Name' => ... + } + +The C and C
packages are always omitted, as are any "private" +packages that have leading underscores in the namespace (e.g. +C) + +Note that the file path is relative to C<$dir> if that is specified. +This B be used directly for CPAN META C. See +the C method instead. + +=head2 C<< log_info (internal) >> + +Used internally to perform logging; imported from Log::Contextual if +Log::Contextual has already been loaded, otherwise simply calls warn. + +=head1 OBJECT METHODS + +=head2 C<< name() >> + +Returns the name of the package represented by this module. If there +is more than one package, it makes a best guess based on the +filename. If it's a script (i.e. not a *.pm) the package name is +'main'. + +=head2 C<< version($package) >> + +Returns the version as defined by the $VERSION variable for the +package as returned by the C method if no arguments are +given. If given the name of a package it will attempt to return the +version of that package if it is specified in the file. + +=head2 C<< filename() >> + +Returns the absolute path to the file. +Note that this file may not actually exist on disk yet, e.g. if the module was read from an in-memory filehandle. + +=head2 C<< packages_inside() >> + +Returns a list of packages. Note: this is a raw list of packages +discovered (or assumed, in the case of C
). It is not +filtered for C, C
or private packages the way the +C method does. Invalid package names are not returned, +for example "Foo:Bar". Strange but valid package names are +returned, for example "Foo::Bar::", and are left up to the caller +on how to handle. + +=head2 C<< pod_inside() >> + +Returns a list of POD sections. + +=head2 C<< contains_pod() >> + +Returns true if there is any POD in the file. + +=head2 C<< pod($section) >> + +Returns the POD data in the given section. + +=head2 C<< is_indexable($package) >> or C<< is_indexable() >> + +Available since version 1.000020. + +Returns a boolean indicating whether the package (if provided) or any package +(otherwise) is eligible for indexing by PAUSE, the Perl Authors Upload Server. +Note This only checks for valid C declarations, and does not take any +ownership information into account. + +=head1 SUPPORT + +Bugs may be submitted through L +(or L). + +There is also a mailing list available for users of this distribution, at +L. + +There is also an irc channel available for users of this distribution, at +L on C|irc://irc.perl.org/#toolchain>. + +=head1 AUTHOR + +Original code from Module::Build::ModuleInfo by Ken Williams +, Randy W. Sims + +Released as Module::Metadata by Matt S Trout (mst) with +assistance from David Golden (xdg) . + +=head1 CONTRIBUTORS + +=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris Nehren Graham Knop Olivier Mengué Tomas Doran Tatsuhiko Miyagawa tokuhirom Kent Fredric Peter Rabbitson Steve Hay Jerry D. Hedden Craig A. Berry Mitchell Steinbrunner Edward Zborowski Gareth Harper James Raspass 'BinGOs' Williams Josh Jore + +=over 4 + +=item * + +Karen Etheridge + +=item * + +David Golden + +=item * + +Vincent Pit + +=item * + +Matt S Trout + +=item * + +Chris Nehren + +=item * + +Graham Knop + +=item * + +Olivier Mengué + +=item * + +Tomas Doran + +=item * + +Tatsuhiko Miyagawa + +=item * + +tokuhirom + +=item * + +Kent Fredric + +=item * + +Peter Rabbitson + +=item * + +Steve Hay + +=item * + +Jerry D. Hedden + +=item * + +Craig A. Berry + +=item * + +Craig A. Berry + +=item * + +David Mitchell + +=item * + +David Steinbrunner + +=item * + +Edward Zborowski + +=item * + +Gareth Harper + +=item * + +James Raspass + +=item * + +Chris 'BinGOs' Williams + +=item * + +Josh Jore + +=back + +=head1 COPYRIGHT & LICENSE + +Original code Copyright (c) 2001-2011 Ken Williams. +Additional code Copyright (c) 2010-2011 Matt Trout and David Golden. +All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +=cut diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd new file mode 100644 index 0000000..8e727f8 --- /dev/null +++ b/t/00-report-prereqs.dd @@ -0,0 +1,137 @@ +do { my $x = { + 'configure' => { + 'requires' => { + 'ExtUtils::MakeMaker' => '0', + 'perl' => '5.006' + } + }, + 'develop' => { + 'recommends' => { + 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.117' + }, + 'requires' => { + 'Dist::Zilla' => '5', + 'Dist::Zilla::Plugin::Authority' => '1.009', + 'Dist::Zilla::Plugin::AutoMetaResources' => '0', + 'Dist::Zilla::Plugin::AutoPrereqs' => '5.038', + 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', + 'Dist::Zilla::Plugin::CheckIssues' => '0', + 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0', + 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', + 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', + 'Dist::Zilla::Plugin::ConfirmRelease' => '0', + 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', + 'Dist::Zilla::Plugin::DynamicPrereqs' => '0.016', + 'Dist::Zilla::Plugin::Encoding' => '0', + 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', + 'Dist::Zilla::Plugin::GenerateFile::FromShareDir' => '0', + 'Dist::Zilla::Plugin::Git::Check' => '0', + 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0.004', + 'Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts' => '0', + 'Dist::Zilla::Plugin::Git::Commit' => '2.020', + 'Dist::Zilla::Plugin::Git::Contributors' => '0.004', + 'Dist::Zilla::Plugin::Git::Describe' => '0.004', + 'Dist::Zilla::Plugin::Git::GatherDir' => '2.016', + 'Dist::Zilla::Plugin::Git::Push' => '0', + 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', + 'Dist::Zilla::Plugin::Git::Tag' => '0', + 'Dist::Zilla::Plugin::GitHub::Update' => '0.40', + 'Dist::Zilla::Plugin::GithubMeta' => '0.54', + 'Dist::Zilla::Plugin::InstallGuide' => '1.200005', + 'Dist::Zilla::Plugin::Keywords' => '0.004', + 'Dist::Zilla::Plugin::License' => '5.038', + 'Dist::Zilla::Plugin::MakeMaker' => '0', + 'Dist::Zilla::Plugin::Manifest' => '0', + 'Dist::Zilla::Plugin::MetaConfig' => '0', + 'Dist::Zilla::Plugin::MetaJSON' => '0', + 'Dist::Zilla::Plugin::MetaNoIndex' => '0', + 'Dist::Zilla::Plugin::MetaProvides::Package' => '1.15000002', + 'Dist::Zilla::Plugin::MetaResources' => '0', + 'Dist::Zilla::Plugin::MetaTests' => '0', + 'Dist::Zilla::Plugin::MetaYAML' => '0', + 'Dist::Zilla::Plugin::MinimumPerl' => '1.006', + 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', + 'Dist::Zilla::Plugin::NextRelease' => '5.033', + 'Dist::Zilla::Plugin::OnlyCorePrereqs' => '0.014', + 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', + 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', + 'Dist::Zilla::Plugin::PodWeaver' => '4.005', + 'Dist::Zilla::Plugin::Prereqs' => '0', + 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0.006', + 'Dist::Zilla::Plugin::PromptIfStale' => '0', + 'Dist::Zilla::Plugin::Readme' => '0', + 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', + 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.004', + 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.038', + 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', + 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', + 'Dist::Zilla::Plugin::StaticInstall' => '0.005', + 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.012', + 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', + 'Dist::Zilla::Plugin::Test::Compile' => '2.039', + 'Dist::Zilla::Plugin::Test::EOL' => '0.17', + 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.10', + 'Dist::Zilla::Plugin::Test::MinimumVersion' => '2.000003', + 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', + 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.003', + 'Dist::Zilla::Plugin::Test::Portability' => '2.000007', + 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.022', + 'Dist::Zilla::Plugin::TestRelease' => '0', + 'Dist::Zilla::Plugin::UploadToCPAN' => '0', + 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.094', + 'File::Spec' => '0', + 'IO::Handle' => '0', + 'IPC::Open3' => '0', + 'Pod::Coverage::TrustPod' => '0', + 'Pod::Weaver::Section::AllowOverride' => '0', + 'Software::License::Perl_5' => '0', + 'Test::Builder' => '0.90', + 'Test::CPAN::Changes' => '0.19', + 'Test::CPAN::Meta' => '0', + 'Test::EOL' => '0', + 'Test::Kwalitee' => '1.21', + 'Test::Mojibake' => '0', + 'Test::More' => '0.96', + 'Test::NoTabs' => '0', + 'Test::Pod' => '1.41', + 'Test::Pod::Coverage' => '1.08', + 'Test::Pod::No404s' => '0', + 'Test::Portability::Files' => '0', + 'blib' => '1.01', + 'perl' => '5.006' + } + }, + 'runtime' => { + 'requires' => { + 'Carp' => '0', + 'Fcntl' => '0', + 'File::Find' => '0', + 'File::Spec' => '0', + 'perl' => '5.006', + 'strict' => '0', + 'version' => '0.87', + 'warnings' => '0' + } + }, + 'test' => { + 'recommends' => { + 'CPAN::Meta' => '2.120900' + }, + 'requires' => { + 'Cwd' => '0', + 'Exporter' => '0', + 'ExtUtils::MakeMaker' => '0', + 'File::Basename' => '0', + 'File::Path' => '0', + 'File::Spec' => '0', + 'File::Temp' => '0', + 'IO::File' => '0', + 'Test::More' => '0.82', + 'base' => '0', + 'lib' => '0', + 'perl' => '5.006' + } + } + }; + $x; + } \ No newline at end of file diff --git a/t/00-report-prereqs.t b/t/00-report-prereqs.t new file mode 100644 index 0000000..324a51e --- /dev/null +++ b/t/00-report-prereqs.t @@ -0,0 +1,183 @@ +#!perl + +use strict; +use warnings; + +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.025 + +use Test::More tests => 1; + +use ExtUtils::MakeMaker; +use File::Spec; + +# from $version::LAX +my $lax_version_re = + qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? + | + (?:\.[0-9]+) (?:_[0-9]+)? + ) | (?: + v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? + | + (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? + ) + )/x; + +# hide optional CPAN::Meta modules from prereq scanner +# and check if they are available +my $cpan_meta = "CPAN::Meta"; +my $cpan_meta_pre = "CPAN::Meta::Prereqs"; +my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic + +# Verify requirements? +my $DO_VERIFY_PREREQS = 1; + +sub _max { + my $max = shift; + $max = ( $_ > $max ) ? $_ : $max for @_; + return $max; +} + +sub _merge_prereqs { + my ($collector, $prereqs) = @_; + + # CPAN::Meta::Prereqs object + if (ref $collector eq $cpan_meta_pre) { + return $collector->with_merged_prereqs( + CPAN::Meta::Prereqs->new( $prereqs ) + ); + } + + # Raw hashrefs + for my $phase ( keys %$prereqs ) { + for my $type ( keys %{ $prereqs->{$phase} } ) { + for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { + $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; + } + } + } + + return $collector; +} + +my @include = qw( + Pod::Coverage +); + +my @exclude = qw( + +); + +# Add static prereqs to the included modules list +my $static_prereqs = do 't/00-report-prereqs.dd'; + +# Merge all prereqs (either with ::Prereqs or a hashref) +my $full_prereqs = _merge_prereqs( + ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), + $static_prereqs +); + +# Add dynamic prereqs to the included modules list (if we can) +my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; +if ( $source && $HAS_CPAN_META + && (my $meta = eval { CPAN::Meta->load_file($source) } ) +) { + $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); +} +else { + $source = 'static metadata'; +} + +my @full_reports; +my @dep_errors; +my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; + +# Add static includes into a fake section +for my $mod (@include) { + $req_hash->{other}{modules}{$mod} = 0; +} + +for my $phase ( qw(configure build test runtime develop other) ) { + next unless $req_hash->{$phase}; + next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); + + for my $type ( qw(requires recommends suggests conflicts modules) ) { + next unless $req_hash->{$phase}{$type}; + + my $title = ucfirst($phase).' '.ucfirst($type); + my @reports = [qw/Module Want Have/]; + + for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { + next if $mod eq 'perl'; + next if grep { $_ eq $mod } @exclude; + + my $file = $mod; + $file =~ s{::}{/}g; + $file .= ".pm"; + my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; + + my $want = $req_hash->{$phase}{$type}{$mod}; + $want = "undef" unless defined $want; + $want = "any" if !$want && $want == 0; + + my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; + + if ($prefix) { + my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); + $have = "undef" unless defined $have; + push @reports, [$mod, $want, $have]; + + if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { + if ( $have !~ /\A$lax_version_re\z/ ) { + push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; + } + elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { + push @dep_errors, "$mod version '$have' is not in required range '$want'"; + } + } + } + else { + push @reports, [$mod, $want, "missing"]; + + if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { + push @dep_errors, "$mod is not installed ($req_string)"; + } + } + } + + if ( @reports ) { + push @full_reports, "=== $title ===\n\n"; + + my $ml = _max( map { length $_->[0] } @reports ); + my $wl = _max( map { length $_->[1] } @reports ); + my $hl = _max( map { length $_->[2] } @reports ); + + if ($type eq 'modules') { + splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; + } + else { + splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; + } + + push @full_reports, "\n"; + } + } +} + +if ( @full_reports ) { + diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; +} + +if ( @dep_errors ) { + diag join("\n", + "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", + "The following REQUIRED prerequisites were not satisfied:\n", + @dep_errors, + "\n" + ); +} + +pass; + +# vim: ts=4 sts=4 sw=4 et: diff --git a/t/contains_pod.t b/t/contains_pod.t new file mode 100644 index 0000000..d2b7c50 --- /dev/null +++ b/t/contains_pod.t @@ -0,0 +1,64 @@ +use strict; +use warnings; +use Test::More tests => 3; +use Module::Metadata; + +BEGIN { + *fh_from_string = "$]" < 5.008 + ? require IO::Scalar && sub ($) { + IO::Scalar->new(\$_[0]); + } + # hide in an eval'd string so Perl::MinimumVersion doesn't clutch its pearls + : eval <<'EVAL' + sub ($) { + open my $fh, '<', \$_[0]; + $fh + } +EVAL + ; +} + +{ + my $src = <<'...'; +package Foo; +1; +... + + my $fh = fh_from_string($src); + my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm'); + ok(!$module->contains_pod(), 'This module does not contains POD'); +} + +{ + my $src = <<'...'; +package Foo; +1; + +=head1 NAME + +Foo - bar +... + + my $fh = fh_from_string($src); + my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm'); + ok($module->contains_pod(), 'This module contains POD'); +} + +{ + my $src = <<'...'; +package Foo; +1; + +=head1 NAME + +Foo - bar + +=head1 AUTHORS + +Tokuhiro Matsuno +... + + my $fh = fh_from_string($src); + my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm'); + ok($module->contains_pod(), 'This module contains POD'); +} diff --git a/t/encoding.t b/t/encoding.t new file mode 100644 index 0000000..932614f --- /dev/null +++ b/t/encoding.t @@ -0,0 +1,31 @@ +#!perl + +use strict; +use warnings; +use File::Spec; +use Test::More; + +use Module::Metadata; + +if ("$]" < 5.008_003) { + plan skip_all => 'Encoding test needs at least perl 5.8.3'; +} + +my %versions = ( + UTF8 => 3, + UTF16BE => 4, + UTF16LE => 5, +); + +plan tests => 4 * scalar(keys %versions); + +for my $enc (sort keys %versions) { + my $pkg = "BOMTest::$enc"; + my $vers = $versions{$enc}; + my $pm = File::Spec->catfile(qw => "$enc.pm"); + my $info = Module::Metadata->new_from_file($pm); + is( $info->name, $pkg, "$enc: default package was found" ); + is( $info->version, $vers, "$enc: version for default package" ); + is( $info->version('Heart'), '1', 'version for ASCII package' ); + is( $info->version("C\x{153}ur"), '2', 'version for Unicode package' ); +} diff --git a/t/endpod.t b/t/endpod.t new file mode 100644 index 0000000..d37d815 --- /dev/null +++ b/t/endpod.t @@ -0,0 +1,10 @@ +use strict; +use warnings; +use Test::More tests => 2; +use Module::Metadata; + +# This test case tests about parsing pod after `__END__` token. + +my $pm_info = Module::Metadata->new_from_file('t/lib/ENDPOD.pm', collect_pod => 1,); +is( $pm_info->name, 'ENDPOD', 'found default package' ); +is(join(',', $pm_info->pod_inside), 'NAME'); diff --git a/t/extract-package.t b/t/extract-package.t new file mode 100644 index 0000000..44f4de9 --- /dev/null +++ b/t/extract-package.t @@ -0,0 +1,168 @@ +use strict; +use warnings; +# vim:ts=8:sw=2:et:sta:sts=2 + +use Test::More 0.82; +use Module::Metadata; + +use lib 't/lib'; +use GeneratePackage; + +# parse package names +# format: { +# name => test name +# code => code snippet (string) +# package => expected package names +# } +my @pkg_names = ( +{ + name => 'package NAME', + package => [ 'Simple' ], + code => <<'---', +package Simple; +--- +}, +{ + name => 'package NAME::SUBNAME', + package => [ 'Simple::Edward' ], + code => <<'---', +package Simple::Edward; +--- +}, +{ + name => 'package NAME::SUBNAME::', + package => [ 'Simple::Edward::' ], + code => <<'---', +package Simple::Edward::; +--- +}, +{ + name => "package NAME'SUBNAME", + package => [ "Simple'Edward" ], + code => <<'---', +package Simple'Edward; +--- +}, +{ + name => "package NAME'SUBNAME::", + package => [ "Simple'Edward::" ], + code => <<'---', +package Simple'Edward::; +--- +}, +{ + name => 'package NAME::::SUBNAME', + package => [ 'Simple::::Edward' ], + code => <<'---', +package Simple::::Edward; +--- +}, +{ + name => 'package ::NAME::SUBNAME', + package => [ '::Simple::Edward' ], + code => <<'---', +package ::Simple::Edward; +--- +}, +{ + name => 'package NAME:SUBNAME (fail)', + package => [ 'main' ], + code => <<'---', +package Simple:Edward; +--- +}, +{ + name => "package NAME' (fail)", + package => [ 'main' ], + code => <<'---', +package Simple'; +--- +}, +{ + name => "package NAME::SUBNAME' (fail)", + package => [ 'main' ], + code => <<'---', +package Simple::Edward'; +--- +}, +{ + name => "package NAME''SUBNAME (fail)", + package => [ 'main' ], + code => <<'---', +package Simple''Edward; +--- +}, +{ + name => 'package NAME-SUBNAME (fail)', + package => [ 'main' ], + code => <<'---', +package Simple-Edward; +--- +}, +{ + name => 'no assumption of package merely if its $VERSION is referenced', + package => [ 'Simple' ], + code => <<'---', +package Simple; +$Foo::Bar::VERSION = '1.23'; +--- +}, +{ + name => 'script 7 from t/metadata.t', # TODO merge these + package => [ '_private', 'main' ], + TODO => '$::VERSION indicates main namespace is referenced', + code => <<'---', +package _private; +$::VERSION = 0.01; +$VERSION = '999'; +--- +}, +{ + name => 'script 8 from t/metadata.t', # TODO merge these + package => [ '_private', 'main' ], + TODO => '$::VERSION indicates main namespace is referenced', + code => <<'---', +package _private; +$VERSION = '999'; +$::VERSION = 0.01; +--- +}, +); + +my $test_num = 0; + +my $tmpdir = GeneratePackage::tmpdir(); + +foreach my $test_case (@pkg_names) { + note '-------'; + note $test_case->{name}; + my $code = $test_case->{code}; + my $expected_name = $test_case->{package}; + + my $warnings = ''; + local $SIG{__WARN__} = sub { $warnings .= $_ for @_ }; + + my $pm_info = Module::Metadata->new_from_file(generate_file(File::Spec->catfile($tmpdir, "Simple${test_num}"), 'Simple.pm', $code)); + + # whenever we drop support for 5.6, we can do this: + # open my $fh, '<', \(encode('UTF-8', $code, Encode::FB_CROAK)) + # or die "cannot open handle to code string: $!"; + # my $pm_info = Module::Metadata->new_from_handle($fh, 'lib/Simple.pm'); + + # Test::Builder will prematurely numify objects, so use this form + my $errs; + my @got = $pm_info->packages_inside(); + { + local $TODO = $test_case->{TODO}; + is_deeply( \@got, $expected_name, + "case $test_case->{name}: correct package names (expected '" . join(', ', @$expected_name) . "')" ) + or $errs++; + } + is( $warnings, '', "case $test_case->{name}: no warnings from parsing" ) or $errs++; + diag "Got: '" . join(', ', @got) . "'\nModule contents:\n$code" if !$ENV{PERL_CORE} && $errs; +} +continue { + ++$test_num; +} + +done_testing; diff --git a/t/extract-version.t b/t/extract-version.t new file mode 100644 index 0000000..1a49be1 --- /dev/null +++ b/t/extract-version.t @@ -0,0 +1,700 @@ +use strict; +use warnings; +# vim:ts=8:sw=2:et:sta:sts=2 + +use Test::More 0.82; +use Module::Metadata; + +use lib 't/lib'; +use GeneratePackage; + +my $undef; + +# parse various module $VERSION lines +# format: { +# name => test name +# code => code snippet (string) +# vers => expected version object (in stringified form), +# } +my @modules = ( +{ + vers => $undef, + all_versions => {}, + name => 'no $VERSION line', + code => <<'---', +package Simple; +--- +}, +{ + vers => $undef, + all_versions => {}, + name => 'undefined $VERSION', + code => <<'---', +package Simple; +our $VERSION; +--- +}, +{ + vers => '1.23', + all_versions => { Simple => '1.23' }, + name => 'declared & defined on same line with "our"', + code => <<'---', +package Simple; +our $VERSION = '1.23'; +--- +}, +{ + vers => '1.23', + all_versions => { Simple => '1.23' }, + name => 'declared & defined on separate lines with "our"', + code => <<'---', +package Simple; +our $VERSION; +$VERSION = '1.23'; +--- +}, +{ + name => 'commented & defined on same line', + code => <<'---', +package Simple; +our $VERSION = '1.23'; # our $VERSION = '4.56'; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'commented & defined on separate lines', + code => <<'---', +package Simple; +# our $VERSION = '4.56'; +our $VERSION = '1.23'; +--- + vers =>'1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'use vars', + code => <<'---', +package Simple; +use vars qw( $VERSION ); +$VERSION = '1.23'; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'choose the right default package based on package/file name', + code => <<'---', +package Simple::_private; +$VERSION = '0'; +package Simple; +$VERSION = '1.23'; # this should be chosen for version +--- + vers => '1.23', + all_versions => { 'Simple' => '1.23', 'Simple::_private' => '0' }, +}, +{ + name => 'just read the first $VERSION line', + code => <<'---', +package Simple; +$VERSION = '1.23'; # we should see this line +$VERSION = eval $VERSION; # and ignore this one +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'just read the first $VERSION line in reopened package (1)', + code => <<'---', +package Simple; +$VERSION = '1.23'; +package Error::Simple; +$VERSION = '2.34'; +package Simple; +--- + vers => '1.23', + all_versions => { 'Error::Simple' => '2.34', Simple => '1.23' }, +}, +{ + name => 'just read the first $VERSION line in reopened package (2)', + code => <<'---', +package Simple; +package Error::Simple; +$VERSION = '2.34'; +package Simple; +$VERSION = '1.23'; +--- + vers => '1.23', + all_versions => { 'Error::Simple' => '2.34', Simple => '1.23' }, +}, +{ + name => 'mentions another module\'s $VERSION', + code => <<'---', +package Simple; +$VERSION = '1.23'; +if ( $Other::VERSION ) { + # whatever +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'mentions another module\'s $VERSION in a different package', + code => <<'---', +package Simple; +$VERSION = '1.23'; +package Simple2; +if ( $Simple::VERSION ) { + # whatever +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION checked only in assignments, not regexp ops', + code => <<'---', +package Simple; +$VERSION = '1.23'; +if ( $VERSION =~ /1\.23/ ) { + # whatever +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION checked only in assignments, not relational ops (1)', + code => <<'---', +package Simple; +$VERSION = '1.23'; +if ( $VERSION == 3.45 ) { + # whatever +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION checked only in assignments, not relational ops (2)', + code => <<'---', +package Simple; +$VERSION = '1.23'; +package Simple2; +if ( $Simple::VERSION == 3.45 ) { + # whatever +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'Fully qualified $VERSION declared in package', + code => <<'---', +package Simple; +$Simple::VERSION = 1.23; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'Differentiate fully qualified $VERSION in a package', + code => <<'---', +package Simple; +$Simple2::VERSION = '999'; +$Simple::VERSION = 1.23; +--- + vers => '1.23', + all_versions => { Simple => '1.23', Simple2 => '999' }, +}, +{ + name => 'Differentiate fully qualified $VERSION and unqualified', + code => <<'---', +package Simple; +$Simple2::VERSION = '999'; +$VERSION = 1.23; +--- + vers => '1.23', + all_versions => { Simple => '1.23', Simple2 => '999' }, +}, +{ + name => 'Differentiate fully qualified $VERSION and unqualified, other order', + code => <<'---', +package Simple; +$VERSION = 1.23; +$Simple2::VERSION = '999'; +--- + vers => '1.23', + all_versions => { Simple => '1.23', Simple2 => '999' }, +}, +{ + name => '$VERSION declared as package variable from within "main" package', + code => <<'---', +$Simple::VERSION = '1.23'; +{ + package Simple; + $x = $y, $cats = $dogs; +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION wrapped in parens - space inside', + code => <<'---', +package Simple; +( $VERSION ) = '1.23'; +--- + '1.23' => <<'---', # $VERSION wrapped in parens - no space inside +package Simple; +($VERSION) = '1.23'; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION follows a spurious "package" in a quoted construct', + code => <<'---', +package Simple; +__PACKAGE__->mk_accessors(qw( + program socket proc + package filename line codeline subroutine finished)); + +our $VERSION = "1.23"; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION using version.pm', + code => <<'---', + package Simple; + use version; our $VERSION = version->new('1.23'); +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => '$VERSION using version.pm and qv()', + code => <<'---', + package Simple; + use version; our $VERSION = qv('1.230'); +--- + vers => 'v1.230', + all_versions => { Simple => 'v1.230' }, +}, +{ + name => 'underscore version with an eval', + code => <<'---', + package Simple; + $VERSION = '1.23_01'; + $VERSION = eval $VERSION; +--- + vers => '1.23_01', + all_versions => { Simple => '1.23_01' }, +}, +{ + name => 'Two version assignments, no package', + code => <<'---', + $Simple::VERSION = '1.230'; + $Simple::VERSION = eval $Simple::VERSION; +--- + vers => $undef, + all_versions => { Simple => '1.230' }, +}, +{ + name => 'Two version assignments, should ignore second one', + code => <<'---', +package Simple; + $Simple::VERSION = '1.230'; + $Simple::VERSION = eval $Simple::VERSION; +--- + vers => '1.230', + all_versions => { Simple => '1.230' }, +}, +{ + name => 'declared & defined on same line with "our"', + code => <<'---', +package Simple; +our $VERSION = '1.23_00_00'; +--- + vers => '1.230000', + all_versions => { Simple => '1.230000' }, +}, +{ + name => 'package NAME VERSION', + code => <<'---', + package Simple 1.23; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'package NAME VERSION', + code => <<'---', + package Simple 1.23_01; +--- + vers => '1.23_01', + all_versions => { Simple => '1.23_01' }, +}, +{ + name => 'package NAME VERSION', + code => <<'---', + package Simple v1.2.3; +--- + vers => 'v1.2.3', + all_versions => { Simple => 'v1.2.3' }, +}, +{ + name => 'package NAME VERSION', + code => <<'---', + package Simple v1.2_3; +--- + vers => 'v1.2_3', + all_versions => { Simple => 'v1.2_3' }, +}, +{ + name => 'trailing crud', + code => <<'---', + package Simple; + our $VERSION; + $VERSION = '1.23-alpha'; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'trailing crud', + code => <<'---', + package Simple; + our $VERSION; + $VERSION = '1.23b'; +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'multi_underscore', + code => <<'---', + package Simple; + our $VERSION; + $VERSION = '1.2_3_4'; +--- + vers => '1.234', + all_versions => { Simple => '1.234' }, +}, +{ + name => 'non-numeric', + code => <<'---', + package Simple; + our $VERSION; + $VERSION = 'onetwothree'; +--- + vers => '0', + all_versions => { Simple => '0' }, +}, +{ + name => 'package NAME BLOCK, undef $VERSION', + code => <<'---', +package Simple { + our $VERSION; +} +--- + vers => $undef, + all_versions => {}, +}, +{ + name => 'package NAME BLOCK, with $VERSION', + code => <<'---', +package Simple { + our $VERSION = '1.23'; +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'package NAME VERSION BLOCK (1)', + code => <<'---', +package Simple 1.23 { + 1; +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, +}, +{ + name => 'package NAME VERSION BLOCK (2)', + code => <<'---', +package Simple v1.2.3_4 { + 1; +} +--- + vers => 'v1.2.3_4', + all_versions => { Simple => 'v1.2.3_4' }, +}, +{ + name => 'set from separately-initialised variable, two lines', + code => <<'---', +package Simple; + our $CVSVERSION = '$Revision: 1.7 $'; + our ($VERSION) = ($CVSVERSION =~ /(\d+\.\d+)/); +} +--- + vers => '0', + all_versions => { Simple => '0' }, +}, +{ + name => 'our + bare v-string', + code => <<'---', +package Simple; +our $VERSION = v2.2.102.2; +--- + vers => 'v2.2.102.2', + all_versions => { Simple => 'v2.2.102.2' }, +}, +{ + name => 'our + dev release', + code => <<'---', +package Simple; +our $VERSION = "0.0.9_1"; +--- + vers => '0.0.9_1', + all_versions => { Simple => '0.0.9_1' }, +}, +{ + name => 'our + crazy string and substitution code', + code => <<'---', +package Simple; +our $VERSION = '1.12.B55J2qn'; our $WTF = $VERSION; $WTF =~ s/^\d+\.\d+\.//; # attempts to rationalize $WTF go here. +--- + vers => '1.12', + all_versions => { Simple => '1.12' }, +}, +{ + name => 'our in braces, as in Dist::Zilla::Plugin::PkgVersion with use_our = 1', + code => <<'---', +package Simple; +{ our $VERSION = '1.12'; } +--- + vers => '1.12', + all_versions => { Simple => '1.12' }, +}, +{ + name => 'calculated version - from Acme-Pi-3.14', + code => <<'---', +package Simple; +my $version = atan2(1,1) * 4; $Simple::VERSION = "$version"; +1; +--- + vers => sub { defined $_[0] and $_[0] =~ /^3\.14159/ }, + all_versions => sub { ref $_[0] eq 'HASH' + and keys %{$_[0]} == 1 + and (keys%{$_[0]})[0] eq 'Simple' + and (values %{$_[0]})[0] =~ /^3\.14159/ + }, +}, +{ + name => 'set from separately-initialised variable, one line', + code => <<'---', +package Simple; + my $CVSVERSION = '$Revision: 1.7 $'; our ($VERSION) = ($CVSVERSION =~ /(\d+\.\d+)/); +} +--- + vers => '1.7', + all_versions => { Simple => '1.7' }, +}, +{ + name => 'from Lingua-StopWords-0.09/devel/gen_modules.plx', + code => <<'---', +package Foo; +our $VERSION = $Bar::VERSION; +--- + vers => $undef, + all_versions => { Foo => '0' }, +}, +{ + name => 'from XML-XSH2-2.1.17/lib/XML/XSH2/Parser.pm', + code => <<'---', +our $VERSION = # Hide from PAUSE + '1.967009'; +$VERSION = eval $VERSION; +--- + vers => $undef, + all_versions => { main => '0' }, +}, +{ + name => 'from MBARBON/Module-Info-0.30.tar.gz', + code => <<'---', +package Simple; +$VERSION = eval 'use version; 1' ? 'version'->new('0.30') : '0.30'; +--- + vers => '0.30', + all_versions => { Simple => '0.30' }, +}, +{ + name => '$VERSION inside BEGIN block', + code => <<'---', +package Simple; + BEGIN { $VERSION = '1.23' } +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, + TODO_scalar => 'apply fix from ExtUtils-MakeMaker PR#135', + TODO_all_versions => 'apply fix from ExtUtils-MakeMaker PR#135', +}, +{ + name => 'our $VERSION inside BEGIN block', + code => <<'---', + '1.23' => <<'---', # our + BEGIN +package Simple; + BEGIN { our $VERSION = '1.23' } +} +--- + vers => '1.23', + all_versions => { Simple => '1.23' }, + TODO_scalar => 'apply fix from ExtUtils-MakeMaker PR#135', + TODO_all_versions => 'apply fix from ExtUtils-MakeMaker PR#135', +}, +{ + name => 'no assumption of primary version merely if a package\'s $VERSION is referenced', + code => <<'---', +package Simple; +$Foo::Bar::VERSION = '1.23'; +--- + vers => undef, + all_versions => { 'Foo::Bar' => '1.23' }, +}, +{ + name => 'no package statement; bare $VERSION', + code => <<'---', +$VERSION = '1.23'; +--- + vers => undef, + all_versions => { '____caller' => '1.23' }, + TODO_all_versions => 'FIXME! RT#74741', +}, +{ + name => 'no package statement; bare $VERSION with our', + code => <<'---', +our $VERSION = '1.23'; +--- + vers => undef, + all_versions => { '____caller' => '1.23' }, + TODO_all_versions => 'FIXME! RT#74741', +}, +{ + name => 'no package statement; fully-qualified $VERSION for main', + code => <<'---', +$::VERSION = '1.23'; +--- + vers => undef, + all_versions => { 'main' => '1.23' }, +}, +{ + name => 'no package statement; fully-qualified $VERSION for other package', + code => <<'---', +$Foo::Bar::VERSION = '1.23'; +--- + vers => undef, + all_versions => { 'Foo::Bar' => '1.23' }, +}, +{ + name => 'package statement that does not quite match the filename', + filename => 'Simple.pm', + code => <<'---', +package ThisIsNotSimple; +our $VERSION = '1.23'; +--- + vers => $undef, + all_versions => { 'ThisIsNotSimple' => '1.23' }, +}, +); + +my $test_num = 0; + +my $tmpdir = GeneratePackage::tmpdir(); + +# iterate through @modules +foreach my $test_case (@modules) { + note '-------'; + note $test_case->{name}; + my $code = $test_case->{code}; + my $expected_version = $test_case->{vers}; + + SKIP: { + skip( "No our() support until perl 5.6", (defined $expected_version ? 3 : 2) ) + if "$]" < 5.006 && $code =~ /\bour\b/; + skip( "No package NAME VERSION support until perl 5.11.1", (defined $expected_version ? 3 : 2) ) + if "$]" < 5.011001 && $code =~ /package\s+[\w\:\']+\s+v?[0-9._]+/; + + my $warnings = ''; + local $SIG{__WARN__} = sub { $warnings .= $_ for @_ }; + + my $pm_info = Module::Metadata->new_from_file(generate_file(File::Spec->catfile($tmpdir, "Simple${test_num}"), 'Simple.pm', $code)); + + # whenever we drop support for 5.6, we can do this: + # open my $fh, '<', \(encode('UTF-8', $code, Encode::FB_CROAK)) + # or die "cannot open handle to code string: $!"; + # my $pm_info = Module::Metadata->new_from_handle($fh, 'lib/Simple.pm'); + + my $errs; + my $got = $pm_info->version; + + # note that in Test::More 0.94 and earlier, is() stringifies first before comparing; + # from 0.95_01 and later, it just lets the objects figure out how to handle 'eq' + # We want to ensure we preserve the original, as long as it's legal, so we + # explicitly check the stringified form. + { + local $TODO = !defined($got) && ($test_case->{TODO_code_sub} || $test_case->{TODO_scalar}); + isa_ok($got, 'version') or $errs++ if defined $expected_version; + } + + if (ref($expected_version) eq 'CODE') { + local $TODO = $test_case->{TODO_code_sub}; + ok( + $expected_version->($got), + "case '$test_case->{name}': module version passes match sub" + ) + or $errs++; + } + else { + local $TODO = $test_case->{TODO_scalar}; + is( + (defined $got ? "$got" : $got), + $expected_version, + "case '$test_case->{name}': correct module version (" + . (defined $expected_version? "'$expected_version'" : 'undef') + . ')' + ) + or $errs++; + } + + if (exists $test_case->{all_versions}) { + local $TODO = $test_case->{TODO_all_versions}; + if (ref($expected_version) eq 'CODE') { + ok( + $test_case->{all_versions}->($pm_info->{versions}), + "case '$test_case->{name}': all extracted versions passes match sub" + ) or $errs++; + } + else { + is_deeply( + $pm_info->{versions}, + $test_case->{all_versions}, + 'correctly found all $VERSIONs', + ) or $errs++; + } + } + + is( $warnings, '', "case '$test_case->{name}': no warnings from parsing" ) or $errs++; + diag 'parsed module: ', explain($pm_info) if !$ENV{PERL_CORE} && $errs; + } +} +continue { + ++$test_num; +} + +done_testing; diff --git a/t/lib/0_1/Foo.pm b/t/lib/0_1/Foo.pm new file mode 100644 index 0000000..f1ecaca --- /dev/null +++ b/t/lib/0_1/Foo.pm @@ -0,0 +1,3 @@ +package Foo; +$Foo::VERSION = '0.1'; +1; diff --git a/t/lib/0_2/Foo.pm b/t/lib/0_2/Foo.pm new file mode 100644 index 0000000..8f8ef06 --- /dev/null +++ b/t/lib/0_2/Foo.pm @@ -0,0 +1,3 @@ +package Foo; +$Foo::VERSION = '0.2'; +1; diff --git a/t/lib/ENDPOD.pm b/t/lib/ENDPOD.pm new file mode 100644 index 0000000..e43e07b --- /dev/null +++ b/t/lib/ENDPOD.pm @@ -0,0 +1,12 @@ +package ENDPOD; +use strict; +use warnings; + + +1; +__END__ + +=head1 NAME + +ENDPOD - End pod. + diff --git a/t/lib/GeneratePackage.pm b/t/lib/GeneratePackage.pm new file mode 100644 index 0000000..07c92d3 --- /dev/null +++ b/t/lib/GeneratePackage.pm @@ -0,0 +1,38 @@ +use strict; +use warnings; +package GeneratePackage; +# vim:ts=8:sw=2:et:sta:sts=2 + +use base 'Exporter'; +our @EXPORT = qw(tmpdir generate_file); + +use Cwd; +use File::Spec; +use File::Path; +use File::Temp; +use IO::File; + +sub tmpdir { + File::Temp::tempdir( + 'MMD-XXXXXXXX', + CLEANUP => 1, + DIR => ($ENV{PERL_CORE} ? File::Spec->rel2abs(Cwd::cwd) : File::Spec->tmpdir), + ); +} + +sub generate_file { + my ($dir, $rel_filename, $content) = @_; + + File::Path::mkpath($dir) or die "failed to create '$dir'"; + my $abs_filename = File::Spec->catfile($dir, $rel_filename); + + Test::More::note("working on $abs_filename"); + + my $fh = IO::File->new(">$abs_filename") or die "Can't write '$abs_filename'\n"; + print $fh $content; + close $fh; + + return $abs_filename; +} + +1; diff --git a/t/metadata.t b/t/metadata.t new file mode 100644 index 0000000..5dee700 --- /dev/null +++ b/t/metadata.t @@ -0,0 +1,548 @@ +# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- +# vim:ts=8:sw=2:et:sta:sts=2 + +use strict; +use warnings; +use Test::More 0.82; +use IO::File; +use File::Spec; +use File::Temp; +use File::Basename; +use Cwd (); +use File::Path; + +plan tests => 70; + +require_ok('Module::Metadata'); + +{ + # class method C + my $module = Module::Metadata->find_module_by_name( + 'Module::Metadata' ); + ok( -e $module, 'find_module_by_name() succeeds' ); +} + +######################### + +BEGIN { + my $cwd = File::Spec->rel2abs(Cwd::cwd); + sub original_cwd { return $cwd } +} + +# Set up a temp directory +sub tmpdir { + my (@args) = @_; + my $dir = $ENV{PERL_CORE} ? original_cwd : File::Spec->tmpdir; + return File::Temp::tempdir('MMD-XXXXXXXX', CLEANUP => 0, DIR => $dir, @args); +} + +my $tmp; +BEGIN { $tmp = tmpdir; note "using temp dir $tmp"; } + +END { + die "tests failed; leaving temp dir $tmp behind" + if $ENV{AUTHOR_TESTING} and not Test::Builder->new->is_passing; + note "removing temp dir $tmp"; + chdir original_cwd; + File::Path::rmtree($tmp); +} + +# generates a new distribution: +# files => { relative filename => $content ... } +# returns the name of the distribution (not including version), +# and the absolute path name to the dist. +{ + my $test_num = 0; + sub new_dist { + my %opts = @_; + + my $distname = 'Simple' . $test_num++; + my $distdir = File::Spec->catdir($tmp, $distname); + note "using dist $distname in $distdir"; + + File::Path::mkpath($distdir) or die "failed to create '$distdir'"; + + foreach my $rel_filename (keys %{$opts{files}}) + { + my $abs_filename = File::Spec->catfile($distdir, $rel_filename); + my $dirname = File::Basename::dirname($abs_filename); + unless (-d $dirname) { + File::Path::mkpath($dirname) or die "Can't create '$dirname'"; + } + + note "creating $abs_filename"; + my $fh = IO::File->new(">$abs_filename") or die "Can't write '$abs_filename'\n"; + print $fh $opts{files}{$rel_filename}; + close $fh; + } + + chdir $distdir; + return ($distname, $distdir); + } +} + +{ + # fail on invalid module name + my $pm_info = Module::Metadata->new_from_module( + 'Foo::Bar', inc => [] ); + ok( !defined( $pm_info ), 'fail if can\'t find module by module name' ); +} + +{ + # fail on invalid filename + my $file = File::Spec->catfile( 'Foo', 'Bar.pm' ); + my $pm_info = Module::Metadata->new_from_file( $file, inc => [] ); + ok( !defined( $pm_info ), 'fail if can\'t find module by file name' ); +} + +{ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => "package Simple;\n" }); + + # construct from module filename + my $pm_info = Module::Metadata->new_from_file( $file ); + ok( defined( $pm_info ), 'new_from_file() succeeds' ); + + # construct from filehandle + my $handle = IO::File->new($file); + $pm_info = Module::Metadata->new_from_handle( $handle, $file ); + ok( defined( $pm_info ), 'new_from_handle() succeeds' ); + $pm_info = Module::Metadata->new_from_handle( $handle ); + is( $pm_info, undef, "new_from_handle() without filename returns undef" ); + close($handle); +} + +{ + # construct from module name, using custom include path + my $pm_info = Module::Metadata->new_from_module( + 'Simple', inc => [ 'lib', @INC ] ); + ok( defined( $pm_info ), 'new_from_module() succeeds' ); +} + + +{ + # Find each package only once + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; +$VERSION = '1.23'; +package Error::Simple; +$VERSION = '2.34'; +package Simple; +--- + + my $pm_info = Module::Metadata->new_from_file( $file ); + + my @packages = $pm_info->packages_inside; + is( @packages, 2, 'record only one occurence of each package' ); +} + +{ + # Module 'Simple.pm' does not contain package 'Simple'; + # constructor should not complain, no default module name or version + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple::Not; +$VERSION = '1.23'; +--- + + my $pm_info = Module::Metadata->new_from_file( $file ); + + is( $pm_info->name, undef, 'no default package' ); + is( $pm_info->version, undef, 'no version w/o default package' ); +} + +# parse $VERSION lines scripts for package main +my @scripts = ( + <<'---', # package main declared +#!perl -w +package main; +$VERSION = '0.01'; +--- + <<'---', # on first non-comment line, non declared package main +#!perl -w +$VERSION = '0.01'; +--- + <<'---', # after non-comment line +#!perl -w +use strict; +$VERSION = '0.01'; +--- + <<'---', # 1st declared package +#!perl -w +package main; +$VERSION = '0.01'; +package _private; +$VERSION = '999'; +--- + <<'---', # 2nd declared package +#!perl -w +package _private; +$VERSION = '999'; +package main; +$VERSION = '0.01'; +--- + <<'---', # split package +#!perl -w +package main; +package _private; +$VERSION = '999'; +package main; +$VERSION = '0.01'; +--- + <<'---', # define 'main' version from other package +package _private; +$::VERSION = 0.01; +$VERSION = '999'; +--- + <<'---', # define 'main' version from other package +package _private; +$VERSION = '999'; +$::VERSION = 0.01; +--- +); + +my ( $i, $n ) = ( 1, scalar( @scripts ) ); +foreach my $script ( @scripts ) { + note '-------'; + my $errs; + my $file = File::Spec->catfile('bin', 'simple.plx'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => $script } ); + my $pm_info = Module::Metadata->new_from_file( $file ); + + is( $pm_info->name, 'main', 'name for script is always main'); + is( $pm_info->version, '0.01', "correct script version ($i of $n)" ) or $errs++; + $i++; + + diag 'parsed module: ', explain($pm_info) if !$ENV{PERL_CORE} && $errs; +} + +{ + # examine properties of a module: name, pod, etc + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; +$VERSION = '0.01'; +package Simple::Ex; +$VERSION = '0.02'; + +=head1 NAME + +Simple - It's easy. + +=head1 AUTHOR + +Simple Simon + +You can find me on the IRC channel +#simon on irc.perl.org. + +=cut +--- + + my $pm_info = Module::Metadata->new_from_module( + 'Simple', inc => [ 'lib', @INC ] ); + + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '0.01', 'version for default package' ); + + # got correct version for secondary package + is( $pm_info->version( 'Simple::Ex' ), '0.02', + 'version for secondary package' ); + + my $filename = $pm_info->filename; + ok( defined( $filename ) && -e $filename, + 'filename() returns valid path to module file' ); + + my @packages = $pm_info->packages_inside; + is( @packages, 2, 'found correct number of packages' ); + is( $packages[0], 'Simple', 'packages stored in order found' ); + + # we can detect presence of pod regardless of whether we are collecting it + ok( $pm_info->contains_pod, 'contains_pod() succeeds' ); + + my @pod = $pm_info->pod_inside; + is_deeply( \@pod, [qw(NAME AUTHOR)], 'found all pod sections' ); + + is( $pm_info->pod('NONE') , undef, + 'return undef() if pod section not present' ); + + is( $pm_info->pod('NAME'), undef, + 'return undef() if pod section not collected' ); + + + # collect_pod + $pm_info = Module::Metadata->new_from_module( + 'Simple', inc => [ 'lib', @INC ], collect_pod => 1 ); + + my %pod; + for my $section (qw(NAME AUTHOR)) { + my $content = $pm_info->pod( $section ); + if ( $content ) { + $content =~ s/^\s+//; + $content =~ s/\s+$//; + } + $pod{$section} = $content; + } + my %expected = ( + NAME => q|Simple - It's easy.|, + AUTHOR => <<'EXPECTED' +Simple Simon + +You can find me on the IRC channel +#simon on irc.perl.org. +EXPECTED + ); + for my $text (values %expected) { + $text =~ s/^\s+//; + $text =~ s/\s+$//; + } + is( $pod{NAME}, $expected{NAME}, 'collected NAME pod section' ); + is( $pod{AUTHOR}, $expected{AUTHOR}, 'collected AUTHOR pod section' ); +} + +{ + # test things that look like POD, but aren't + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; + +=YES THIS STARTS POD + +our $VERSION = '999'; + +=cute + +our $VERSION = '666'; + +=cut + +*foo +=*no_this_does_not_start_pod; + +our $VERSION = '1.23'; + +--- + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '1.23', 'version for default package' ); +} + +my $tmpdir = GeneratePackage::tmpdir(); +my $undef; +my $test_num = 0; +use lib 't/lib'; +use GeneratePackage; + +{ + # and now a real pod file + # (this test case is ready to be rolled into a corpus loop, later) + my $test_case = { + name => 'file only contains pod', + filename => 'Simple/Documentation.pod', + code => <<'---', +# PODNAME: Simple::Documentation +# ABSTRACT: My documentation + +=pod + +Hello, this is pod. + +=cut +--- + module => '', # TODO: should probably be $undef actually + all_versions => { }, + }; + + note $test_case->{name}; + my $code = $test_case->{code}; + my $expected_name = $test_case->{module}; + local $TODO = $test_case->{TODO}; + + my $errs; + + my ($vol, $dir, $basename) = File::Spec->splitpath(File::Spec->catfile($tmpdir, "Simple${test_num}", ($test_case->{filename} || 'Simple.pm'))); + my $pm_info = Module::Metadata->new_from_file(generate_file($dir, $basename, $code)); + + my $got_name = $pm_info->name; + is( + $got_name, + $expected_name, + "case '$test_case->{name}': module name matches", + ) + or $errs++; + + diag 'parsed module: ', explain($pm_info) if !$ENV{PERL_CORE} && $errs; +} + +{ + # Make sure processing stops after __DATA__ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; +$VERSION = '0.01'; +__DATA__ +*UNIVERSAL::VERSION = sub { + foo(); +}; +--- + + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '0.01', 'version for default package' ); + my @packages = $pm_info->packages_inside; + is_deeply(\@packages, ['Simple'], 'packages inside'); +} + +{ + # Make sure we handle version.pm $VERSIONs well + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; +$VERSION = version->new('0.60.' . (qw$Revision: 128 $)[1]); +package Simple::Simon; +$VERSION = version->new('0.61.' . (qw$Revision: 129 $)[1]); +--- + + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '0.60.128', 'version for default package' ); + my @packages = $pm_info->packages_inside; + is_deeply([sort @packages], ['Simple', 'Simple::Simon'], 'packages inside'); + is( $pm_info->version('Simple::Simon'), '0.61.129', 'version for embedded package' ); +} + +# check that package_versions_from_directory works + +{ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package Simple; +$VERSION = '0.01'; +package Simple::Ex; +$VERSION = '0.02'; +{ + package main; # should ignore this +} +{ + package DB; # should ignore this +} +{ + package Simple::_private; # should ignore this +} + +=head1 NAME + +Simple - It's easy. + +=head1 AUTHOR + +Simple Simon + +=cut +--- + + my $exp_pvfd = { + 'Simple' => { + 'file' => 'Simple.pm', + 'version' => '0.01' + }, + 'Simple::Ex' => { + 'file' => 'Simple.pm', + 'version' => '0.02' + } + }; + + my $got_pvfd = Module::Metadata->package_versions_from_directory('lib'); + + is_deeply( $got_pvfd, $exp_pvfd, "package_version_from_directory()" ) + or diag explain $got_pvfd; + +{ + my $got_provides = Module::Metadata->provides(dir => 'lib', version => 2); + my $exp_provides = { + 'Simple' => { + 'file' => 'lib/Simple.pm', + 'version' => '0.01' + }, + 'Simple::Ex' => { + 'file' => 'lib/Simple.pm', + 'version' => '0.02' + } + }; + + is_deeply( $got_provides, $exp_provides, "provides()" ) + or diag explain $got_provides; +} + +{ + my $got_provides = Module::Metadata->provides(dir => 'lib', prefix => 'other', version => 1.4); + my $exp_provides = { + 'Simple' => { + 'file' => 'other/Simple.pm', + 'version' => '0.01' + }, + 'Simple::Ex' => { + 'file' => 'other/Simple.pm', + 'version' => '0.02' + } + }; + + is_deeply( $got_provides, $exp_provides, "provides()" ) + or diag explain $got_provides; +} +} + +# Check package_versions_from_directory with regard to case-sensitivity +{ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package simple; +$VERSION = '0.01'; +--- + + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, undef, 'no default package' ); + is( $pm_info->version, undef, 'version for default package' ); + is( $pm_info->version('simple'), '0.01', 'version for lower-case package' ); + is( $pm_info->version('Simple'), undef, 'version for capitalized package' ); + ok( $pm_info->is_indexable(), 'an indexable package is found' ); + ok( $pm_info->is_indexable('simple'), 'the simple package is indexable' ); + ok( !$pm_info->is_indexable('Simple'), 'the Simple package would not be indexed' ); +} + +{ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package simple; +$VERSION = '0.01'; +package Simple; +$VERSION = '0.02'; +package SiMpLe; +$VERSION = '0.03'; +--- + + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '0.02', 'version for default package' ); + is( $pm_info->version('simple'), '0.01', 'version for lower-case package' ); + is( $pm_info->version('Simple'), '0.02', 'version for capitalized package' ); + is( $pm_info->version('SiMpLe'), '0.03', 'version for mixed-case package' ); + ok( $pm_info->is_indexable('simple'), 'the simple package is indexable' ); + ok( $pm_info->is_indexable('Simple'), 'the Simple package is indexable' ); +} + +{ + my $file = File::Spec->catfile('lib', 'Simple.pm'); + my ($dist_name, $dist_dir) = new_dist(files => { $file => <<'---' } ); +package ## hide from PAUSE + simple; +$VERSION = '0.01'; +--- + + my $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, undef, 'no package names found' ); + ok( !$pm_info->is_indexable('simple'), 'the simple package would not be indexed' ); + ok( !$pm_info->is_indexable('Simple'), 'the Simple package would not be indexed' ); + ok( !$pm_info->is_indexable(), 'no indexable package is found' ); +} diff --git a/t/taint.t b/t/taint.t new file mode 100644 index 0000000..18f0300 --- /dev/null +++ b/t/taint.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl -T +use strict; +use warnings; + +use Config; +use Test::More $Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/ + ? ( skip_all => 'No taint support' ) : ( tests => 2 ); +use Module::Metadata; +use Carp 'croak'; + +# stolen liberally from Class-Tiny/t/lib/TestUtils.pm - thanks xdg! +sub exception(&) { + my $code = shift; + my $success = eval { $code->(); 1 }; + my $err = $@; + return undef if $success; # original returned '' + croak "Execution died, but the error was lost" unless $@; + return $@; +} + +my $taint_on = ! eval { no warnings; join('',values %ENV), kill 0; 1; }; +ok($taint_on, 'taint flag is set'); + +# without the fix, we get: +# Insecure dependency in eval while running with -T switch at lib/Module/Metadata.pm line 668, line 15. +is( + exception { Module::Metadata->new_from_module( "Module::Metadata" )->version }, + undef, + 'no exception', +); + diff --git a/t/version.t b/t/version.t new file mode 100644 index 0000000..f97a19d --- /dev/null +++ b/t/version.t @@ -0,0 +1,24 @@ +use strict; +use warnings; +use Test::More; +use Module::Metadata; +use lib "t/lib/0_2"; + +plan tests => 4; + +require Foo; +is($Foo::VERSION, 0.2, 'affirmed version of loaded module'); + +my $meta = Module::Metadata->new_from_module("Foo", inc => [ "t/lib/0_1" ] ); +is($meta->version, 0.1, 'extracted proper version from scanned module'); + +is($Foo::VERSION, 0.2, 'loaded module still retains its version'); + +ok(eval "use Foo 0.2; 1", 'successfully loaded module again') + or diag 'got exception: ', $@; + + + + + + diff --git a/weaver.ini b/weaver.ini new file mode 100644 index 0000000..177d3f9 --- /dev/null +++ b/weaver.ini @@ -0,0 +1,9 @@ +[@Author::ETHER] + +[AllowOverride / OverrideAuthors] +header_re = ^AUTHORS?$ +match_anywhere = 1 + +[AllowOverride / OverrideLegal] +header_re = ^COPYRIGHT +match_anywhere = 1 diff --git a/xt/author/00-compile.t b/xt/author/00-compile.t new file mode 100644 index 0000000..38937cc --- /dev/null +++ b/xt/author/00-compile.t @@ -0,0 +1,54 @@ +use 5.006; +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 + +use Test::More 0.94; + +plan tests => 2; + +my @module_files = ( + 'Module/Metadata.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"); + + shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ + and not eval { require blib; blib->VERSION('1.01') }; + + if (@_warnings) + { + warn @_warnings; + push @warnings, @_warnings; + } +} + + + +is(scalar(@warnings), 0, 'no warnings found') + or diag 'got warnings: ', explain(\@warnings); + +BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; diff --git a/xt/author/compat_lc.t b/xt/author/compat_lc.t new file mode 100644 index 0000000..66dfa44 --- /dev/null +++ b/xt/author/compat_lc.t @@ -0,0 +1,31 @@ + +use strict; +use warnings; + +use Test::More; + +# ABSTRACT: Make sure not to fail if Log::Contextual is accidentally uninitialised + +BEGIN { + eval { require "Log/Contextual.pm"; 1 } + or plan skip_all => "Log::Contexual required installed for this test"; +} + +use Module::Metadata; + +my ( $ok, $error ) = do { + local $@; + my $rval = eval { + package Module::Metadata; # Required because "default" applies to caller context + # So this test is mimicing internal calls + Module::Metadata::log_info { "something" }; + 1; + }; + ( $rval, $@ ); +}; + +ok( $ok, "Log::Contextual being loaded didn't cause an explosion" ) + or note $error; + +done_testing; + diff --git a/xt/author/eol.t b/xt/author/eol.t new file mode 100644 index 0000000..4edeed9 --- /dev/null +++ b/xt/author/eol.t @@ -0,0 +1,42 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 + +use Test::More 0.88; +use Test::EOL; + +my @files = ( + 'lib/Module/Metadata.pm', + 't/00-report-prereqs.dd', + 't/00-report-prereqs.t', + 't/contains_pod.t', + 't/encoding.t', + 't/endpod.t', + 't/extract-package.t', + 't/extract-version.t', + 't/lib/0_1/Foo.pm', + 't/lib/0_2/Foo.pm', + 't/lib/ENDPOD.pm', + 't/lib/GeneratePackage.pm', + 't/metadata.t', + 't/taint.t', + 't/version.t', + 'xt/author/00-compile.t', + 'xt/author/compat_lc.t', + 'xt/author/eol.t', + 'xt/author/kwalitee.t', + 'xt/author/mojibake.t', + 'xt/author/no-tabs.t', + 'xt/author/pod-coverage.t', + 'xt/author/pod-no404s.t', + 'xt/author/pod-syntax.t', + 'xt/author/portability.t', + 'xt/release/changes_has_content.t', + 'xt/release/cpan-changes.t', + 'xt/release/distmeta.t', + 'xt/release/minimum-version.t' +); + +eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; +done_testing; diff --git a/xt/author/kwalitee.t b/xt/author/kwalitee.t new file mode 100644 index 0000000..c986546 --- /dev/null +++ b/xt/author/kwalitee.t @@ -0,0 +1,9 @@ +# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 +use strict; +use warnings; +use Test::More 0.88; +use Test::Kwalitee 1.21 'kwalitee_ok'; + +kwalitee_ok(); + +done_testing; diff --git a/xt/author/mojibake.t b/xt/author/mojibake.t new file mode 100644 index 0000000..5ef161e --- /dev/null +++ b/xt/author/mojibake.t @@ -0,0 +1,9 @@ +#!perl + +use strict; +use warnings qw(all); + +use Test::More; +use Test::Mojibake; + +all_files_encoding_ok(); diff --git a/xt/author/no-tabs.t b/xt/author/no-tabs.t new file mode 100644 index 0000000..3d296d6 --- /dev/null +++ b/xt/author/no-tabs.t @@ -0,0 +1,42 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 + +use Test::More 0.88; +use Test::NoTabs; + +my @files = ( + 'lib/Module/Metadata.pm', + 't/00-report-prereqs.dd', + 't/00-report-prereqs.t', + 't/contains_pod.t', + 't/encoding.t', + 't/endpod.t', + 't/extract-package.t', + 't/extract-version.t', + 't/lib/0_1/Foo.pm', + 't/lib/0_2/Foo.pm', + 't/lib/ENDPOD.pm', + 't/lib/GeneratePackage.pm', + 't/metadata.t', + 't/taint.t', + 't/version.t', + 'xt/author/00-compile.t', + 'xt/author/compat_lc.t', + 'xt/author/eol.t', + 'xt/author/kwalitee.t', + 'xt/author/mojibake.t', + 'xt/author/no-tabs.t', + 'xt/author/pod-coverage.t', + 'xt/author/pod-no404s.t', + 'xt/author/pod-syntax.t', + 'xt/author/portability.t', + 'xt/release/changes_has_content.t', + 'xt/release/cpan-changes.t', + 'xt/release/distmeta.t', + 'xt/release/minimum-version.t' +); + +notabs_ok($_) foreach @files; +done_testing; diff --git a/xt/author/pod-coverage.t b/xt/author/pod-coverage.t new file mode 100644 index 0000000..66b3b64 --- /dev/null +++ b/xt/author/pod-coverage.t @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. + +use Test::Pod::Coverage 1.08; +use Pod::Coverage::TrustPod; + +all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); diff --git a/xt/author/pod-no404s.t b/xt/author/pod-no404s.t new file mode 100644 index 0000000..eb9760c --- /dev/null +++ b/xt/author/pod-no404s.t @@ -0,0 +1,21 @@ +#!perl + +use strict; +use warnings; +use Test::More; + +foreach my $env_skip ( qw( + SKIP_POD_NO404S + AUTOMATED_TESTING +) ){ + plan skip_all => "\$ENV{$env_skip} is set, skipping" + if $ENV{$env_skip}; +} + +eval "use Test::Pod::No404s"; +if ( $@ ) { + plan skip_all => 'Test::Pod::No404s required for testing POD'; +} +else { + all_pod_files_ok(); +} diff --git a/xt/author/pod-syntax.t b/xt/author/pod-syntax.t new file mode 100644 index 0000000..e563e5d --- /dev/null +++ b/xt/author/pod-syntax.t @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. +use strict; use warnings; +use Test::More; +use Test::Pod 1.41; + +all_pod_files_ok(); diff --git a/xt/author/portability.t b/xt/author/portability.t new file mode 100644 index 0000000..bb53c7b --- /dev/null +++ b/xt/author/portability.t @@ -0,0 +1,12 @@ +#!perl + +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(); diff --git a/xt/release/changes_has_content.t b/xt/release/changes_has_content.t new file mode 100644 index 0000000..8567b88 --- /dev/null +++ b/xt/release/changes_has_content.t @@ -0,0 +1,41 @@ +#!perl + +use Test::More tests => 2; + +note 'Checking Changes'; +my $changes_file = 'Changes'; +my $newver = '1.000033'; +my $trial_token = '-TRIAL'; + +SKIP: { + ok(-e $changes_file, "$changes_file file exists") + or skip 'Changes is missing', 1; + + ok(_get_changes($newver), "$changes_file has content for $newver"); +} + +done_testing; + +# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit +# by Jerome Quelin +sub _get_changes +{ + my $newver = shift; + + # parse changelog to find commit message + open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; + my $changelog = join('', <$fh>); + close $fh; + + my @content = + grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented + split /\n/, $changelog; + shift @content; # drop the version line + + # drop unindented last line and trailing blank lines + pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); + + # return number of non-blank lines + return scalar @content; +} + diff --git a/xt/release/cpan-changes.t b/xt/release/cpan-changes.t new file mode 100644 index 0000000..286005a --- /dev/null +++ b/xt/release/cpan-changes.t @@ -0,0 +1,10 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 + +use Test::More 0.96 tests => 1; +use Test::CPAN::Changes; +subtest 'changes_ok' => sub { + changes_file_ok('Changes'); +}; diff --git a/xt/release/distmeta.t b/xt/release/distmeta.t new file mode 100644 index 0000000..c2280dc --- /dev/null +++ b/xt/release/distmeta.t @@ -0,0 +1,6 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. + +use Test::CPAN::Meta; + +meta_yaml_ok(); diff --git a/xt/release/minimum-version.t b/xt/release/minimum-version.t new file mode 100644 index 0000000..c3f95dd --- /dev/null +++ b/xt/release/minimum-version.t @@ -0,0 +1,8 @@ +#!perl + +use Test::More; + +eval "use Test::MinimumVersion"; +plan skip_all => "Test::MinimumVersion required for testing minimum versions" + if $@; +all_minimum_version_ok( qq{5.006} );