Dist-Zilla-Plugins-CJM-4.20/0000755000175000017500000000000012206160014013535 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/README0000644000175000017500000000430112206160014014413 0ustar cjmcjmDist-Zilla-Plugins-CJM version 4.20, released August 24, 2013 Dist-Zilla-Plugins-CJM is a collection of plugins I've written for Dist::Zilla. The plugins here used to be distributed in Dist-Zilla-PluginBundle-CJM, but when I actually wrote @CJM, I decided that it had too many prerequisites to be distributed with them. If you had previously installed Dist-Zilla-PluginBundle-CJM (and you aren't actually using @CJM), you should uninstall that and just install this. I've written some other plugins that are distributed separately, because they had different prerequisites. The ones collected here have fairly simple prerequisites, and I didn't want to have to make separate distributions for all of them. INSTALLATION To install these modules, run the following commands: perl Makefile.PL make make test make install DEPENDENCIES Package Minimum Version --------------------------------- --------------- perl 5.8.0 CPAN::Meta::Converter 2.101550 CPAN::Meta::Requirements 2.121 Data::Dumper Dist::Zilla 4.300009 Dist::Zilla::Plugin::InlineFiles Dist::Zilla::Plugin::MakeMaker 4.300009 File::Copy File::HomeDir 0.81 File::Temp 0.19 Module::Metadata Moose Moose::Autobox Moose::Role Path::Class Scalar::Util autodie namespace::autoclean version 0.77 CHANGES Here's what's new in version 4.20 of Dist-Zilla-Plugins-CJM: (See the file "Changes" for the full revision history.) [TemplateCJM] - now distributed separately (no longer part of this dist) [Test::PrereqsFromMeta] - Handle an empty hash in prerequisites COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Dist-Zilla-Plugins-CJM-4.20/Changes0000644000175000017500000001441712206160014015037 0ustar cjmcjmRevision history for Dist-Zilla-Plugins-CJM Note: the version number of a plugin is the version of the dist in which it was last changed. 4.20 2013-08-24 [TemplateCJM] - now distributed separately (no longer part of this dist) [Test::PrereqsFromMeta] - Handle an empty hash in prerequisites 4.17 2013-07-26 [=Dist::Zilla::Role::ModuleInfo] - die if Module::Metadata constructor fails (RT#87277) 4.16 2013-06-15 [ModuleBuild::Custom] - fix spurious warning when using get_prereqs(1) 4.15 2013-05-25 [MakeMaker::Custom] - clarify that get_prereqs(1) requires Dist::Zilla 4.300032 [ModuleBuild::Custom] - add $api_version parameter to get_prereqs method 4.14 2013-05-18 - no functional changes in this release, just improved tests - make mb_custom.t & mm_custom.t more flexible about version '0' 4.13 2013-04-04 [GitVersionCheckCJM] - fix compatibility with Git::Wrapper 0.028_96 (Don't pass Path::Class objects to Git::Wrapper) [MakeMaker::Custom] - fix compatibility with Dist::Zilla 4.300032 - add $api_version parameter to get_prereqs method [=Dist::Zilla::Role::HashDumper] - add extract_keys_as_hash method 4.12 2013-01-12 [TemplateCJM] - handle pure-POD files without package declaration or $VERSION (Must be named *.pod and found in lib/ directory.) 4.11 2012-11-03 - no functional changes in this release, just improved docs [MakeMaker::Custom] - expand SYNOPSIS to show more complete example - add documentation about combining with AutoPrereqs [ModuleBuild::Custom] - add documentation about combining with AutoPrereqs 4.10 2012-08-03 [TemplateCJM] - normalize Perl version in dependency_list - remove leading "v" from versions in dependency_list 4.09 2012-06-04 [TemplateCJM] - add report_versions parameter 4.08 2012-04-28 - no functional changes in this release, just improved docs [MakeMaker::Custom] - document how it compares to the MakeMaker::Awesome plugin 4.07 2012-02-22 [MakeMaker::Custom] - now compatible with (and requires) Dist::Zilla 4.300009 %share_dir_code replaces @share_dir_block in templates - fix typo in documentation [ModuleBuild::Custom] - fix typo in documentation 4.06 2012-01-02 [RecommendedPrereqs] - use CPAN::Meta::Requirements (new name of Version::Requirements) 4.05 2011-12-21 [RecommendedPrereqs] - Filter runtime recommendations out of test recommendations 4.04 2011-12-12 [Test::PrereqsFromMeta] - New plugin 4.03 2011-11-11 [GitVersionCheckCJM] - Add :IncModules & :ExecFiles to default finders [MakeMaker::Custom] - New plugin [=Dist::Zilla::Role::HashDumper] - New role 4.02 2011-11-03 - Fixed the bogus failures in gitvercheck.t - No changes to plugins 4.01 2011-11-02 - Fixed buggy diagnostics in gitvercheck.t - No changes to plugins 4.00 2011-11-01 [RecommendedPrereqs] - New plugin [TemplateCJM] - Add changelog_re parameter - Tests now use Test::DZil 3.05 2011-05-05 [GitVersionCheckCJM] - Log more information in debug mode - Tests now output the log on failure [ModuleBuild::Custom] - Added get_default method [TemplateCJM] - Fix dependency_list to handle no dependencies 3.04 2010-12-20 [=Dist::Zilla::Role::ModuleInfo] - Use Module::Metadata instead of Module::Build::ModuleInfo - Locally reset $/ $, $\ to default values (just in case) [TemplateCJM] - Updated docs to talk about Module::Metadata 3.03 2010-12-07 [Metadata] - New plugin [TemplateCJM] - Only process comments that contain a {{ }} pair. Text::Template breaks on strings that have the closing delimiter without the opening one. 3.02 2010-11-11 - Fixed test prerequisites (needed Test::More 0.88) [GitVersionCheckCJM] - Use Git::Wrapper instead of Git (RT#60140) - Complain if a module's version exceeds the dist's version - Indicate when the dist's version needs to be incremented - Now has tests 3.01 2010-08-09 [ArchiveRelease] - Use File::Copy::move to support cross-filesystem moves (RT#59288) [ModuleBuild::Custom] - Now compatible with Dist::Zilla 3 & 4 - Now has tests 3.00 2010-05-22 - Now requires Dist::Zilla 3 [TemplateCJM] - Now compatible with Dist::Zilla 3 0.09 2010-04-15 [ArchiveRelease] - accept ~ in directory to mean home directory (RT#56433) 0.08 2010-04-14 - This distribution is now Dist-Zilla-Plugins-CJM. Dist-Zilla-PluginBundle-CJM now contains only @CJM (and requires this distribution along with the other plugins used by @CJM). - Updated all version numbers to 0.08 [ArchiveRelease] - document the FilePruner role [PodLoom] - now distributed separately, in Dist-Zilla-Plugin-PodLoom [TemplateCJM] - added build_instructions method - In templates, $changes no longer ends with a newline 0.07 2010-04-01 - added tests 0.06 2010-04-01 [ArchiveRelease] - add FilePruner for archive directory (Michael Schout) [GitVersionCheckCJM] [TemplateCJM] - are now FileFinderUsers 0.05 2010-03-30 - All plugins now have a SYNOPSIS - Revised compile tests 0.04 2010-03-29 - Now requires Dist::Zilla 2 - Added compile tests [ArchiveRelease] - Added a BeforeRelease check to ensure the directory exists (creating it if necessary) and this release hasn't already been archived 0.03 2010-03-15 - Includes a new version of Template_strict.patch that supports scalar references properly [ArchiveRelease] - Shortened log message [ModuleBuild::Custom] - New plugin [TemplateCJM] - Is now an InstallTool instead of a FileMunger, because prerequisites have not been calculated at FileMunger time - Added the dependency_link & dependency_list methods - Added a BeforeRelease check to ensure the release date is not just an uppercase word 0.02 2010-03-07 - Added POD tests - Use the plugin's log method so the plugin name appears in the log [ArchiveRelease] [GitVersionCheckCJM] - New plugins [PodLoom] - Define abstract, module, & version only if they could be determined [TemplateCJM] - Also process comments that start at beginning of line 0.01 2009-10-11 - Initial release includes: Dist::Zilla::Plugin::PodLoom Dist::Zilla::Plugin::TemplateCJM Dist::Zilla::Plugin::VersionFromModule Dist::Zilla::Role::ModuleInfo Dist-Zilla-Plugins-CJM-4.20/LICENSE0000644000175000017500000004370612206160014014554 0ustar cjmcjmThis software is copyright (c) 2013 by Christopher J. Madsen. 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) 2013 by Christopher J. Madsen. 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, Suite 500, Boston, MA 02110-1335 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) 2013 by Christopher J. Madsen. 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 Dist-Zilla-Plugins-CJM-4.20/MANIFEST0000644000175000017500000000163612206160014014674 0ustar cjmcjmChanges LICENSE MANIFEST META.json META.yml Makefile.PL README Template_strict.patch corpus/DZT/README corpus/DZT/lib/DZT/Manual.pod corpus/DZT/lib/DZT/Sample.pm corpus/DZT/t/basic.t corpus/README corpus/archives/DZT-Sample-0.01.tar.gz corpus/archives/DZT-Sample-0.02.tar.gz corpus/archives/DZT-Sample-0.03.tar.gz corpus/gitvercheck.git lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/MakeMaker/Custom.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/RecommendedPrereqs.pm lib/Dist/Zilla/Plugin/Test/PrereqsFromMeta.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm lib/Dist/Zilla/Role/HashDumper.pm lib/Dist/Zilla/Role/ModuleInfo.pm t/00-all_prereqs.t t/00-compile.t t/arcrel.t t/gitvercheck.t t/mb_custom.t t/metadata.t t/mm_custom.t t/recommendedprereqs.t t/release-pod-coverage.t t/release-pod-syntax.t t/vermod.t Dist-Zilla-Plugins-CJM-4.20/META.yml0000644000175000017500000001207212206160014015010 0ustar cjmcjm--- abstract: "CJM's plugins for Dist::Zilla" author: - 'Christopher J. Madsen ' build_requires: File::pushd: 0 Parse::CPAN::Meta: 0 Test::DZil: 0 Test::More: 0.88 Try::Tiny: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Dist-Zilla-Plugins-CJM no_index: directory: - corpus recommends: Git::Wrapper: 0 requires: CPAN::Meta::Converter: 2.101550 CPAN::Meta::Requirements: 2.121 Data::Dumper: 0 Dist::Zilla: 4.300009 Dist::Zilla::Plugin::InlineFiles: 0 Dist::Zilla::Plugin::MakeMaker: 4.300009 File::Copy: 0 File::HomeDir: 0.81 File::Temp: 0.19 Module::Metadata: 0 Moose: 0 Moose::Autobox: 0 Moose::Role: 0 Path::Class: 0 Scalar::Util: 0 autodie: 0 namespace::autoclean: 0 perl: 5.008 version: 0.77 resources: repository: git://github.com/madsen/dist-zilla-plugins-cjm.git version: 4.20 x_Dist_Zilla: perl: version: 5.014002 plugins: - class: Dist::Zilla::Plugin::FileFinder::Filter name: ':CheckRecommend' version: 4.300034 - class: Dist::Zilla::Plugin::GatherDir name: CJM/GatherDir version: 4.300034 - class: Dist::Zilla::Plugin::PruneCruft name: CJM/PruneCruft version: 4.300034 - class: Dist::Zilla::Plugin::ManifestSkip name: CJM/ManifestSkip version: 4.300034 - class: Dist::Zilla::Plugin::MetaJSON name: CJM/MetaJSON version: 4.300034 - class: Dist::Zilla::Plugin::MetaYAML name: CJM/MetaYAML version: 4.300034 - class: Dist::Zilla::Plugin::License name: CJM/License version: 4.300034 - class: Dist::Zilla::Plugin::Test::PrereqsFromMeta name: CJM/Test::PrereqsFromMeta version: 4.20 - class: Dist::Zilla::Plugin::PodSyntaxTests name: CJM/PodSyntaxTests version: 4.300034 - class: Dist::Zilla::Plugin::PodCoverageTests name: CJM/PodCoverageTests version: 4.300034 - class: Dist::Zilla::Plugin::ExtraTests name: CJM/ExtraTests version: 4.300034 - class: Dist::Zilla::Plugin::PodLoom config: Pod::Loom version: 0.06 name: CJM/PodLoom version: 4.10 - class: Dist::Zilla::Plugin::MakeMaker name: CJM/MakeMaker version: 4.300034 - class: Dist::Zilla::Plugin::MetaConfig name: CJM/MetaConfig version: 4.300034 - class: Dist::Zilla::Plugin::MatchManifest name: CJM/MatchManifest version: 4.01 - class: Dist::Zilla::Plugin::RecommendedPrereqs name: CJM/RecommendedPrereqs version: 4.06 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: CJM/CheckPrereqsIndexed version: 0.006 - class: Dist::Zilla::Plugin::GitVersionCheckCJM name: CJM/GitVersionCheckCJM version: 4.13 - class: Dist::Zilla::Plugin::TemplateCJM name: CJM/TemplateCJM version: 4.20 - class: Dist::Zilla::Plugin::Repository name: CJM/Repository version: 0.18 - class: Dist::Zilla::Plugin::Git::Check name: CJM/@Git/Check version: 2.013 - class: Dist::Zilla::Plugin::Git::Commit name: CJM/@Git/Commit version: 2.013 - class: Dist::Zilla::Plugin::Git::Tag name: CJM/@Git/Tag version: 2.013 - class: Dist::Zilla::Plugin::Git::Push name: CJM/@Git/Push version: 2.013 - class: Dist::Zilla::Plugin::TestRelease name: CJM/TestRelease version: 4.300034 - class: Dist::Zilla::Plugin::UploadToCPAN name: CJM/UploadToCPAN version: 4.300034 - class: Dist::Zilla::Plugin::ArchiveRelease name: CJM/ArchiveRelease version: 4.00 - class: tools::CompileTests name: '=tools::CompileTests' version: ~ - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: 4.300034 - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: 4.300034 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300034 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300034 Dist-Zilla-Plugins-CJM-4.20/META.json0000644000175000017500000002047712206160014015170 0ustar cjmcjm{ "abstract" : "CJM's plugins for Dist::Zilla", "author" : [ "Christopher J. Madsen " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Dist-Zilla-Plugins-CJM", "no_index" : { "directory" : [ "corpus" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "recommends" : { "Git::Wrapper" : "0" }, "requires" : { "CPAN::Meta::Converter" : "2.101550", "CPAN::Meta::Requirements" : "2.121", "Data::Dumper" : "0", "Dist::Zilla" : "4.300009", "Dist::Zilla::Plugin::InlineFiles" : "0", "Dist::Zilla::Plugin::MakeMaker" : "4.300009", "File::Copy" : "0", "File::HomeDir" : "0.81", "File::Temp" : "0.19", "Module::Metadata" : "0", "Moose" : "0", "Moose::Autobox" : "0", "Moose::Role" : "0", "Path::Class" : "0", "Scalar::Util" : "0", "autodie" : "0", "namespace::autoclean" : "0", "perl" : "5.008", "version" : "0.77" } }, "test" : { "recommends" : { "Test::Fatal" : "0" }, "requires" : { "File::pushd" : "0", "Parse::CPAN::Meta" : "0", "Test::DZil" : "0", "Test::More" : "0.88", "Try::Tiny" : "0" } } }, "release_status" : "stable", "resources" : { "repository" : { "type" : "git", "url" : "git://github.com/madsen/dist-zilla-plugins-cjm.git", "web" : "http://github.com/madsen/dist-zilla-plugins-cjm" } }, "version" : "4.20", "x_Dist_Zilla" : { "perl" : { "version" : "5.014002" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::FileFinder::Filter", "name" : ":CheckRecommend", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "CJM/GatherDir", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "CJM/PruneCruft", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "CJM/ManifestSkip", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "CJM/MetaJSON", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "CJM/MetaYAML", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "CJM/License", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Test::PrereqsFromMeta", "name" : "CJM/Test::PrereqsFromMeta", "version" : "4.20" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "CJM/PodSyntaxTests", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "CJM/PodCoverageTests", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "CJM/ExtraTests", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::PodLoom", "config" : { "Pod::Loom version" : "0.06" }, "name" : "CJM/PodLoom", "version" : "4.10" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "CJM/MakeMaker", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "CJM/MetaConfig", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MatchManifest", "name" : "CJM/MatchManifest", "version" : "4.01" }, { "class" : "Dist::Zilla::Plugin::RecommendedPrereqs", "name" : "CJM/RecommendedPrereqs", "version" : "4.06" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "CJM/CheckPrereqsIndexed", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::GitVersionCheckCJM", "name" : "CJM/GitVersionCheckCJM", "version" : "4.13" }, { "class" : "Dist::Zilla::Plugin::TemplateCJM", "name" : "CJM/TemplateCJM", "version" : "4.20" }, { "class" : "Dist::Zilla::Plugin::Repository", "name" : "CJM/Repository", "version" : "0.18" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "CJM/@Git/Check", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "CJM/@Git/Commit", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "CJM/@Git/Tag", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "CJM/@Git/Push", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "CJM/TestRelease", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "CJM/UploadToCPAN", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ArchiveRelease", "name" : "CJM/ArchiveRelease", "version" : "4.00" }, { "class" : "tools::CompileTests", "name" : "=tools::CompileTests", "version" : null }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300034" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300034" } } } Dist-Zilla-Plugins-CJM-4.20/t/0000755000175000017500000000000012206160014014000 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/t/arcrel.t0000644000175000017500000000410412206160014015434 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 6; # done_testing use Test::DZil 'Builder'; sub make_ini { my $ini = <<'END START'; name = DZT-Sample abstract = Sample DZ Dist version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample END START $ini . join('', map { "$_\n" } @_); } # end make_ini sub new_tzil { my ($archiveConfig, $copy_archives) = @_; Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => make_ini( '[GatherDir]', '[ArchiveRelease]', @$archiveConfig, ), }, ($copy_archives ? (also_copy => { 'corpus/archives' => $copy_archives }) : ()), }, ); } # end new_tzil { my $tzil = new_tzil([], 'source/releases'); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_deeply( [ sort @files ], [ sort(qw(dist.ini README lib/DZT/Sample.pm lib/DZT/Manual.pod t/basic.t)), ], "ArchiveRelease prunes default releases directory", ); } { my $tzil = new_tzil(['directory = cjm_releases'], 'source/cjm_releases'); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_deeply( [ sort @files ], [ sort(qw(dist.ini README lib/DZT/Sample.pm lib/DZT/Manual.pod t/basic.t)), ], "ArchiveRelease prunes non-standard releases directory", ); } { my $tzil = new_tzil([], 'source/releases'); $tzil->release; my $tarball = $tzil->root->file('releases/DZT-Sample-0.001.tar.gz'); ok(-e $tarball, 'archived tarball'); is($tarball->stat->mode & 0777, 0444, 'tarball is read-only'); ok((not -e $tzil->root->file('DZT-Sample-0.001.tar.gz')), 'tarball was moved'); } { require File::HomeDir; my $tzil = new_tzil(['directory = ~/some/dir']); my $arcrel = $tzil->plugins_with(-Releaser)->[0]; is($arcrel->directory, Path::Class::dir(File::HomeDir->my_home, qw(some dir)), '~ expansion'); } done_testing; Dist-Zilla-Plugins-CJM-4.20/t/vermod.t0000644000175000017500000000136312206160014015464 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 1; # done_testing use Test::DZil 'Builder'; sub make_ini { my $ini = <<'END START'; name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample END START $ini . join('', map { "$_\n" } @_); } # end make_ini { my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => make_ini( '[GatherDir]', '[VersionFromModule]', ), }, }, ); $tzil->build; is($tzil->version, '0.04', "VersionFromModule found version", ); } done_testing; Dist-Zilla-Plugins-CJM-4.20/t/metadata.t0000644000175000017500000000510412206160014015745 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 5; # done_testing use Test::DZil 'Builder'; #--------------------------------------------------------------------- sub make_ini { my $ini = <<'END START'; name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample version = 0.04 [GatherDir] [Metadata] END START $ini . join('', map { "$_\n" } @_); } # end make_ini #--------------------------------------------------------------------- sub build_tzil { my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => make_ini(@_), }, }, ); $tzil->build; return $tzil; } # end build_tzil #--------------------------------------------------------------------- # Collect the standard metadata generated by Dist::Zilla: my %base = %{ build_tzil->distmeta }; #--------------------------------------------------------------------- { my $tzil = build_tzil('dynamic_config = 1'); is_deeply($tzil->distmeta, { %base, dynamic_config => 1 }, 'dynamic_config'); } #--------------------------------------------------------------------- { my $tzil = build_tzil('no_index.directory = tools'); is_deeply($tzil->distmeta, { %base, no_index => { directory => ['tools'] } }, 'no_index 1 directory'); } #--------------------------------------------------------------------- { my $tzil = build_tzil( 'no_index.directory = tools', 'no_index.directory = inc', 'no_index.package = Foo::Bar', ); is_deeply($tzil->distmeta, { %base, no_index => { directory => [qw(tools inc)], package => ['Foo::Bar'] } }, 'no_index 2 directories and package'); } #--------------------------------------------------------------------- { my $tzil = build_tzil( 'resources.bugtracker.mailto = bugs@example.com', ); is_deeply( $tzil->distmeta, { %base, resources => { bugtracker => { mailto => 'bugs@example.com' } } }, 'bugtracker mailto'); } #--------------------------------------------------------------------- { my $tzil = build_tzil( 'resources.bugtracker.mailto = bugs@example.com', 'resources.bugtracker.web = http://example.com', ); is_deeply( $tzil->distmeta, { %base, resources => { bugtracker => { mailto => 'bugs@example.com', web => 'http://example.com' } } }, 'bugtracker mailto and web'); } done_testing; Dist-Zilla-Plugins-CJM-4.20/t/mb_custom.t0000644000175000017500000001123612206160014016160 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 10; # done_testing use Test::DZil 'Builder'; #--------------------------------------------------------------------- sub make_re { my $text = quotemeta shift; $text =~ s/\\\n/ *\n/g; # Accept either '0' or 0 in prereqs: $text =~ s/(\\'0\\')/(?:$1|0)/g; qr/^$text/m; } # end make_re #--------------------------------------------------------------------- { my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => <<'END INI', name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample version = 0.04 [Prereqs] Foo::Bar = 1.00 Bloofle = 0 [Prereqs / TestRequires] Test::More = 0.88 [GatherDir] [ModuleBuild::Custom] mb_version = 0.3601 END INI 'source/Build.PL' => <<'END BUILD', use Module::Build; my $builder = My_Build->new( module_name => 'DZT::Sample', license => 'perl', dist_author => 'E. Xavier Ample ', dist_version_from => 'lib/DZT/Sample.pm', dynamic_config => 0, # Prerequisites inserted by DistZilla: ##{ $plugin->get_prereqs ##} ); $builder->create_build_script(); END BUILD }, }, ); $tzil->build; my $buildPL = $tzil->slurp_file('build/Build.PL'); #print STDERR $buildPL; my $build_requires = <<'END BUILD_REQUIRES'; 'build_requires' => { 'Module::Build' => '0.3601', 'Test::More' => '0.88' }, END BUILD_REQUIRES my $configure_requires = <<'END CONFIGURE_REQUIRES'; 'configure_requires' => { 'Module::Build' => '0.3601' }, END CONFIGURE_REQUIRES my $requires = <<'END REQUIRES'; 'requires' => { 'Bloofle' => '0', 'Foo::Bar' => '1.00' }, END REQUIRES like($buildPL, make_re($build_requires), "build_requires"); like($buildPL, make_re($configure_requires), "configure_requires"); like($buildPL, make_re($requires), "requires"); } #--------------------------------------------------------------------- sub test_and_build_reqs { my $api_version = shift; (my $BuildSRC = <<'END BUILD') =~ s/~API_VERSION~/$api_version/; use Module::Build; my $builder = My_Build->new( module_name => 'DZT::Sample', license => 'perl', dist_author => 'E. Xavier Ample ', dist_version_from => 'lib/DZT/Sample.pm', dynamic_config => 0, # Prerequisites inserted by DistZilla: ##{ $plugin->get_prereqs(~API_VERSION~) ##} ); $builder->create_build_script(); END BUILD my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => <<'END INI', name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample version = 0.04 [Prereqs] Foo::Bar = 1.00 Bloofle = 0 [Prereqs / TestRequires] Test::More = 0.88 [Prereqs / BuildRequires] Foo::Make = 2.00 [GatherDir] [ModuleBuild::Custom] mb_version = 0.3601 END INI 'source/Build.PL' => $BuildSRC, }, }, ); $tzil->build; my $buildPL = $tzil->slurp_file('build/Build.PL'); #print STDERR $buildPL; my $configure_requires = <<'END CONFIGURE_REQUIRES'; 'configure_requires' => { 'Module::Build' => '0.3601' }, END CONFIGURE_REQUIRES my $requires = <<'END REQUIRES'; 'requires' => { 'Bloofle' => '0', 'Foo::Bar' => '1.00' }, END REQUIRES like($buildPL, make_re($configure_requires), "configure_requires"); like($buildPL, make_re($requires), "requires"); return $buildPL; } #--------------------------------------------------------------------- { my $buildPL = test_and_build_reqs(0); my $build_requires = <<'END BUILD_REQUIRES_0'; 'build_requires' => { 'Foo::Make' => '2.00', 'Module::Build' => '0.3601', 'Test::More' => '0.88' }, END BUILD_REQUIRES_0 like($buildPL, make_re($build_requires), "build_requires (api 0)"); } #--------------------------------------------------------------------- SKIP: { my $buildPL = test_and_build_reqs(1); eval { Test::DZil->VERSION( 4.300032 ) } or skip 'Dist::Zilla 4.300032 required', 2; my $build_requires = <<'END BUILD_REQUIRES_1'; 'build_requires' => { 'Foo::Make' => '2.00', 'Module::Build' => '0.3601' }, END BUILD_REQUIRES_1 my $test_requires = <<'END TEST_REQUIRES_1'; 'test_requires' => { 'Test::More' => '0.88' }, END TEST_REQUIRES_1 like($buildPL, make_re($build_requires), "build_requires (api 1)"); like($buildPL, make_re($test_requires), "test_requires (api 1)"); } done_testing; Dist-Zilla-Plugins-CJM-4.20/t/mm_custom.t0000644000175000017500000001061612206160014016174 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 10; # done_testing use Test::DZil 'Builder'; #--------------------------------------------------------------------- sub make_re { my $text = quotemeta shift; $text =~ s/\\\n/ *\n/g; # Accept either '0' or 0 in prereqs: $text =~ s/(\\'0\\')/(?:$1|0)/g; qr/^$text/m; } # end make_re #--------------------------------------------------------------------- { my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => <<'END INI', name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample version = 0.04 [Prereqs] Foo::Bar = 1.00 Bloofle = 0 [Prereqs / TestRequires] Test::More = 0.88 [GatherDir] [MakeMaker::Custom] eumm_version = 6.30 END INI 'source/Makefile.PL' => <<'END MAKEFILE', use ExtUtils::MakeMaker 6.30; WriteMakefile( NAME => 'DZT::Sample', AUTHOR => 'E. Xavier Ample ', VERSION_FROM => 'lib/DZT/Sample.pm', # finds $VERSION ##{ $plugin->get_prereqs ##} ##{ $plugin->get_default(qw(LICENSE)) ##} ); END MAKEFILE }, }, ); $tzil->build; my $makefilePL = $tzil->slurp_file('build/Makefile.PL'); #print STDERR $makefilePL; my $build_requires = <<'END BUILD_REQUIRES'; 'BUILD_REQUIRES' => { 'Test::More' => '0.88' }, END BUILD_REQUIRES my $configure_requires = <<'END CONFIGURE_REQUIRES'; 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.30' }, END CONFIGURE_REQUIRES my $requires = <<'END REQUIRES'; 'PREREQ_PM' => { 'Bloofle' => '0', 'Foo::Bar' => '1.00' }, END REQUIRES like($makefilePL, make_re($build_requires), "BUILD_REQUIRES"); like($makefilePL, make_re($configure_requires), "CONFIGURE_REQUIRES"); like($makefilePL, make_re($requires), "PREREQ_PM"); } #--------------------------------------------------------------------- sub test_and_build_reqs { my $api_version = shift; (my $MakefileSRC = <<'END MAKEFILE') =~ s/~API_VERSION~/$api_version/; use ExtUtils::MakeMaker 6.63_03; WriteMakefile( NAME => 'DZT::Sample', AUTHOR => 'E. Xavier Ample ', VERSION_FROM => 'lib/DZT/Sample.pm', # finds $VERSION ##{ $plugin->get_prereqs(~API_VERSION~) ##} ); END MAKEFILE my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => <<'END INI', name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample version = 0.04 [Prereqs] Foo::Baz = 1.00 [Prereqs / TestRequires] Test::More = 0.88 [Prereqs / BuildRequires] Foo::Make = 2.00 [GatherDir] [MakeMaker::Custom] eumm_version = 6.63_03 END INI 'source/Makefile.PL' => $MakefileSRC, }, }, ); $tzil->build; my $makefilePL = $tzil->slurp_file('build/Makefile.PL'); #print STDERR $makefilePL; my $configure_requires = <<'END CONFIGURE_REQUIRES'; 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.63_03' }, END CONFIGURE_REQUIRES my $requires = <<'END REQUIRES'; 'PREREQ_PM' => { 'Foo::Baz' => '1.00' }, END REQUIRES like($makefilePL, make_re($configure_requires), "CONFIGURE_REQUIRES"); like($makefilePL, make_re($requires), "PREREQ_PM"); return $makefilePL; } #--------------------------------------------------------------------- { my $makefilePL = test_and_build_reqs(0); my $build_requires = <<'END BUILD_REQUIRES_0'; 'BUILD_REQUIRES' => { 'Foo::Make' => '2.00', 'Test::More' => '0.88' }, END BUILD_REQUIRES_0 like($makefilePL, make_re($build_requires), "BUILD_REQUIRES (api 0)"); } #--------------------------------------------------------------------- SKIP: { my $makefilePL = test_and_build_reqs(1); eval { Test::DZil->VERSION( 4.300032 ) } or skip 'Dist::Zilla 4.300032 required', 2; my $build_requires = <<'END BUILD_REQUIRES'; 'BUILD_REQUIRES' => { 'Foo::Make' => '2.00' }, END BUILD_REQUIRES my $test_requires = <<'END TEST_REQUIRES'; 'TEST_REQUIRES' => { 'Test::More' => '0.88' }, END TEST_REQUIRES like($makefilePL, make_re($build_requires), "BUILD_REQUIRES (api 1)"); like($makefilePL, make_re($test_requires), "TEST_REQUIRES (api 1)"); } done_testing; Dist-Zilla-Plugins-CJM-4.20/t/00-compile.t0000644000175000017500000000120112206160014016024 0ustar cjmcjmuse Test::More tests => 10; diag("Testing Dist-Zilla-Plugins-CJM 4.20"); use_ok('Dist::Zilla::Plugin::ArchiveRelease'); use_ok('Dist::Zilla::Plugin::MakeMaker::Custom'); use_ok('Dist::Zilla::Plugin::Metadata'); use_ok('Dist::Zilla::Plugin::ModuleBuild::Custom'); use_ok('Dist::Zilla::Plugin::RecommendedPrereqs'); use_ok('Dist::Zilla::Plugin::Test::PrereqsFromMeta'); use_ok('Dist::Zilla::Plugin::VersionFromModule'); use_ok('Dist::Zilla::Role::HashDumper'); use_ok('Dist::Zilla::Role::ModuleInfo'); SKIP: { skip 'Git::Wrapper not installed', 1 unless eval "use Git::Wrapper; 1"; use_ok('Dist::Zilla::Plugin::GitVersionCheckCJM'); } Dist-Zilla-Plugins-CJM-4.20/t/gitvercheck.t0000644000175000017500000001456312206160014016474 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use autodie ':io'; use Test::More 0.88; # done_testing BEGIN { eval "use Git::Wrapper; 1" or plan skip_all => "Git::Wrapper required for testing GitVersionCheckCJM"; # RECOMMEND PREREQ: Test::Fatal eval "use Test::Fatal; 1" or plan skip_all => "Test::Fatal required for testing GitVersionCheckCJM"; } use Test::DZil 'Builder'; use File::pushd 'pushd'; use File::Temp (); use Path::Class qw(dir file); use Try::Tiny qw(try catch); my $stoppedRE = qr/Stopped because of errors/; #--------------------------------------------------------------------- # Initialise Git working copy: my $fakeHome = File::Temp->newdir; $ENV{HOME} = "$fakeHome"; # Don't want user's ~/.gitconfig to interfere my $tempdir = File::Temp->newdir; my $gitRoot = dir("$tempdir")->absolute; my $gitHistory = file("corpus/gitvercheck.git")->absolute; my $git; try { my $wd = pushd($gitRoot); system "git init --quiet" and die "Couldn't init repo\n"; system "git fast-import --quiet <\"$gitHistory\"" and die "Couldn't import repo\n"; $git = Git::Wrapper->new("$gitRoot"); $git->config('user.email', 'example@example.org'); $git->config('user.name', 'E. Xavier Ample'); $git->checkout(qw(--force --quiet master)); } catch { chomp; plan skip_all => $_; }; plan tests => 18; #--------------------------------------------------------------------- sub edit { my ($file, $edit) = @_; my $fn = $gitRoot->subdir("lib/DZT")->file("$file.pm"); local $_ = do { local $/; open my $fh, '<:raw', $fn; <$fh>; }; $edit->(); open my $fh, '>:raw', $fn; print $fh $_; close $fh; } # end edit #--------------------------------------------------------------------- sub set_version { my $version = shift; foreach my $file (@_) { edit($file, sub { s/(\$VERSION\s*=)\s*'[^']*'/$1 '$version'/ or die }); } } # end set_version #--------------------------------------------------------------------- sub new_tzil { my $tzil = Builder->from_config( { dist_root => $gitRoot }, ); $tzil->plugin_named('GitVersionCheckCJM')->logger->set_debug(1); # Something about the copy dzil makes seems to confuse git into # thinking files are modified when they aren't. # Run "git reset --mixed" in the source directory to unconfuse it: Git::Wrapper->new( $tzil->tempdir->subdir("source")->stringify ) ->reset('--mixed'); $tzil; } # end new_tzil #------------------------------------------------------n--------------- # Extract the errors reported by GitVersionCheckCJM: sub errors { my ($tzil) = @_; my @messages = grep { s/^.*GitVersionCheckCJM.*ERROR:\s*// } @{ $tzil->log_messages }; my %error; for (@messages) { s!\s*lib/DZT/(\S+)\.pm\b:?\s*!! or die "Can't find filename in $_"; $error{$1} = $_; } #use YAML::XS; print Dump $tzil->log_events; return \%error; } # end errors #--------------------------------------------------------------------- # Write the log messages as diagnostics: sub diag_log { my $tzil = shift; # Output nothing if all tests passed: my $all_passed = shift; $all_passed &&= $_ for @_; return if $all_passed; diag(map { "$_\n" } @{ $tzil->log_messages }); { my $wd = pushd($tzil->tempdir->subdir("source")); diag( `git --version`, "git diff-index:\n", `git diff-index HEAD --name-only`, "git ls-files:\n", `git ls-files -o --exclude-standard`, "git status:\n", `git status`, ); } } # end diag_log #--------------------------------------------------------------------- { my $tzil = new_tzil; diag_log($tzil, is(exception { $tzil->build }, undef, "build 0.04"), is_deeply(errors($tzil), {}, "no errors in 0.04"), ); # print "$_\n" for @{ $tzil->log_messages }; # print $tzil->tempdir,"\n"; my $wait = ; } { set_version('0.04', 'Sample/Second'); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, $stoppedRE, "can't build modified 0.04"), is_deeply(errors($tzil), { 'Sample/Second' => 'dist version 0.04 needs to be updated' }, "errors in modified 0.04"), ); } { set_version('0.05', 'Sample'); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, $stoppedRE, "can't build 0.05 yet"), is_deeply(errors($tzil), { 'Sample/Second' => '0.04 needs to be updated' }, "errors in 0.05"), ); } { set_version('0.05', 'Sample/Second'); my $tzil = new_tzil; diag_log($tzil, is(exception { $tzil->build }, undef, "can build 0.05 now"), is_deeply(errors($tzil), {}, "no errors in 0.05 now"), ); } #--------------------------------------------------------------------- $git->reset(qw(--hard --quiet)); # Restore to checked-in state { set_version('0.045', 'First'); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, $stoppedRE, "can't build with 0.045"), is_deeply(errors($tzil), { First => '0.045 exceeds dist version 0.04' }, "errors with 0.045"), ); } { set_version('0.05', 'Sample'); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, $stoppedRE, "can't build 0.05 with 0.045"), is_deeply(errors($tzil), { First => '0.045 needs to be updated', }, "errors in 0.05 with 0.045"), ); } { $git->add('lib/DZT/First.pm'); $git->commit(-m => 'checking in DZT::First 0.045'); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, $stoppedRE, "can't build 0.05 with 0.045 committed"), is_deeply(errors($tzil), { First => '0.045 does not seem to have been released, but is not current', }, "errors in 0.05 with 0.045 committed"), ); } { set_version('0.05', 'First'); my $tzil = new_tzil; diag_log($tzil, is(exception { $tzil->build }, undef, "can build with First 0.05"), is_deeply(errors($tzil), {}, "no errors with First 0.05"), ); } { edit('First', sub { s/^.*VERSION.*\n//m or die }); my $tzil = new_tzil; diag_log($tzil, like(exception { $tzil->build }, qr/ERROR: Can't find version/, "can't build with First unversioned"), is_deeply(errors($tzil), { First => "Can't find version in" }, "errors with First unversioned"), ); } undef $tempdir; # Clean up temporary directory done_testing; Dist-Zilla-Plugins-CJM-4.20/t/00-all_prereqs.t0000644000175000017500000000440112206160014016712 0ustar cjmcjm#!perl use strict; use warnings; # This doesn't use Test::More because I don't want to clutter %INC # with modules that aren't prerequisites. my $test = 0; sub ok ($$) { my ($ok, $name) = @_; printf "%sok %d - %s\n", ($ok ? '' : 'not '), ++$test, $name; return $ok; } # end ok END { ok(0, 'unknown failure') unless $test; print "1..$test\n"; } sub get_version { my ($package) = @_; local $@; my $version = eval { $package->VERSION }; defined $version ? $version : 'undef'; } # end get_version TEST: { ok(open(META, ') { last if /^\s*"prereqs" : \{\s*\z/; } # end while ok(defined $_, 'found prereqs') or last TEST; while () { last if /^\s*\},?\s*\z/; ok(/^\s*"(.+)" : \{\s*\z/, "found phase $1") or last TEST; my $phase = $1; while () { last if /^\s*\},?\s*\z/; next if /^\s*"[^"]+"\s*:\s*\{\s*\},?\s*\z/; ok(/^\s*"(.+)" : \{\s*\z/, "found relationship $phase $1") or last TEST; my $rel = $1; while () { last if /^\s*\},?\s*\z/; ok(/^\s*"([^"]+)"\s*:\s*(\S+?),?\s*\z/, "found prereq $1") or last TEST; my ($prereq, $version) = ($1, $2); next if $phase ne 'runtime' or $prereq eq 'perl'; my $loaded = eval "require $prereq; $prereq->VERSION($version); 1"; if ($rel eq 'requires') { ok($loaded, "loaded $prereq $version") or printf STDERR "\n# Got: %s %s\n# Wanted: %s %s\n", $prereq, get_version($prereq), $prereq, $version; } else { ok(1, ($loaded ? 'loaded' : 'failed to load') . " $prereq $version"); } } # end while in prerequisites } # end while in relationship } # end while in phase close META; # Print version of all loaded modules: if ($ENV{AUTOMATED_TESTING}) { print STDERR "# Listing %INC\n"; my @packages = grep { s/\.pm\Z// and do { s![\\/]!::!g; 1 } } sort keys %INC; my $len = 0; for (@packages) { $len = length if length > $len } $len = 68 if $len > 68; for my $package (@packages) { printf STDERR "# %${len}s %s\n", $package, get_version($package); } } # end if AUTOMATED_TESTING } # end TEST Dist-Zilla-Plugins-CJM-4.20/t/recommendedprereqs.t0000644000175000017500000000166112206160014020055 0ustar cjmcjm#! /usr/bin/perl #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 4; # done_testing use Test::DZil qw(Builder simple_ini); use Parse::CPAN::Meta; my $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(qw(GatherDir RecommendedPrereqs), [ MetaYAML => { version => 2 }]), }, }, ); $tzil->build; my $meta = Parse::CPAN::Meta->load_file($tzil->tempdir->file('build/META.yml')); is_deeply( $meta->{prereqs}{runtime}{recommends}, { 'Foo::Bar' => '1.00', 'Foo::Baz' => 0 }, 'runtime recommends' ); is($meta->{prereqs}{runtime}{suggests}, undef, 'runtime suggests'); is($meta->{prereqs}{test}{recommends}, undef, 'test recommends'); is_deeply( $meta->{prereqs}{test}{suggests}, { 'Test::Other' => 0 }, 'test suggests' ); done_testing; Dist-Zilla-Plugins-CJM-4.20/t/release-pod-syntax.t0000644000175000017500000000045012206160014017710 0ustar cjmcjm#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); Dist-Zilla-Plugins-CJM-4.20/t/release-pod-coverage.t0000644000175000017500000000076512206160014020166 0ustar cjmcjm#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Dist-Zilla-Plugins-CJM-4.20/Makefile.PL0000644000175000017500000000400012206160014015501 0ustar cjmcjm use strict; use warnings; use 5.008; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "CJM's plugins for Dist::Zilla", "AUTHOR" => "Christopher J. Madsen ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Dist-Zilla-Plugins-CJM", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Dist::Zilla::Plugins::CJM", "PREREQ_PM" => { "CPAN::Meta::Converter" => "2.101550", "CPAN::Meta::Requirements" => "2.121", "Data::Dumper" => 0, "Dist::Zilla" => "4.300009", "Dist::Zilla::Plugin::InlineFiles" => 0, "Dist::Zilla::Plugin::MakeMaker" => "4.300009", "File::Copy" => 0, "File::HomeDir" => "0.81", "File::Temp" => "0.19", "Module::Metadata" => 0, "Moose" => 0, "Moose::Autobox" => 0, "Moose::Role" => 0, "Path::Class" => 0, "Scalar::Util" => 0, "autodie" => 0, "namespace::autoclean" => 0, "version" => "0.77" }, "TEST_REQUIRES" => { "File::pushd" => 0, "Parse::CPAN::Meta" => 0, "Test::DZil" => 0, "Test::More" => "0.88", "Try::Tiny" => 0 }, "VERSION" => "4.20", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Dist-Zilla-Plugins-CJM-4.20/corpus/0000755000175000017500000000000012206160014015050 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/README0000644000175000017500000000032712206160014015732 0ustar cjmcjm This directory contains a set of distributions used by testing. Since the distributions contain *.t files, it's easier to put them outside of ./t so that recursive test harnesses do not try running their dists. Dist-Zilla-Plugins-CJM-4.20/corpus/DZT/0000755000175000017500000000000012206160014015511 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/DZT/README0000644000175000017500000000072412206160014016374 0ustar cjmcjm{{$dist}} version {{$version}}, released {{$date}} Blah blah blah. INSTALLATION To install these modules, run the following commands: perl Makefile.PL make make test make install DEPENDENCIES {{ $t->dependency_list }} CHANGES Here's what's new in version {{$version}} of {{$dist}}: (See the file "Changes" for the full revision history.) {{$changes}} COPYRIGHT AND LICENSE {{ local $_ = $zilla->license->notice; chomp; $_ }} Dist-Zilla-Plugins-CJM-4.20/corpus/DZT/t/0000755000175000017500000000000012206160014015754 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/DZT/t/basic.t0000644000175000017500000000040312206160014017217 0ustar cjmcjmuse strict; use warnings; use Test::More 0.88; use DZT::Sample; # SUGGEST PREREQ: Test::Other is_deeply( DZT::Sample->return_arrayref_of_values_passed(1, [ 2 ], { 3 => 4 }), [ 1, [ 2 ], { 3 => 4 } ], "we do what we say on the tin", ); done_testing; Dist-Zilla-Plugins-CJM-4.20/corpus/DZT/lib/0000755000175000017500000000000012206160014016257 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/DZT/lib/DZT/0000755000175000017500000000000012206160014016720 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/DZT/lib/DZT/Sample.pm0000644000175000017500000000106212206160014020476 0ustar cjmcjmpackage DZT::Sample; # ABSTRACT: Sample DZ Dist use strict; use warnings; # This { {comment}} should be unchanged. # RECOMMEND PREREQ: Foo::Bar 1.00 # RECOMMEND PREREQ: Foo::Baz our $VERSION = '0.04'; # This file is part of {{$dist}} {{$dist_version}} ({{$date}}) =attr bogus Don't have this. =method return_arrayref_of_values_passed blah =cut sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; =head1 DEPENDENCIES DZT::Sample requires {{$t->dependency_link('Bloofle')}} and {{$t->dependency_link('Foo::Bar')}}. =cut Dist-Zilla-Plugins-CJM-4.20/corpus/DZT/lib/DZT/Manual.pod0000644000175000017500000000017012206160014020637 0ustar cjmcjm=head1 NAME DZT::Manual - documentation =head1 VERSION This document ({{$module}}) describes {{$dist}} {{$version}}. Dist-Zilla-Plugins-CJM-4.20/corpus/gitvercheck.git0000644000175000017500000001204112206160014020051 0ustar cjmcjmblob mark :1 data 468 {{$dist}} version {{$version}}, released {{$date}} Blah blah blah. INSTALLATION To install these modules, run the following commands: perl Makefile.PL make make test make install DEPENDENCIES {{ $t->dependency_list }} CHANGES Here's what's new in version {{$version}} of {{$dist}}: (See the file "Changes" for the full revision history.) {{$changes}} COPYRIGHT AND LICENSE {{ local $_ = $zilla->license->notice; chomp; $_ }} blob mark :2 data 178 name = DZT-Sample author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [GatherDir] [VersionFromModule] [GitVersionCheckCJM] blob mark :3 data 98 package DZT::First; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.01'; blob mark :4 data 456 package DZT::Sample; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.01'; # This file is part of {{$dist}} {{$dist_version}} ({{$date}}) =attr bogus Don't have this. =method return_arrayref_of_values_passed blah =cut sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; =head1 DEPENDENCIES DZT::Sample requires {{$t->dependency_link('Bloofle')}} and {{$t->dependency_link('Foo::Bar')}}. =cut blob mark :5 data 228 use strict; use warnings; use Test::More 0.88; use DZT::Sample; is_deeply( DZT::Sample->return_arrayref_of_values_passed(1, [ 2 ], { 3 => 4 }), [ 1, [ 2 ], { 3 => 4 } ], "we do what we say on the tin", ); done_testing; reset refs/tags/0.01 commit refs/tags/0.01 mark :6 author E. Xavier Ample 1289243198 -0600 committer E. Xavier Ample 1289243198 -0600 data 13 Version 0.01 M 100644 :1 README M 100644 :2 dist.ini M 100644 :3 lib/DZT/First.pm M 100644 :4 lib/DZT/Sample.pm M 100644 :5 t/basic.t blob mark :7 data 456 package DZT::Sample; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.02'; # This file is part of {{$dist}} {{$dist_version}} ({{$date}}) =attr bogus Don't have this. =method return_arrayref_of_values_passed blah =cut sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; =head1 DEPENDENCIES DZT::Sample requires {{$t->dependency_link('Bloofle')}} and {{$t->dependency_link('Foo::Bar')}}. =cut blob mark :8 data 107 package DZT::Sample::Second; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.02'; commit refs/tags/0.02 mark :9 author E. Xavier Ample 1289243358 -0600 committer E. Xavier Ample 1289243358 -0600 data 13 Version 0.02 from :6 M 100644 :7 lib/DZT/Sample.pm M 100644 :8 lib/DZT/Sample/Second.pm blob mark :10 data 120 package DZT::First; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.03'; # added in version 3 blob mark :11 data 456 package DZT::Sample; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.03'; # This file is part of {{$dist}} {{$dist_version}} ({{$date}}) =attr bogus Don't have this. =method return_arrayref_of_values_passed blah =cut sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; =head1 DEPENDENCIES DZT::Sample requires {{$t->dependency_link('Bloofle')}} and {{$t->dependency_link('Foo::Bar')}}. =cut commit refs/tags/0.03 mark :12 author E. Xavier Ample 1289243521 -0600 committer E. Xavier Ample 1289243521 -0600 data 22 Starting version 0.03 from :9 M 100644 :10 lib/DZT/First.pm M 100644 :11 lib/DZT/Sample.pm blob mark :13 data 107 package DZT::Sample::Second; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.03'; commit refs/tags/0.03 mark :14 author E. Xavier Ample 1289243545 -0600 committer E. Xavier Ample 1289243545 -0600 data 22 Finished version 0.03 from :12 M 100644 :13 lib/DZT/Sample/Second.pm blob mark :15 data 456 package DZT::Sample; # ABSTRACT: Sample DZ Dist use strict; use warnings; our $VERSION = '0.04'; # This file is part of {{$dist}} {{$dist_version}} ({{$date}}) =attr bogus Don't have this. =method return_arrayref_of_values_passed blah =cut sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; =head1 DEPENDENCIES DZT::Sample requires {{$t->dependency_link('Bloofle')}} and {{$t->dependency_link('Foo::Bar')}}. =cut commit refs/heads/master mark :16 author E. Xavier Ample 1289243648 -0600 committer E. Xavier Ample 1289243648 -0600 data 13 Version 0.04 from :14 M 100644 :15 lib/DZT/Sample.pm reset refs/heads/master from :16 reset refs/tags/0.04 from :16 tag 0.04 from :16 tagger E. Xavier Ample 1289243653 -0600 data 14 Tagging v0.04 tag 0.03 from :14 tagger E. Xavier Ample 1289243598 -0600 data 14 Tagging v0.03 tag 0.02 from :9 tagger E. Xavier Ample 1289243370 -0600 data 14 Tagging v0.02 tag 0.01 from :6 tagger E. Xavier Ample 1289243224 -0600 data 14 Tagging v0.01 Dist-Zilla-Plugins-CJM-4.20/corpus/archives/0000755000175000017500000000000012206160014016654 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/archives/DZT-Sample-0.01.tar.gz0000644000175000017500000000000012206160014022225 0ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/archives/DZT-Sample-0.02.tar.gz0000644000175000017500000000000012206160014022226 0ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/corpus/archives/DZT-Sample-0.03.tar.gz0000644000175000017500000000000012206160014022227 0ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/Template_strict.patch0000644000175000017500000000366012206160014017726 0ustar cjmcjmThis patch for Text::Template 1.45 adds support for the STRICT option. This automatically prepends 'use strict' to your template code, but still allows you to use variables defined by the HASH option. --- lib/Text/Template.pm 2008-04-16 18:38:08.000000000 -0500 +++ lib/Text/Template.pm 2010-03-12 12:21:31.416024029 -0600 @@ -255,6 +255,7 @@ my $fi_eval_package; my $fi_scrub_package = 0; my $fi_filename = _param('filename') || $fi_self->{FILENAME} || 'template'; + my $fi_strict = _param('strict', %fi_a); my $fi_prepend = _param('prepend', %fi_a); unless (defined $fi_prepend) { @@ -272,6 +273,7 @@ $fi_eval_package = caller; } + my @fi_varlist; my $fi_install_package; if (defined $fi_varhash) { if (defined $fi_package) { @@ -281,7 +283,12 @@ } else { $fi_install_package = $fi_eval_package; # The gensymmed one } - _install_hash($fi_varhash => $fi_install_package); + @fi_varlist = _install_hash($fi_varhash => $fi_install_package); + } + + if ($fi_strict) { + $fi_prepend = "use vars qw(@fi_varlist);$fi_prepend" if @fi_varlist; + $fi_prepend = "use strict;$fi_prepend"; } if (defined $fi_package && defined $fi_safe) { @@ -441,6 +448,7 @@ $hashlist = [$hashlist]; } my $hash; + my @varlist; foreach $hash (@$hashlist) { my $name; foreach $name (keys %$hash) { @@ -449,13 +457,23 @@ local *SYM = *{"$ {dest}::$name"}; if (! defined $val) { delete ${"$ {dest}::"}{$name}; + my $match = qr/^.\Q$name\E$/; + @varlist = grep { $_ !~ $match } @varlist; } elsif (ref $val) { *SYM = $val; + push @varlist, do { + if (UNIVERSAL::isa($val, 'ARRAY')) { '@' } + elsif (UNIVERSAL::isa($val, 'HASH')) { '%' } + else { '$' } + } . $name; } else { *SYM = \$val; + push @varlist, '$' . $name; } } } + + @varlist; } sub TTerror { $ERROR } Dist-Zilla-Plugins-CJM-4.20/lib/0000755000175000017500000000000012206160014014303 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/0000755000175000017500000000000012206160014015206 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/0000755000175000017500000000000012206160014016261 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Role/0000755000175000017500000000000012206160014017162 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Role/HashDumper.pm0000644000175000017500000001371112206160014021563 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Role::HashDumper; # # Copyright 2011 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 4 Nov 2011 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Dump selected hash keys as a string #--------------------------------------------------------------------- our $VERSION = '4.13'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose::Role; use namespace::autoclean; use Scalar::Util 'reftype'; sub hash_as_string { my ($self, $hash) = @_; # Format the hash as a string: require Data::Dumper; my $data = Data::Dumper->new([ $hash ]) ->Indent(1)->Sortkeys(1)->Terse(1)->Dump; if ($data eq "{}\n") { $data = ''; } else { $data =~ s/^\{\n// or die "Dump prefix! $data"; $data =~ s/\n\}\n\z/,/ or die "Dump postfix! $data"; } return $data; } # end hash_as_string sub extract_keys { my $self = shift; return $self->hash_as_string( $self->extract_keys_as_hash(@_) ); } # end extract_keys sub extract_keys_as_hash { my $self = shift; my $type = shift; my $hash = shift; # Extract the wanted keys from the hash: my %want; foreach my $key (@_) { $self->log_debug("Fetching $type key $key"); next unless defined $hash->{$key}; # Skip keys with empty value: my $reftype = reftype($hash->{$key}); if (not $reftype) {} elsif ($reftype eq 'HASH') { next unless %{ $hash->{$key} } } elsif ($reftype eq 'ARRAY') { next unless @{ $hash->{$key} } } $want{$key} = $hash->{$key}; } # end foreach $key return \%want; } # end extract_keys_as_hash no Moose::Role; 1; __END__ =head1 NAME Dist::Zilla::Role::HashDumper - Dump selected hash keys as a string =head1 VERSION This document describes version 4.13 of Dist::Zilla::Role::HashDumper, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 DESCRIPTION Plugins implementing HashDumper may call their own C method to extract selected keys from a hash and return a string suitable for injecting into Perl code. They may also call the C method to do the same for an entire hash. =head1 METHODS =head2 extract_keys my $string = $plugin->extract_keys($name, \%hash, @keys); eval "%new_hash = ($string);"; This combines C and C. It constructs a string of properly quoted keys and values from selected keys in a hash. (Note that C<\%hash> is a reference, but C<@keys> is not.) The C<$name> is used only in a log_debug message. If any key has no value (or its value is an empty hash or array ref) it will be omitted from the list. If all keys are omitted, the empty string is returned. Otherwise, the result always ends with a comma. =head2 extract_keys_as_hash my $hashref = $plugin->extract_keys_as_hash($name, \%hash, @keys); This constructs a hashref from from selected keys in a hash. (Note that C<\%hash> is a reference, but C<@keys> is not.) The C<$name> is used only in a log_debug message. If any key has no value (or its value is an empty hash or array ref) it will be omitted from the new hashref. If all keys are omitted, an empty hashref is returned. =head2 hash_as_string my $string = $plugin->hash_as_string(\%hash); eval "%new_hash = ($string);"; This constructs a string of properly quoted keys and values from a hash. If the hash is empty, the empty string will be returned. Otherwise, the result always ends with a comma. =head1 CONFIGURATION AND ENVIRONMENT Dist::Zilla::Role::HashDumper requires no configuration files or environment variables. =head1 DEPENDENCIES L. =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Role/ModuleInfo.pm0000644000175000017500000001136012206160014021562 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Role::ModuleInfo; # # Copyright 2010 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 25 Sep 2009 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Create Module::Metadata object from Dist::Zilla::File #--------------------------------------------------------------------- our $VERSION = '4.17'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose::Role; use autodie ':io'; use File::Temp 0.19 (); # need newdir use Module::Metadata (); use Path::Class qw(dir file); sub get_module_info { my $self = shift; my $file = shift; # Any additional parameters get passed to M::Metadata->new_from_file # To be safe, reset the global variables controlling IO to their defaults: local ($/, $,, $\) = "\n"; # Module::Metadata doesn't have a new_from_string method, # so we'll write the current contents to a temporary file: my $tempdirObject = File::Temp->newdir(); my $dir = dir("$tempdirObject"); my $modPath = file($file->name); # Module::Metadata only cares about the basename of the file: my $tempname = $dir->file($modPath->basename); open(my $temp, '>', $tempname); print $temp $file->content; close $temp; return(Module::Metadata->new_from_file("$tempname", @_) or die "Unable to get module info from " . $file->name . "\n"); } # end get_module_info no Moose::Role; 1; __END__ =head1 NAME Dist::Zilla::Role::ModuleInfo - Create Module::Metadata object from Dist::Zilla::File =head1 VERSION This document describes version 4.17 of Dist::Zilla::Role::ModuleInfo, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 DESCRIPTION Plugins implementing ModuleInfo may call their own C method to construct a L object. (Module::Metadata is the new name for Module::Build::ModuleInfo, now that it's been split from the Module-Build distribution.) =head1 METHODS =head2 get_module_info my $info = $plugin->get_module_info($file); This constructs a Module::Metadata object from the contents of a C<$file> object that does Dist::Zilla::Role::File. Any additional arguments are passed along to C<< Module::Metadata->new_from_file >>. =head1 CONFIGURATION AND ENVIRONMENT Dist::Zilla::Role::ModuleInfo requires no configuration files or environment variables. =head1 DEPENDENCIES L. =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/0000755000175000017500000000000012206160014017517 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/Metadata.pm0000644000175000017500000001157512206160014021606 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::Metadata; # # Copyright 2010 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 2 Dec 2010 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Add arbitrary keys to distmeta #--------------------------------------------------------------------- our $VERSION = '3.03'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; has metadata => ( is => 'ro', isa => 'HashRef', required => 1, ); with 'Dist::Zilla::Role::MetaProvider'; #--------------------------------------------------------------------- sub BUILDARGS { my ($class, @arg) = @_; my %copy = ref $arg[0] ? %{$arg[0]} : @arg; my $zilla = delete $copy{zilla}; my $name = delete $copy{plugin_name}; my %metadata; while (my ($key, $value) = each %copy) { my @keys = split (/\./, $key, -1); my $hash = \%metadata; while (@keys > 1) { $hash = $hash->{shift @keys} ||= {}; } $hash->{$keys[0]} = $value; } # end while each %copy return { zilla => $zilla, plugin_name => $name, metadata => \%metadata, }; } # end BUILDARGS #--------------------------------------------------------------------- sub mvp_multivalue_args { return qw(author keywords license no_index.file no_index.directory no_index.package no_index.namespace resources.license ); } # end mvp_multivalue_args #===================================================================== no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::Metadata - Add arbitrary keys to distmeta =head1 VERSION This document describes version 3.03 of Dist::Zilla::Plugin::Metadata, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [Metadata] dynamic_config = 1 resources.homepage = http://example.com resources.bugtracker.mailto = bugs@example.com =head1 DESCRIPTION The Metadata plugin allows you to add arbitrary keys to your distribution's metadata. It splits each key on '.' and uses that as a multi-level hash key. It doesn't try to do any validation; the MetaJSON or MetaYAML plugin will do that. It does know which keys in the spec are List values; those keys can be repeated. =for Pod::Coverage mvp_multivalue_args =head1 CONFIGURATION AND ENVIRONMENT Dist::Zilla::Plugin::Metadata requires no configuration files or environment variables. =head1 DEPENDENCIES Metadata requires L (4.300009 or later). =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/ArchiveRelease.pm0000644000175000017500000001533012206160014022741 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::ArchiveRelease; # # Copyright 2010 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 6 Mar 2010 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Move the release tarball to an archive directory #--------------------------------------------------------------------- use 5.008; our $VERSION = '4.00'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::BeforeRelease'; with 'Dist::Zilla::Role::Releaser'; with 'Dist::Zilla::Role::FilePruner'; use Path::Class (); #--------------------------------------------------------------------- has _directory => ( is => 'ro', isa => 'Str', default => 'releases', init_arg => 'directory', writer => '_set_directory', ); sub directory { my $self = shift; my $dir = $self->_directory; # Convert ~ to home directory: if ($dir =~ /^~/) { require File::HomeDir; File::HomeDir->VERSION(0.81); $dir =~ s/^~(\w+)/ File::HomeDir->users_home("$1") /e; $dir =~ s/^~/ File::HomeDir->my_home /e; $self->_set_directory($dir); } # end if $dir begins with ~ Path::Class::dir($dir)->absolute($self->zilla->root); } # end get_directory #--------------------------------------------------------------------- # Format a path for display: sub pretty_path { my ($self, $path) = @_; my $root = $self->zilla->root; $path = $path->relative($root) if $root->subsumes($path); "$path"; } # end pretty_path #--------------------------------------------------------------------- # Don't distribute previously archived releases: sub prune_files { my $self = shift; my $root = $self->zilla->root; my $dir = $self->directory; if ($root->subsumes($dir)) { $dir = $dir->relative($root); my $files = $self->zilla->files; @$files = grep { not $dir->subsumes($_->name) } @$files; } # end if archive directory is inside root return; } # end prune_files #--------------------------------------------------------------------- sub before_release { my ($self, $tgz) = @_; my $dir = $self->directory; # If the directory doesn't exist, create it: unless (-d $dir) { my $dirR = $self->pretty_path($dir); mkdir $dir or $self->log_fatal("Unable to create directory $dirR: $!"); $self->log("Created directory $dirR"); } # If the tarball has already been archived, abort: my $file = $dir->file($tgz->basename); $self->log_fatal($self->pretty_path($file) . " already exists") if -e $file; } # end before_release #--------------------------------------------------------------------- # Main entry point: sub release { my ($self, $tgz) = @_; chmod(0444, $tgz); my $dest = $self->directory->file($tgz->basename); my $destR = $self->pretty_path($dest); require File::Copy; File::Copy::move($tgz, $dest) or $self->log_fatal("Failed to move to $destR: $!"); $self->log("Moved to $destR"); } # end release #--------------------------------------------------------------------- no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::ArchiveRelease - Move the release tarball to an archive directory =head1 VERSION This document describes version 4.00 of Dist::Zilla::Plugin::ArchiveRelease, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [ArchiveRelease] directory = releases ; this is the default =head1 DESCRIPTION If included, this plugin will cause the F command to mark the tarball read-only and move it to an archive directory. You can combine this with another Releaser plugin (like L), but it must be the last Releaser in your config (or the other Releasers won't be able to find the file being released). It also acts as a FilePruner in order to prevent Dist::Zilla from including the archived releases in future builds. =head1 ATTRIBUTES =head2 directory The directory to which the tarball will be moved. It may begin with C<~> (or C<~user>) to mean your (or some other user's) home directory. Defaults to F. If the directory doesn't exist, it will be created during the BeforeRelease phase. All files inside this directory will be pruned from the distribution. =for Pod::Coverage before_release release pretty_path prune_files =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/MakeMaker/0000755000175000017500000000000012206160014021354 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/MakeMaker/Custom.pm0000644000175000017500000003603012206160014023166 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::MakeMaker::Custom; # # Copyright 2010 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 11 Mar 2010 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Allow a dist to have a custom Makefile.PL #--------------------------------------------------------------------- our $VERSION = '4.15'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; use Moose::Autobox; use Dist::Zilla::Plugin::MakeMaker 4.300009; # improved subclassing extends 'Dist::Zilla::Plugin::MakeMaker'; with qw(Dist::Zilla::Role::FilePruner Dist::Zilla::Role::HashDumper); # We're trying to make the template executable before it's filled in, # so we want delimiters that look like comments: has '+delim' => ( default => sub { [ '##{', '##}' ] }, ); # Need to cache write_makefile_args for the get_default method has _mmc_write_makefile_args => ( is => 'ro', isa => 'HashRef', lazy => 1, init_arg => undef, builder => 'write_makefile_args', ); # Get rid of any META.yml we may have picked up from MakeMaker: sub prune_files { my ($self) = @_; my $files = $self->zilla->files; @$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and $_->isa('Dist::Zilla::File::OnDisk')) } @$files; return; } # end prune_files #--------------------------------------------------------------------- sub get_prereqs { my ($self, $api_version) = @_; if ($api_version) { $self->log_fatal("api_version $api_version is not supported") unless $api_version == 1; local $@; $self->log(["WARNING: Dist::Zilla %s does not support api_version %d", Dist::Zilla->VERSION, $api_version ]) unless eval { Dist::Zilla::Plugin::MakeMaker->VERSION( 4.300032 ) }; } # Get the prerequisites as a hashref: my $prereqs = $self->extract_keys_as_hash( WriteMakefile => $self->_mmc_write_makefile_args, qw(BUILD_REQUIRES CONFIGURE_REQUIRES PREREQ_PM TEST_REQUIRES) ); # If we have TEST_REQUIRES, but the template doesn't understand them, # merge them into BUILD_REQUIRES (if any) if ($prereqs->{TEST_REQUIRES} and not $api_version) { if ($prereqs->{BUILD_REQUIRES}) { # have both BUILD_REQUIRES & TEST_REQUIRES, so merge them: require CPAN::Meta::Requirements; CPAN::Meta::Requirements->VERSION(2.121); my ($buildreq, $testreq) = map { CPAN::Meta::Requirements->from_string_hash( $prereqs->{$_} ) } qw(BUILD_REQUIRES TEST_REQUIRES); $buildreq->add_requirements( $testreq ); delete $prereqs->{TEST_REQUIRES}; $prereqs->{BUILD_REQUIRES} = $buildreq->as_string_hash; } else { # no BUILD_REQUIRES, so we can just rename TEST_REQUIRES: $prereqs->{BUILD_REQUIRES} = delete $prereqs->{TEST_REQUIRES}; } } # end if TEST_REQUIRES and $api_version is 0 $self->hash_as_string( $prereqs ); } # end get_prereqs #--------------------------------------------------------------------- sub get_default { my $self = shift; return $self->extract_keys(WriteMakefile => $self->_mmc_write_makefile_args, @_); } # end get_default sub add_file {} # Don't let parent class add any files #--------------------------------------------------------------------- around setup_installer => sub { my $orig = shift; my $self = shift; my $file = $self->zilla->files->grep(sub { $_->name eq 'Makefile.PL' })->head or $self->log_fatal("No Makefile.PL found in dist"); my $write_makefile_args = $self->_mmc_write_makefile_args; my $perl_prereq = $write_makefile_args->{MIN_PERL_VERSION}; my $share_dir_code = $self->share_dir_code; # Process Makefile.PL through Text::Template: my %data = ( dist => $self->zilla->name, meta => $self->zilla->distmeta, plugin => \$self, version => $self->zilla->version, zilla => \$self->zilla, default_args => $write_makefile_args, eumm_version => \($self->eumm_version), perl_prereq => \$perl_prereq, share_dir_code => $share_dir_code, # Recreate share_dir_block for backwards compatibility: share_dir_block => [ $share_dir_code->{preamble} || '', $share_dir_code->{postamble} || '' ], ); # The STRICT option hasn't been implemented in a released version of # Text::Template, but you can apply Template_strict.patch. Since # Text::Template ignores unknown options, this code will still work # even if you don't apply the patch; you just won't get strict checking. my %parms = ( STRICT => 1, BROKEN => sub { $self->template_error(@_) }, ); $self->log_debug("Processing Makefile.PL as template"); $file->content($self->fill_in_string($file->content, \%data, \%parms)); return; }; # end setup_installer sub template_error { my ($self, %e) = @_; # Put the filename into the error message: my $err = $e{error}; $err =~ s/ at template line (?=\d)/ at Makefile.PL line /g; $self->log_fatal($err); } # end template_error #--------------------------------------------------------------------- no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::MakeMaker::Custom - Allow a dist to have a custom Makefile.PL =head1 VERSION This document describes version 4.15 of Dist::Zilla::Plugin::MakeMaker::Custom, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In F: [MakeMaker::Custom] eumm_version = 0.34 ; the default comes from the MakeMaker plugin In your F: use ExtUtils::MakeMaker; ##{ $share_dir_code{preamble} || '' ##} my %args = ( NAME => "My::Module", ##{ $plugin->get_default(qw(ABSTRACT AUTHOR LICENSE VERSION)) ##} ##{ $plugin->get_prereqs(1) ##} ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $args{TEST_REQUIRES}; my $br = $args{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $args{BUILD_REQUIRES}; my $pp = $args{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $args{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; delete $args{LICENSE} unless eval { ExtUtils::MakeMaker->VERSION(6.31) }; WriteMakefile(%args); ##{ $share_dir_code{postamble} || '' ##} Of course, your F should be more complex than that, or you don't need this plugin. =head1 DESCRIPTION This plugin is for people who need something more complex than the auto-generated F or F generated by the L or L plugins. It is a subclass of the L, but it does not write a F for you. Instead, you write your own F, which may do anything L is capable of. This plugin will process F as a template (using L), which allows you to add data from Dist::Zilla to the version you distribute (if you want). The template delimiters are C<##{> and C<##}>, because that makes them look like comments. That makes it easier to have a F that works both before and after it is processed as a template. This is particularly useful for XS-based modules, because it can allow you to build and test the module without the overhead of S> after every small change. The template may use the following variables: =over =item C<%default_args> The hash of arguments for WriteMakefile generated by the normal MakeMaker plugin. =item C<$dist> The name of the distribution. =item C<$eumm_version> The minimum version of ExtUtils::MakeMaker required (from the C attribute of this plugin). =item C<%meta> The hash of metadata (in META 2 format) that will be stored in F. =item C<$perl_prereq> The minimum version of Perl required (from the prerequisites in the metadata). May be C. Equivalent to C<$default_args{MIN_PERL_VERSION}>. =item C<$plugin> The MakeMaker::Custom object that is processing the template. =item C<%share_dir_code> A hash of strings containing the code for loading C (if it's used by this dist). Put S> after the S> line, and put S> after the C call. (You can omit the S> if you're sure the dist is using File::ShareDir. For backwards compatibility, this code is also available in the array C<@share_dir_block>, but you should update your templates to use C<%share_dir_code> instead. =item C<$version> The distribution's version number. =item C<$zilla> The Dist::Zilla object that is creating the distribution. =back =head2 Using MakeMaker::Custom with AutoPrereqs If you are using the L plugin, then you will probably want to set its C to a FileFinder that includes F. You may also want to set this plugin's C parameter to 0 and allow AutoPrereqs to get the version from your S> line. Example F configuration: [MakeMaker::Custom] eumm_version = 0 ; AutoPrereqs gets actual version from Makefile.PL [FileFinder::ByName / :MakefilePL] file = Makefile.PL [AutoPrereqs] :version = 4.300005 ; need configure_finder configure_finder = :MakefilePL ; Add next line if your Makefile.PL uses modules you ship in inc/ configure_finder = :IncModules Then in your F you'd say: use ExtUtils::MakeMaker 6.32; # or whatever version you need =head1 METHODS =head2 get_default $plugin->get_default(qw(key1 key2 ...)) A template can call this method to extract the specified key(s) from the default WriteMakefile arguments created by the normal MakeMaker plugin and have them formatted into a comma-separated list suitable for a hash constructor or a function's parameter list. If any key has no value (or its value is an empty hash or array ref) it will be omitted from the list. If all keys are omitted, the empty string is returned. Otherwise, the result always ends with a comma. =head2 get_prereqs $plugin->get_prereqs($api_version); This is mostly equivalent to $plugin->get_default(qw(BUILD_REQUIRES CONFIGURE_REQUIRES PREREQ_PM TEST_REQUIRES)) In other words, it returns all the keys that describe the distribution's prerequisites. The C<$api_version> indicates what keys the template can handle. The currently defined values are: =over 8 =item C<0> (or undef) - Fold TEST_REQUIRES into BUILD_REQUIRES. This provides backwards compatibility with older versions of this plugin and Dist::Zilla. =item C<1> - Return TEST_REQUIRES (introduced in ExtUtils::MakeMaker 6.63_03) as a separate key (assuming it's not empty), which requires Dist::Zilla 4.300032 or later. Your F should either require ExtUtils::MakeMaker 6.63_03, or fold TEST_REQUIRES into BUILD_REQUIRES if an older version is used (as shown in the SYNOPSIS). =back =head1 SEE ALSO The L plugin does basically the same thing as this plugin, but for F (if you prefer L). The L plugin allows you to do similar things to your F, but it works in a very different way. With MakeMaker::Awesome, you subclass the plugin and override the methods that generate F. In my opinion, MakeMaker::Awesome has two disadvantages: it's unnecessarily complex, and it doesn't allow you to build your module without doing C. The only advantage of MakeMaker::Awesome that I can see is that if you had several dists with very similar Fs, you could write one subclass of MakeMaker::Awesome and use it in each dist. =for Pod::Coverage add_file prune_files setup_installer template_error =head1 DEPENDENCIES MakeMaker::Custom requires L (4.300009 or later) and L. I also recommend applying F to Text::Template. This will add support for the STRICT option, which will help catch errors in your templates. =head1 INCOMPATIBILITIES You must not use this in conjunction with the L or L plugins. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/VersionFromModule.pm0000644000175000017500000001011612206160014023473 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::VersionFromModule; # # Copyright 2009 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 23 Sep 2009 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Get distribution version from its main_module #--------------------------------------------------------------------- our $VERSION = '0.08'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; with 'Dist::Zilla::Role::VersionProvider'; with 'Dist::Zilla::Role::ModuleInfo'; sub provide_version { my ($self) = @_; my $main_module = $self->zilla->main_module; my $module = $main_module->name; my $pm_info = $self->get_module_info($main_module); my $ver = $pm_info->version; die "Unable to get version from $module" unless defined $ver; $self->log("dist version $ver (from $module)"); "$ver"; # Need to stringify version object } # end provide_version #===================================================================== # Package Return Value: no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::VersionFromModule - Get distribution version from its main_module =head1 VERSION This document describes version 0.08 of Dist::Zilla::Plugin::VersionFromModule, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [VersionFromModule] =head1 DESCRIPTION If included, this plugin will set the distribution's version from the C's version. (You should not specify a version in your F.) =head1 INCOMPATIBILITIES Since it will always return a version, VersionFromModule should not be used with any other VersionProvider plugins. =for Pod::Coverage provide_version =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/RecommendedPrereqs.pm0000644000175000017500000001355212206160014023647 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::RecommendedPrereqs; # # Copyright 2011 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 31 Oct 2011 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Look for comments recommending prerequisites #--------------------------------------------------------------------- our $VERSION = '4.06'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use 5.008; use Moose; with( 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, 'Dist::Zilla::Role::FileFinderUser' => { method => 'found_test_files', finder_arg_names => [ 'test_finder' ], default_finders => [ ':TestFiles' ], }, ); use namespace::autoclean; #===================================================================== use CPAN::Meta::Requirements (); use version (); sub register_prereqs { my $self = shift; my @sets = ( [ runtime => 'found_files' ], [ test => 'found_test_files' ], ); my %runtime; for my $fileset (@sets) { my ($phase, $method) = @$fileset; my %req = map { $_ => CPAN::Meta::Requirements->new } qw(RECOMMEND SUGGEST); my $files = $self->$method; foreach my $file (@$files) { my $content = $file->content; while ($content =~ /^ [ \t]* \# [ \t]* (RECOMMEND|SUGGEST) [ \t]+ PREREQ: [ \t]* (\S+) (?: [ \t]+ (\S+) )?/mgx) { $req{$1}->add_minimum($2, $3 || 0); } } # end foreach $file # we're done, add what we've found while (my ($type, $req) = each %req) { $req = $req->as_string_hash; if ($phase eq 'runtime') { $runtime{$type} = $req; } else { delete $req->{$_} for grep { exists $req->{$_} and $runtime{$type}{$_} ge $req->{$_} } keys %{ $runtime{$type} || {} }; } $self->zilla->register_prereqs({ phase => $phase, type => "\L${type}s" }, %$req) if %$req; } } # end foreach $fileset } # end register_prereqs #===================================================================== # Package Return Value: __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::RecommendedPrereqs - Look for comments recommending prerequisites =head1 VERSION This document describes version 4.06 of Dist::Zilla::Plugin::RecommendedPrereqs, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [RecommendedPrereqs] In your code: # RECOMMEND PREREQ: Foo::Bar 1.0 # SUGGEST PREREQ: Foo::Suggested =head1 DESCRIPTION If included, this plugin will look for special comments that specify suggested or recommended prerequisites. It's intended as a companion to L, which can only determine required prerequisites. Each comment must be on a line by itself, and begin with either S> or S> followed by the module name. The name may be followed by the minimum version, which may in turn be followed by a note explaining the prereq (which will be ignored). If the note is present, the version I be present, even if it's 0. =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS The parser currently just looks for lines beginning with a C<#> (which may be preceded by whitespace). This means it looks in strings and here docs, as well as after C<__END__>. This behavior may be fixed in the future and should not be depended on. =for Pod::Coverage register_prereqs =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm0000644000175000017500000002016312206160014023440 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::GitVersionCheckCJM; # # Copyright 2009 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 15 Nov 2009 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Ensure version numbers are up-to-date #--------------------------------------------------------------------- our $VERSION = '4.13'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use version 0.77 (); use Moose; use Moose::Autobox; with( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::ModuleInfo', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ qw(:InstallModules :IncModules :ExecFiles) ], }, ); # RECOMMEND PREREQ: Git::Wrapper use Git::Wrapper (); # AutoPrereqs skips this #--------------------------------------------------------------------- # Helper sub to run a git command and split on NULs: sub _git0 { my ($git, $command, @args) = @_; my ($result) = do { local $/; $git->$command(@args) }; return unless defined $result; split(/\0/, $result); } # end _git0 #--------------------------------------------------------------------- # Main entry point: sub munge_files { my ($self) = @_; # Get the released versions: my $git = Git::Wrapper->new( $self->zilla->root->stringify ); my %released = map { /^v?([\d._]+)$/ ? ($1, 1) : () } $git->tag; # Get the list of modified but not-checked-in files: my %modified = map { $self->log_debug("mod: $_"); $_ => 1 } ( # Files that need to be committed: _git0($git, qw( diff_index -z HEAD --name-only )), # Files that are not tracked by git yet: _git0($git, qw( ls_files -oz --exclude-standard )), ); # Get the list of modules: my $files = $self->found_files; # Check each module: my $errors = 0; foreach my $file ($files->flatten) { ++$errors if $self->munge_file($file, $git, \%modified, \%released); } # end foreach $file die "Stopped because of errors\n" if $errors; } # end munge_files #--------------------------------------------------------------------- # Check the version of a module: sub munge_file { my ($self, $file, $git, $modifiedRef, $releasedRef) = @_; # Extract information from the module: my $pmFile = $file->name; $self->log_debug("checking $pmFile"); my $pm_info = $self->get_module_info($file); my $version = $pm_info->version or $self->log_fatal("ERROR: Can't find version in $pmFile"); my $distver = version->parse($self->zilla->version); # If module version matches dist version, it's current: # (unless that dist has already been released) if ($version == $distver) { return unless $releasedRef->{$version}; } # If the module version is greater than the dist version, that's a problem: if ($version > $distver) { $self->log("ERROR: $pmFile: $version exceeds dist version $distver"); return 1; } # If the module hasn't been committed yet, it needs updating: # (since it doesn't match the dist version) if ($modifiedRef->{$pmFile}) { if ($version == $distver) { $self->log("ERROR: $pmFile: dist version $version needs to be updated"); } else { $self->log("ERROR: $pmFile: $version needs to be updated"); } return 1; } # If the module's version doesn't match the dist, and that version # hasn't been released, that's a problem: unless ($releasedRef->{$version}) { $self->log("ERROR: $pmFile: $version does not seem to have been released, but is not current"); return 1; } # See if we checked in the module without updating the version: my ($lastChangedRev) = $git->rev_list(qw(-n1 HEAD --) => $pmFile); my ($inRelease) = $git->name_rev( qw(--refs), "refs/tags/$version", $lastChangedRev ); # We're ok if the last change was part of the indicated release: return if $inRelease =~ m! tags/\Q$version\E!; if ($version == $distver) { $self->log("ERROR: $pmFile: dist version $version needs to be updated"); } else { $self->log("ERROR: $pmFile: $version needs to be updated"); } return 1; } # end munge_file #--------------------------------------------------------------------- no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::GitVersionCheckCJM - Ensure version numbers are up-to-date =head1 VERSION This document describes version 4.13 of Dist::Zilla::Plugin::GitVersionCheckCJM, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [GitVersionCheckCJM] =head1 DESCRIPTION This plugin makes sure that module version numbers are updated as necessary. In a distribution with multiple module, I like to update a module's version only when a change is made to that module. In other words, a module's version is the version of the last distribution release in which it was modified. This plugin checks each module in the distribution, and makes sure that it matches one of two conditions: =over =item 1. There is a tag matching the version, and the last commit on that module is included in that tag. =item 2. The version matches the distribution's version, and that version has not been tagged yet (i.e., the distribution has not been released). =back If neither condition holds, it prints an error message. After checking all modules, it aborts the build if any module had an error. =for Pod::Coverage munge_file munge_files =head1 ATTRIBUTES =head2 finder This FileFinder provides the list of modules that will be checked. The default is C<:InstallModules>. The C attribute may be listed any number of times. =head1 DEPENDENCIES GitVersionCheckCJM requires L (4.300009 or later). It also requires L, although it is only listed as a recommended dependency for the distribution (to allow people who don't use Git to use the other plugins.) =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/ModuleBuild/0000755000175000017500000000000012206160014021724 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm0000644000175000017500000003102212206160014023532 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::ModuleBuild::Custom; # # Copyright 2010 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 11 Mar 2010 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Allow a dist to have a custom Build.PL #--------------------------------------------------------------------- our $VERSION = '4.16'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; use Moose::Autobox; extends 'Dist::Zilla::Plugin::ModuleBuild'; with qw(Dist::Zilla::Role::FilePruner Dist::Zilla::Role::HashDumper); # We're trying to make the template executable before it's filled in, # so we want delimiters that look like comments: has '+delim' => ( default => sub { [ '##{', '##}' ] }, ); has distmeta1 => ( is => 'ro', isa => 'HashRef', init_arg => undef, lazy => 1, builder => '_build_distmeta1', ); sub _build_distmeta1 { my $self = shift; require CPAN::Meta::Converter; CPAN::Meta::Converter->VERSION(2.101550); # improved downconversion my $converter = CPAN::Meta::Converter->new($self->zilla->distmeta); return $converter->convert(version => '1.4'); } # end _build_distmeta1 # Get rid of any META.yml we may have picked up from Module::Build: sub prune_files { my ($self) = @_; my $files = $self->zilla->files; @$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and $_->isa('Dist::Zilla::File::OnDisk')) } @$files; return; } # end prune_files sub get_meta { my $self = shift; # Extract the wanted keys from distmeta: return $self->extract_keys(distmeta1 => $self->distmeta1, @_); } # end get_meta #--------------------------------------------------------------------- sub get_prereqs { my ($self, $api_version) = @_; if ($api_version) { $self->log_fatal("api_version $api_version is not supported") unless $api_version == 1; local $@; $self->log(["WARNING: Dist::Zilla %s does not support api_version %d", Dist::Zilla->VERSION, $api_version ]) unless eval { Dist::Zilla::Plugin::ModuleBuild->VERSION( 4.300032 ) }; return $self->get_default(qw(build_requires configure_requires requires test_requires recommends conflicts)); } $self->get_meta(qw(build_requires configure_requires requires recommends conflicts)); } # end get_prereqs #--------------------------------------------------------------------- has _default_mb_args => ( is => 'ro', isa => 'HashRef', init_arg => undef, lazy => 1, builder => 'module_build_args', ); sub get_default { my $self = shift; return $self->extract_keys(module_build => $self->_default_mb_args, @_); } # end get_default #--------------------------------------------------------------------- sub setup_installer { my $self = shift; my $file = $self->zilla->files->grep(sub { $_->name eq 'Build.PL' })->head or $self->log_fatal("No Build.PL found in dist"); # Process Build.PL through Text::Template: my %data = ( dist => $self->zilla->name, meta => $self->distmeta1, meta2 => $self->zilla->distmeta, plugin => \$self, version => $self->zilla->version, zilla => \$self->zilla, ); # The STRICT option hasn't been implemented in a released version of # Text::Template, but you can apply Template_strict.patch. Since # Text::Template ignores unknown options, this code will still work # even if you don't apply the patch; you just won't get strict checking. my %parms = ( STRICT => 1, BROKEN => sub { $self->template_error(@_) }, ); $self->log_debug("Processing Build.PL as template"); $file->content($self->fill_in_string($file->content, \%data, \%parms)); return; } # end setup_installer sub template_error { my ($self, %e) = @_; # Put the filename into the error message: my $err = $e{error}; $err =~ s/ at template line (?=\d)/ at Build.PL line /g; $self->log_fatal($err); } # end template_error #--------------------------------------------------------------------- no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 NAME Dist::Zilla::Plugin::ModuleBuild::Custom - Allow a dist to have a custom Build.PL =head1 VERSION This document describes version 4.16 of Dist::Zilla::Plugin::ModuleBuild::Custom, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In F: [ModuleBuild::Custom] mb_version = 0.34 ; the default comes from the ModuleBuild plugin In your F: use Module::Build; my %module_build_args = ( module_name => 'Foo::Bar', ##{ $plugin->get_prereqs(1) ##} ##{ $plugin->get_default('share_dir') ##} ); unless ( eval { Module::Build->VERSION(0.4004) } ) { my $tr = delete $module_build_args{test_requires}; my $br = $module_build_args{build_requires}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } my $builder = Module::Build->new(%module_build_args); $builder->create_build_script; Of course, your F should be more complex than that, or you don't need this plugin. =head1 DESCRIPTION This plugin is for people who need something more complex than the auto-generated F or F generated by the L or L plugins. It is a subclass of the L, but it does not write a F for you. Instead, you write your own F, which may do anything L is capable of (except generate a compatibility F). This plugin will process F as a template (using L), which allows you to add data from Dist::Zilla to the version you distribute (if you want). The template delimiters are C<##{> and C<##}>, because that makes them look like comments. That makes it easier to have a F that works both before and after it is processed as a template. This is particularly useful for XS-based modules, because it can allow you to build and test the module without the overhead of S> after every small change. The template may use the following variables: =over =item C<$dist> The name of the distribution. =item C<$meta> The hash of metadata (in META 1.4 format) that will be stored in F. =item C<$meta2> The hash of metadata (in META 2 format) that will be stored in F. =item C<$plugin> The ModuleBuild::Custom object that is processing the template. =item C<$version> The distribution's version number. =item C<$zilla> The Dist::Zilla object that is creating the distribution. =back =head2 Using ModuleBuild::Custom with AutoPrereqs If you are using the L plugin, then you will probably want to set its C to a FileFinder that includes F. You may also want to set this plugin's C parameter to 0 and allow AutoPrereqs to get the version from your S> line. Example F configuration: [ModuleBuild::Custom] mb_version = 0 ; AutoPrereqs gets actual version from Build.PL [FileFinder::ByName / :BuildPL] file = Build.PL [AutoPrereqs] :version = 4.300005 ; need configure_finder configure_finder = :BuildPL ; Add next line if your Build.PL uses modules you ship in inc/ configure_finder = :IncModules Then in your F you'd say: use Module::Build 0.28; # or whatever version you need =head1 METHODS =head2 get_default $plugin->get_default(qw(key1 key2 ...)) A template can call this method to extract the specified key(s) from the default Module::Build arguments created by the normal ModuleBuild plugin and have them formatted into a comma-separated list suitable for a hash constructor or a method's parameter list. If any key has no value (or its value is an empty hash or array ref) it will be omitted from the list. If all keys are omitted, the empty string is returned. Otherwise, the result always ends with a comma. The most common usage would be ##{ $plugin->get_default('share_dir') ##} =head2 get_meta $plugin->get_meta(qw(key1 key2 ...)) A template can call this method to extract the specified key(s) from C and have them formatted into a comma-separated list suitable for a hash constructor or a method's parameter list. The keys (and the returned values) are from the META 1.4 spec, because that's what Module::Build uses in its API. If any key has no value (or its value is an empty hash or array ref) it will be omitted from the list. If all keys are omitted, the empty string is returned. Otherwise, the result always ends with a comma. =head2 get_prereqs $plugin->get_prereqs($api_version) This returns all the keys that describe the distribution's prerequisites. The C<$api_version> indicates what keys the template can handle. The currently defined values are: =over 8 =item C<0> (or undef) This is equivalent to $plugin->get_meta(qw(build_requires configure_requires requires recommends conflicts)) =item C<1> This adds C as a separate key (which requires Dist::Zilla 4.300032 or later). It's equivalent to $plugin->get_default(qw(build_requires configure_requires requires test_requires recommends conflicts)) Your F should either require Module::Build 0.4004, or fold test_requires into build_requires if an older version is used (as shown in the SYNOPSIS). =back =head1 SEE ALSO The L plugin does basically the same thing as this plugin, but for F (if you prefer L). =for Pod::Coverage prune_files setup_installer template_error =head1 DEPENDENCIES ModuleBuild::Custom requires L (4.300009 or later) and L. I also recommend applying F to Text::Template. This will add support for the STRICT option, which will help catch errors in your templates. =head1 INCOMPATIBILITIES You must not use this in conjunction with the L plugin. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut Dist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/Test/0000755000175000017500000000000012206160014020436 5ustar cjmcjmDist-Zilla-Plugins-CJM-4.20/lib/Dist/Zilla/Plugin/Test/PrereqsFromMeta.pm0000644000175000017500000001500412206160014024050 0ustar cjmcjm#--------------------------------------------------------------------- package Dist::Zilla::Plugin::Test::PrereqsFromMeta; # # Copyright 2011 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 22 Nov 2011 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Check the prereqs from our META.json #--------------------------------------------------------------------- use 5.008; our $VERSION = '4.20'; # This file is part of Dist-Zilla-Plugins-CJM 4.20 (August 24, 2013) use Moose; extends 'Dist::Zilla::Plugin::InlineFiles'; with 'Dist::Zilla::Role::FilePruner'; #--------------------------------------------------------------------- # Make sure we've included a META.json: sub prune_files { my $self = shift; my $files = $self->zilla->files; unless (grep { $_->name eq 'META.json' } @$files) { $self->log("WARNING: META.json not found, removing t/00-all_prereqs.t"); @$files = grep { $_->name ne 't/00-all_prereqs.t' } @$files; } # end unless META.json return; } # end prune_files #--------------------------------------------------------------------- no Moose; __PACKAGE__->meta->make_immutable; 1; =head1 NAME Dist::Zilla::Plugin::Test::PrereqsFromMeta - Check the prereqs from our META.json =head1 VERSION This document describes version 4.20 of Dist::Zilla::Plugin::Test::PrereqsFromMeta, released August 24, 2013 as part of Dist-Zilla-Plugins-CJM version 4.20. =head1 SYNOPSIS In your F: [Test::PrereqsFromMeta] =head1 DESCRIPTION This plugin will inject F into your dist. This test reads your F file and attempts to load all runtime prerequisites. It fails if any required runtime prerequisites fail to load. In addition, if C is set, it dumps out every module in C<%INC> along with its version. This can help you determine the cause of failures reported by CPAN Testers. =for Pod::Coverage prune_files =head1 INCOMPATIBILITIES None reported. =head1 BUGS AND LIMITATIONS No bugs have been reported. =head1 AUTHOR Christopher J. Madsen S >>> Please report any bugs or feature requests to S >>> or through the web interface at L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM >>. You can follow or contribute to Dist-Zilla-Plugins-CJM's development at L<< http://github.com/madsen/dist-zilla-plugins-cjm >>. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Christopher J. Madsen. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut __DATA__ ___[ t/00-all_prereqs.t ]___ #!perl use strict; use warnings; # This doesn't use Test::More because I don't want to clutter %INC # with modules that aren't prerequisites. my $test = 0; sub ok ($$) { my ($ok, $name) = @_; printf "%sok %d - %s\n", ($ok ? '' : 'not '), ++$test, $name; return $ok; } # end ok END { ok(0, 'unknown failure') unless $test; print "1..$test\n"; } sub get_version { my ($package) = @_; local $@; my $version = eval { $package->VERSION }; defined $version ? $version : 'undef'; } # end get_version TEST: { ok(open(META, ') { last if /^\s*"prereqs" : \{\s*\z/; } # end while ok(defined $_, 'found prereqs') or last TEST; while () { last if /^\s*\},?\s*\z/; ok(/^\s*"(.+)" : \{\s*\z/, "found phase $1") or last TEST; my $phase = $1; while () { last if /^\s*\},?\s*\z/; next if /^\s*"[^"]+"\s*:\s*\{\s*\},?\s*\z/; ok(/^\s*"(.+)" : \{\s*\z/, "found relationship $phase $1") or last TEST; my $rel = $1; while () { last if /^\s*\},?\s*\z/; ok(/^\s*"([^"]+)"\s*:\s*(\S+?),?\s*\z/, "found prereq $1") or last TEST; my ($prereq, $version) = ($1, $2); next if $phase ne 'runtime' or $prereq eq 'perl'; my $loaded = eval "require $prereq; $prereq->VERSION($version); 1"; if ($rel eq 'requires') { ok($loaded, "loaded $prereq $version") or printf STDERR "\n# Got: %s %s\n# Wanted: %s %s\n", $prereq, get_version($prereq), $prereq, $version; } else { ok(1, ($loaded ? 'loaded' : 'failed to load') . " $prereq $version"); } } # end while in prerequisites } # end while in relationship } # end while in phase close META; # Print version of all loaded modules: if ($ENV{AUTOMATED_TESTING}) { print STDERR "# Listing %INC\n"; my @packages = grep { s/\.pm\Z// and do { s![\\/]!::!g; 1 } } sort keys %INC; my $len = 0; for (@packages) { $len = length if length > $len } $len = 68 if $len > 68; for my $package (@packages) { printf STDERR "# %${len}s %s\n", $package, get_version($package); } } # end if AUTOMATED_TESTING } # end TEST __END__