Pod-Weaver-4.006000755000766000024 012263123013 12712 5ustar00rjbsstaff000000000000README100644000766000024 57612263123013 13643 0ustar00rjbsstaff000000000000Pod-Weaver-4.006 This archive contains the distribution Pod-Weaver, version 4.006: weave together a Pod document from an outline This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v5.009. Changes100644000766000024 1250412263123013 14310 0ustar00rjbsstaff000000000000Pod-Weaver-4.006Revision history for Pod-Weaver 4.006 2014-01-07 20:12:37-05:00 America/New_York - update tests to pass octets to ->read_string, as is proper 4.005 2013-12-21 15:01:46-0500 America/New_York - updated tests for the new (fixed, consistent) string behavior in Mixin::Linewise 4.004 2013-11-05 21:50:13 America/New_York - allow multi-line formats for VERSION plugin (thanks, Alex Peters) - ...including the %T-prefix for lines only included in trial releases - look for PODNAME more consistently (thanks, Chris Weyl) - put license filename in F<> formatting (thanks, Alex Peters) 4.003 2013-11-02 22:58:43 America/New_York - note that [@Default] contains [-SingleEncoding] (thanks, Caleb Cushing) 4.002 2013-11-02 11:37:04 America/New_York [ THIS MIGHT BREAK YOUR CODE ] - stable release of previous v4 changes 4.001 2013-10-20 10:50:50 America/New_York (TRIAL RELEASE) [ THIS MIGHT BREAK YOUR CODE ] - SingleEncoding now accepts found =encodings as long as they match, unless the plugin's encoding attribute was set explicitly 4.000 2013-10-19 17:20:59 America/New_York (TRIAL RELEASE) [ THIS MIGHT BREAK YOUR CODE ] - the SingleEncoding plugin to force one consistent =encoding - ...is now enabled, for UTF-8, in the default configuration 3.101640 2013-09-17 08:57:41 Asia/Tokyo - fix repository links! argh, oops 3.101639 2013-09-17 08:56:05 Asia/Tokyo - documentation fix: mention that =func exists in the default configuration (thanks, Joshua Keroes!) - removed use of deprecated Class::MOP::load_class (thanks, Karen Etheridge) 3.101638 2012-08-03 20:42:44 America/New_York - add more helpful information to the "no document name" error (thanks, Leto Labs, LLC!) 3.101637 2012-06-07 22:18:55 America/New_York - add header_command attribute to the Collect section (thanks, Christopher J. Madsen) 3.101636 2012-05-04 21:28:10 America/New_York - break the content-generating code in the Version section into its own method (thanks, Chris Weyl) 3.101635 2012-02-07 22:03:26 America/New_York - restore the full-document scan for ABSTRACT if not found in a comment token (thanks, David Golden) 3.101634 2011-10-31 22:56:36 America/New_York - throw a (helpful?) exception when %m is used in a version format, but no package was found in the file - the Legal plugin can now be given the filename in which the dist's full license can be found (thanks, APOCAL!) 3.101633 2011-09-19 15:48:16 America/New_York - speed up performance by changing how we use PPI (thanks, Dave Rolsky) 3.101632 2010-10-19 07:49:32 America/New_York - add missing DateTime prereq 3.101631 2010-10-14 23:00:19 America/New_York - Name section now looks for a PODNAME comment if no package is found (hanekomu) - Added a Bugs section (thanks, David Golden) - Version, Region, and Generic are all more configurable (thanks, Apocalypse) 3.101630 2010-06-12 14:42:26 America/New_York - Author section now emits a normal para or bulleted list (Florian Ragwitz) 3.101460 2010-05-26 22:36:13 America/New_York - compat with Config::MVP::Reader v2 3.101450 2010-05-25 18:38:44 America/New_York - compat with Config::MVP::Reader v1 3.101270 2010-05-07 21:36:45 America/New_York - allow an explicit header arg to Generic 3.100710 2010-03-12 10:03:42 America/New_York - further logging improvements; now uses Log::Dispatchouli explicitly 3.100680 2010-03-09 23:38:30 America/New_York - improve logging delegation to interoperate with recent DZ changes 3.100650 2010-03-06 23:21:19 America/New_York - expect a Log::Dispatchouli-like logger - added a means to tweak the configuration loaded during new - log the file in which errors occur more often 3.100310 2010-01-31 15:32:00 America/New_York - add =func/FUNCTIONS to match =method and =attr - require newer Pod::Elemental (to avoid Moose incompat) 3.093530 2009-12-19 22:52:47 America/New_York - add the -Transformer plugin to allow pass-through for arbitrary Pod::Elemental::Transformers 3.093130 2009-11-09 - add Config::MVP::Reader::INI to prereq 3.093120 2009-11-08 - fix broken prereq (Config::MVP) 3.093001 2009-10-27 - create @Default and use it to set up the new_with_default_config 3.093000 2009-10-27 - plugins for common preparation: -H1Nester, -EnsurePod5, @CorePrep "-" as prefix now denotes a non-Section plugin - tweak weaving phases and methods to add Dialect 3.092990 2009-10-26 - Pod::Weaver::Config and tests for config-from-ini 3.092972 2009-10-24 - no code changes; Pod robuilt 3.092971 2009-10-24 - fixes to make the NAME section "just work" 3.092970 2009-10-24 - total rewrite 1.003 2008-10-?? - use $doc->serialize instead of "$doc" to work with here-docs 1.002 2008-10-13 - add missing prereq (PPI) 1.001 2008-10-12 - fix prereq for testing 1.000 2008-10-12 - first release (at the Pittsburgh Perl Workshop) LICENSE100644000766000024 4366112263123013 14032 0ustar00rjbsstaff000000000000Pod-Weaver-4.006This software is copyright (c) 2014 by Ricardo SIGNES. 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) 2014 by Ricardo SIGNES. 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) 2014 by Ricardo SIGNES. 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.ini100644000766000024 40212263123013 14413 0ustar00rjbsstaff000000000000Pod-Weaver-4.006name = Pod-Weaver author = Ricardo SIGNES license = Perl_5 copyright_holder = Ricardo SIGNES [Prereqs] Config::MVP::Reader::INI = 0 ; to make testing simpler Mixin::Linewise::Readers = 0.103 ; fixed string semantics [@RJBS] version = 3 META.yml100644000766000024 2236612263123013 14275 0ustar00rjbsstaff000000000000Pod-Weaver-4.006--- abstract: 'weave together a Pod document from an outline' author: - 'Ricardo SIGNES ' build_requires: PPI: 0 Software::License::Artistic_1_0: 0 Software::License::Perl_5: 0 Test::Differences: 0 Test::More: 0.96 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.009, CPAN::Meta::Converter version 2.133380' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Pod-Weaver requires: Config::MVP: 2 Config::MVP::Assembler: 0 Config::MVP::Assembler::WithBundles: 0 Config::MVP::Reader::Finder: 0 Config::MVP::Reader::INI: 0 DateTime: 0 File::Spec: 0 List::MoreUtils: 0 Log::Dispatchouli: 1.100710 Mixin::Linewise::Readers: 0.103 Module::Runtime: 0 Moose: 0 Moose::Autobox: 0.10 Moose::Role: 0 Moose::Util::TypeConstraints: 0 Params::Util: 0 Pod::Elemental: 0.100220 Pod::Elemental::Document: 0 Pod::Elemental::Element::Nested: 0 Pod::Elemental::Element::Pod5::Command: 0 Pod::Elemental::Element::Pod5::Ordinary: 0 Pod::Elemental::Element::Pod5::Region: 0 Pod::Elemental::Element::Pod5::Verbatim: 0 Pod::Elemental::Selectors: 0 Pod::Elemental::Transformer::Gatherer: 0 Pod::Elemental::Transformer::Nester: 0 Pod::Elemental::Transformer::Pod5: 0 Pod::Elemental::Types: 0 String::Flogger: 1 String::Formatter: 0.100680 String::RewritePrefix: 0 Text::Wrap: 0 namespace::autoclean: 0 strict: 0 warnings: 0 resources: bugtracker: https://github.com/rjbs/Pod-Weaver/issues homepage: https://github.com/rjbs/Pod-Weaver repository: https://github.com/rjbs/Pod-Weaver.git version: 4.006 x_Dist_Zilla: perl: version: 5.018002 plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: 5.009 - class: Dist::Zilla::Plugin::Git::GatherDir name: '@RJBS/Git::GatherDir' version: 2.019 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: 0.010 - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: 0.016 - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build skip: [] name: '@RJBS/RJBS-Outdated' version: 0.015 - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release skip: [] name: '@RJBS/CPAN-Outdated' version: 0.015 - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: 5.009 - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: 5.009 - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: 5.009 - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: 5.009 - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: 5.009 - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: 5.009 - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: 5.009 - class: Dist::Zilla::Plugin::MakeMaker name: '@RJBS/@Filter/MakeMaker' version: 5.009 - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: 5.009 - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: 5.009 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: 5.009 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: 5.009 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: 5.009 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RJBS/Git::NextVersion' version: 2.019 - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: 5.009 - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: 5.009 - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: 5.009 - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: 5.009 - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: 5.009 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@RJBS/ReportVersions::Tiny' version: 1.10 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: 5.009 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: 4.005 - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: 4.005 - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: 4.005 - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: 4.005 - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: 4.005 - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: 4.005 - class: Pod::Weaver::Section::Collect name: Attributes version: 4.005 - class: Pod::Weaver::Section::Collect name: Methods version: 4.005 - class: Pod::Weaver::Section::Collect name: Functions version: 4.005 - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: 4.005 - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: 4.005 - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: 4.005 - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: 4.005 - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: 4.005 name: '@RJBS/PodWeaver' version: 4.005 - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: 0.42 - class: Dist::Zilla::Plugin::Git::Check name: '@RJBS/@Git/Check' version: 2.019 - class: Dist::Zilla::Plugin::Git::Commit name: '@RJBS/@Git/Commit' version: 2.019 - class: Dist::Zilla::Plugin::Git::Tag name: '@RJBS/@Git/Tag' version: 2.019 - class: Dist::Zilla::Plugin::Git::Push name: '@RJBS/@Git/Push' version: 2.019 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: 5.009 - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: 5.009 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 5.009 MANIFEST100644000766000024 374212263123013 14132 0ustar00rjbsstaff000000000000Pod-Weaver-4.006# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.009. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Pod/Weaver.pm lib/Pod/Weaver/Config.pm lib/Pod/Weaver/Config/Assembler.pm lib/Pod/Weaver/Config/Finder.pm lib/Pod/Weaver/Plugin/EnsurePod5.pm lib/Pod/Weaver/Plugin/H1Nester.pm lib/Pod/Weaver/Plugin/SingleEncoding.pm lib/Pod/Weaver/Plugin/Transformer.pm lib/Pod/Weaver/PluginBundle/CorePrep.pm lib/Pod/Weaver/PluginBundle/Default.pm lib/Pod/Weaver/Role/Dialect.pm lib/Pod/Weaver/Role/Finalizer.pm lib/Pod/Weaver/Role/Plugin.pm lib/Pod/Weaver/Role/Preparer.pm lib/Pod/Weaver/Role/Section.pm lib/Pod/Weaver/Role/StringFromComment.pm lib/Pod/Weaver/Role/Transformer.pm lib/Pod/Weaver/Section/Authors.pm lib/Pod/Weaver/Section/Bugs.pm lib/Pod/Weaver/Section/Collect.pm lib/Pod/Weaver/Section/Generic.pm lib/Pod/Weaver/Section/Leftovers.pm lib/Pod/Weaver/Section/Legal.pm lib/Pod/Weaver/Section/Name.pm lib/Pod/Weaver/Section/Region.pm lib/Pod/Weaver/Section/Version.pm t/000-report-versions-tiny.t t/basic.t t/eg/basic.in.pod t/eg/basic.out.pod t/eg/encoding.in.pod t/eg/encoding.out.pod t/eg/legal_t1.in.pod t/eg/legal_t1.out.pod t/eg/legal_t2.in.pod t/eg/legal_t2.out.pod t/eg/region_t1.in.pod t/eg/region_t1.out.pod t/eg/region_t2.in.pod t/eg/region_t2.out.pod t/eg/region_t3.in.pod t/eg/region_t3.out.pod t/eg/region_t4.in.pod t/eg/region_t4.out.pod t/eg/version_t1.in.pod t/eg/version_t1.out.pod t/eg/version_t2.in.pod t/eg/version_t2.out.pod t/eg/version_t3.in.pod t/eg/version_t3.out.pod t/eg/version_t4.in.pod t/eg/version_t4.out.pod t/eg/version_t5.in.pod t/eg/version_t5.out.pod t/eg/version_t6-trial.out.pod t/eg/version_t6.in.pod t/eg/version_t6.out.pod t/eg/version_without_package.in.pod t/eg/version_without_package.out.pod t/eg/weaver.ini t/encoding.t t/ini-config.t t/legal_section.t t/region_options.t t/required_region.t t/required_section.t t/version_options.t t/version_without_package.t xt/release/changes_has_content.t xt/release/pod-syntax.t t000755000766000024 012263123013 13076 5ustar00rjbsstaff000000000000Pod-Weaver-4.006basic.t100644000766000024 541512263123013 14511 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; use Pod::Weaver; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', 't/eg/basic.in.pod'; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', 't/eg/basic.out.pod'; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); # wants octets my $perl_document = do { local $/; }; my $ppi_document = PPI::Document->new(\$perl_document); my $weaver = Pod::Weaver->new_with_default_config; require Software::License::Artistic_1_0; my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', authors => [ 'Ricardo Signes ', 'Molly Millions ', ], license => Software::License::Artistic_1_0->new({ holder => 'Ricardo Signes', year => 1999, }), }); # Document # 0 =encoding UTF-8 # 1 =head1 NAME # 0 Pod5::Ordinary # 2 =head1 VERSION # 0 Pod5::Ordinary # 3 Pod5::Ordinary # 4 =head1 SYNOPSIS # 0 Pod5::Ordinary # 5 =head1 DESCRIPTION # 0 Pod5::Ordinary # 1 Pod5::Ordinary # 6 =head1 ATTRIBUTES # 0 =head2 is_awesome # 0 Pod5::Ordinary <(This is true by default.)> # 7 =head1 BE FOREWARNED # 0 Pod5::Ordinary # 1 Pod5::Verbatim < much at all> # 2 Pod5::Ordinary # 8 Pod5::Ordinary # 9 =head1 AUTHORS # 0 =over 4 # 1 =item * # 2 Pod5::Ordinary # 3 =item * # 4 Pod5::Ordinary # 5 =back # 10 =head1 COPYRIGHT AND LICENSE # 0 Pod5::Ordinary is($woven->children->length, 11, "we end up with a 11-paragraph document"); for (qw(1 2 4 5 6 7 9 10)) { my $para = $woven->children->[ $_ ]; isa_ok($para, 'Pod::Elemental::Element::Nested', "element $_"); is($para->command, 'head1', "... and is =head1"); } is( $woven->children->[2]->children->[0]->content, 'version 1.012078', "the version is in the version section", ); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving!", ); done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; META.json100644000766000024 3517412263123013 14446 0ustar00rjbsstaff000000000000Pod-Weaver-4.006{ "abstract" : "weave together a Pod document from an outline", "author" : [ "Ricardo SIGNES " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.009, CPAN::Meta::Converter version 2.133380", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Pod-Weaver", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Test::Pod" : "1.41", "version" : "0.9901" } }, "runtime" : { "requires" : { "Config::MVP" : "2", "Config::MVP::Assembler" : "0", "Config::MVP::Assembler::WithBundles" : "0", "Config::MVP::Reader::Finder" : "0", "Config::MVP::Reader::INI" : "0", "DateTime" : "0", "File::Spec" : "0", "List::MoreUtils" : "0", "Log::Dispatchouli" : "1.100710", "Mixin::Linewise::Readers" : "0.103", "Module::Runtime" : "0", "Moose" : "0", "Moose::Autobox" : "0.10", "Moose::Role" : "0", "Moose::Util::TypeConstraints" : "0", "Params::Util" : "0", "Pod::Elemental" : "0.100220", "Pod::Elemental::Document" : "0", "Pod::Elemental::Element::Nested" : "0", "Pod::Elemental::Element::Pod5::Command" : "0", "Pod::Elemental::Element::Pod5::Ordinary" : "0", "Pod::Elemental::Element::Pod5::Region" : "0", "Pod::Elemental::Element::Pod5::Verbatim" : "0", "Pod::Elemental::Selectors" : "0", "Pod::Elemental::Transformer::Gatherer" : "0", "Pod::Elemental::Transformer::Nester" : "0", "Pod::Elemental::Transformer::Pod5" : "0", "Pod::Elemental::Types" : "0", "String::Flogger" : "1", "String::Formatter" : "0.100680", "String::RewritePrefix" : "0", "Text::Wrap" : "0", "namespace::autoclean" : "0", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "PPI" : "0", "Software::License::Artistic_1_0" : "0", "Software::License::Perl_5" : "0", "Test::Differences" : "0", "Test::More" : "0.96" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Pod-Weaver/issues" }, "homepage" : "https://github.com/rjbs/Pod-Weaver", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Pod-Weaver.git", "web" : "https://github.com/rjbs/Pod-Weaver" } }, "version" : "4.006", "x_Dist_Zilla" : { "perl" : { "version" : "5.018002" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "name" : "@RJBS/Git::GatherDir", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : "1", "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "skip" : [] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RJBS/@Filter/MakeMaker", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RJBS/Git::NextVersion", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@RJBS/ReportVersions::Tiny", "version" : "1.10" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.005" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.005" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.42" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RJBS/@Git/Check", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RJBS/@Git/Commit", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RJBS/@Git/Tag", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RJBS/@Git/Push", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.009" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.009" } } } Makefile.PL100644000766000024 714712263123013 14756 0ustar00rjbsstaff000000000000Pod-Weaver-4.006 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.009. use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "weave together a Pod document from an outline", "AUTHOR" => "Ricardo SIGNES ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Pod-Weaver", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Pod::Weaver", "PREREQ_PM" => { "Config::MVP" => 2, "Config::MVP::Assembler" => 0, "Config::MVP::Assembler::WithBundles" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => 0, "DateTime" => 0, "File::Spec" => 0, "List::MoreUtils" => 0, "Log::Dispatchouli" => "1.100710", "Mixin::Linewise::Readers" => "0.103", "Module::Runtime" => 0, "Moose" => 0, "Moose::Autobox" => "0.10", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "Params::Util" => 0, "Pod::Elemental" => "0.100220", "Pod::Elemental::Document" => 0, "Pod::Elemental::Element::Nested" => 0, "Pod::Elemental::Element::Pod5::Command" => 0, "Pod::Elemental::Element::Pod5::Ordinary" => 0, "Pod::Elemental::Element::Pod5::Region" => 0, "Pod::Elemental::Element::Pod5::Verbatim" => 0, "Pod::Elemental::Selectors" => 0, "Pod::Elemental::Transformer::Gatherer" => 0, "Pod::Elemental::Transformer::Nester" => 0, "Pod::Elemental::Transformer::Pod5" => 0, "Pod::Elemental::Types" => 0, "String::Flogger" => 1, "String::Formatter" => "0.100680", "String::RewritePrefix" => 0, "Text::Wrap" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "PPI" => 0, "Software::License::Artistic_1_0" => 0, "Software::License::Perl_5" => 0, "Test::Differences" => 0, "Test::More" => "0.96" }, "VERSION" => "4.006", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Config::MVP" => 2, "Config::MVP::Assembler" => 0, "Config::MVP::Assembler::WithBundles" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => 0, "DateTime" => 0, "File::Spec" => 0, "List::MoreUtils" => 0, "Log::Dispatchouli" => "1.100710", "Mixin::Linewise::Readers" => "0.103", "Module::Runtime" => 0, "Moose" => 0, "Moose::Autobox" => "0.10", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "PPI" => 0, "Params::Util" => 0, "Pod::Elemental" => "0.100220", "Pod::Elemental::Document" => 0, "Pod::Elemental::Element::Nested" => 0, "Pod::Elemental::Element::Pod5::Command" => 0, "Pod::Elemental::Element::Pod5::Ordinary" => 0, "Pod::Elemental::Element::Pod5::Region" => 0, "Pod::Elemental::Element::Pod5::Verbatim" => 0, "Pod::Elemental::Selectors" => 0, "Pod::Elemental::Transformer::Gatherer" => 0, "Pod::Elemental::Transformer::Nester" => 0, "Pod::Elemental::Transformer::Pod5" => 0, "Pod::Elemental::Types" => 0, "Software::License::Artistic_1_0" => 0, "Software::License::Perl_5" => 0, "String::Flogger" => 1, "String::Formatter" => "0.100680", "String::RewritePrefix" => 0, "Test::Differences" => 0, "Test::More" => "0.96", "Text::Wrap" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); encoding.t100644000766000024 326712263123013 15221 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; use Pod::Weaver; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', 't/eg/encoding.in.pod'; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', 't/eg/encoding.out.pod'; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); my $perl_document = do { local $/; }; my $ppi_document = PPI::Document->new(\$perl_document); my $weaver = Pod::Weaver->new_with_default_config; require Software::License::Artistic_1_0; my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', authors => [ 'Ricardo Signes ', 'Molly Millions ', ], license => Software::License::Artistic_1_0->new({ holder => 'Ricardo Signes', year => 1999, }), }); is($woven->children->length, 11, "we end up with a 11-paragraph document"); for (qw(1 2 4 5 6 7 9 10)) { my $para = $woven->children->[ $_ ]; isa_ok($para, 'Pod::Elemental::Element::Nested', "element $_"); is($para->command, 'head1', "... and is =head1"); } is( $woven->children->[2]->children->[0]->content, 'version 1.012078', "the version is in the version section", ); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving!", ); done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; ini-config.t100644000766000024 524112263123013 15447 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; use Pod::Weaver; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', 't/eg/basic.in.pod'; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', 't/eg/basic.out.pod'; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); my $perl_document = do { local $/; }; my $ppi_document = PPI::Document->new(\$perl_document); my $weaver = Pod::Weaver->new_from_config({ root => 't/eg' }); require Software::License::Artistic_1_0; my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', authors => [ 'Ricardo Signes ', 'Molly Millions ', ], license => Software::License::Artistic_1_0->new({ holder => 'Ricardo Signes', year => 1999, }), }); # Document # 0 =encoding UTF-8 # 1 =head1 NAME # 0 Pod5::Ordinary # 2 =head1 VERSION # 0 Pod5::Ordinary # 3 Pod5::Ordinary # 4 =head1 SYNOPSIS # 0 Pod5::Ordinary # 5 =head1 DESCRIPTION # 0 Pod5::Ordinary # 1 Pod5::Ordinary # 6 =head1 ATTRIBUTES # 0 =head2 is_awesome # 0 Pod5::Ordinary <(This is true by default.)> # 7 =head1 BE FOREWARNED # 0 Pod5::Ordinary # 1 Pod5::Verbatim < much at all> # 2 Pod5::Ordinary # 8 Pod5::Ordinary # 9 =head1 AUTHORS # 0 Pod5::Verbatim < Ricardo Signe…rs@orbit.tash>> # 10 =head1 COPYRIGHT AND LICENSE # 0 Pod5::Ordinary is($woven->children->length, 11, "we end up with a 11-paragraph document"); for (qw(1 2 4 5 6 7 9 10)) { my $para = $woven->children->[ $_ ]; isa_ok($para, 'Pod::Elemental::Element::Nested', "element $_"); is($para->command, 'head1', "... and is =head1"); } is( $woven->children->[2]->children->[0]->content, 'version 1.012078', "the version is in the version section", ); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving!", ); done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; eg000755000766000024 012263123013 13471 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/tweaver.ini100644000766000024 41512263123013 15603 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg [@CorePrep] [-SingleEncoding] [Name] [Version] [Region / prelude] [Generic / SYNOPSIS] [Generic / DESCRIPTION] [Generic / OVERVIEW] [Collect / ATTRIBUTES] command = attr [Collect / METHODS] command = method [Leftovers] [Region / postlude] [Authors] [Legal] Pod000755000766000024 012263123013 14123 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/libWeaver.pm100644000766000024 1367512263123013 16106 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Podpackage Pod::Weaver; { $Pod::Weaver::VERSION = '4.006'; } use Moose; # ABSTRACT: weave together a Pod document from an outline use namespace::autoclean; use File::Spec; use Log::Dispatchouli 1.100710; # proxy use Moose::Autobox 0.10; use Pod::Elemental 0.100220; use Pod::Elemental::Document; use Pod::Weaver::Config::Finder; use Pod::Weaver::Role::Plugin; use String::Flogger 1; has logger => ( is => 'ro', lazy => 1, default => sub { Log::Dispatchouli->new({ ident => 'Pod::Weaver', to_stdout => 1, log_pid => 0, }); }, handles => [ qw(log log_fatal log_debug) ] ); has plugins => ( is => 'ro', isa => 'ArrayRef[Pod::Weaver::Role::Plugin]', required => 1, lazy => 1, init_arg => undef, default => sub { [] }, ); sub plugins_with { my ($self, $role) = @_; $role =~ s/^-/Pod::Weaver::Role::/; my $plugins = $self->plugins->grep(sub { $_->does($role) }); return $plugins; } sub weave_document { my ($self, $input) = @_; my $document = Pod::Elemental::Document->new; $self->plugins_with(-Preparer)->each_value(sub { $_->prepare_input($input); }); $self->plugins_with(-Dialect)->each_value(sub { $_->translate_dialect($input->{pod_document}); }); $self->plugins_with(-Transformer)->each_value(sub { $_->transform_document($input->{pod_document}); }); $self->plugins_with(-Section)->each_value(sub { $_->weave_section($document, $input); }); $self->plugins_with(-Finalizer)->each_value(sub { $_->finalize_document($document, $input); }); return $document; } sub new_with_default_config { my ($class, $arg) = @_; my $assembler = Pod::Weaver::Config::Assembler->new; my $root = $assembler->section_class->new({ name => '_' }); $assembler->sequence->add_section($root); $assembler->change_section('@Default'); $assembler->end_section; return $class->new_from_config_sequence($assembler->sequence, $arg); } sub new_from_config { my ($class, $arg, $new_arg) = @_; my $root = $arg->{root} || '.'; my $name = File::Spec->catfile($root, 'weaver'); my ($sequence) = Pod::Weaver::Config::Finder->new->read_config($name); return $class->new_from_config_sequence($sequence, $new_arg); } sub new_from_config_sequence { my ($class, $seq, $arg) = @_; $arg ||= {}; my $merge = $arg->{root_config} || {}; confess("config must be a Config::MVP::Sequence") unless $seq and $seq->isa('Config::MVP::Sequence'); my $core_config = $seq->section_named('_')->payload; my $self = $class->new({ %$merge, %$core_config, }); for my $section ($seq->sections) { next if $section->name eq '_'; my ($name, $plugin_class, $arg) = ( $section->name, $section->package, $section->payload, ); # $self->log("initializing plugin $name ($plugin_class)"); confess "arguments attempted to override 'plugin_name'" if defined $arg->{plugin_name}; confess "arguments attempted to override 'weaver'" if defined $arg->{weaver}; $self->plugins->push( $plugin_class->new({ %$arg, plugin_name => $name, weaver => $self, }) ); } return $self; } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver - weave together a Pod document from an outline =head1 VERSION version 4.006 =head1 SYNOPSIS my $weaver = Pod::Weaver->new_with_default_config; my $document = $weaver->weave_document({ pod_document => $pod_elemental_document, ppi_document => $ppi_document, license => $software_license, version => $version_string, authors => \@author_names, }) =head1 DESCRIPTION Pod::Weaver is a system for building Pod documents from templates. It doesn't perform simple text substitution, but instead builds a Pod::Elemental::Document. Its plugins sketch out a series of sections that will be produced based on an existing Pod document or other provided information. =head1 ATTRIBUTES =head2 logger This attribute stores the logger, which must provide a log method. The weaver's log method delegates to the logger's log method. =head2 plugins This attribute is an arrayref of objects that can perform the L role. In general, its contents are found through the C> method. =head1 METHODS =head2 plugins_with my $plugins_array_ref = $weaver->plugins_with('-Section'); This method will return an arrayref of plugins that perform the given role, in the order of their registration. If the role name begins with a hyphen, the method will prepend C. =head2 weave_document my $document = $weaver->weave_document(\%input); This is the most important method in Pod::Weaver. Given a set of input parameters, it will weave a new document. Different section plugins will expect different input parameters to be present, but some common ones include: pod_document - a Pod::Elemental::Document for the original Pod document ppi_document - a PPI document for the source of the module being documented license - a Software::License object for the source module's license version - a version (string) to use in produced documentation The C should have gone through a L, and should probably have had its C<=head1> elements L. The method will return a new Pod::Elemental::Document. The input documents may be destructively altered during the weaving process. If they should be untouched, pass in copies. =head2 new_with_default_config This method returns a new Pod::Weaver with a stock configuration by using only L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut basic.in.pod100644000766000024 63712263123013 16011 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =for :prelude Please pay close attention to the following. =for :postlude Thank you for your attention. =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =attr is_awesome (This is true by default.) =cut legal_section.t100644000766000024 352512263123013 16240 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; use Software::License::Perl_5; # Test various combinations of options for Section::Legal do_weave( configer( ), 'legal_t1' ); do_weave( configer( license_file => 'LICENSE' ), 'legal_t2' ); sub configer { my %opts = @_; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@CorePrep'); $assembler->change_section('Name'); $assembler->change_section('Leftovers'); $assembler->change_section('Legal'); foreach my $k ( keys %opts ) { $assembler->add_value( $k => $opts{ $k } ); } return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub do_weave { my( $weaver, $filename ) = @_; my $in_pod = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$filename.in.pod"; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$filename.out.pod"; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, license => Software::License::Perl_5->new({ holder => 'RJBS', year => '2010', }), }); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving for $filename!", ); } done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; basic.out.pod100644000766000024 140712263123013 16226 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =encoding UTF-8 =head1 NAME Module::Name - abstract text =head1 VERSION version 1.012078 Please pay close attention to the following. =head1 SYNOPSIS This should probably get moved up front. =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 ATTRIBUTES =head2 is_awesome (This is true by default.) =head1 BE FOREWARNED This is not supported: much at all Happy hacking! Thank you for your attention. =head1 AUTHORS =over 4 =item * Ricardo Signes =item * Molly Millions =back =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 1999 by Ricardo Signes. This is free software, licensed under: The Artistic License 1.0 =cut region_options.t100644000766000024 474012263123013 16466 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; # Test various combinations of options for Section::Region do_weave( configer( allow_nonpod => 1 ), 'region_t1' ); do_weave( configer( allow_nonpod => 0 ), 'region_t1' ); do_weave( configer( allow_nonpod => 1 ), 'region_t2' ); do_weave( configer( allow_nonpod => 0 ), 'region_t2' ); do_weave( configer( flatten => 0 ), 'region_t3' ); do_weave( configer( flatten => 1 ), 'region_t4' ); do_weave( configer( allow_nonpod => 1, flatten => 0 ), 'region_t3' ); do_weave( configer( allow_nonpod => 0, flatten => 0 ), 'region_t3' ); do_weave( configer( allow_nonpod => 1, flatten => 1 ), 'region_t4' ); do_weave( configer( allow_nonpod => 0, flatten => 1 ), 'region_t4' ); sub configer { my %opts = @_; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@CorePrep'); $assembler->change_section('Name'); $assembler->change_section('Region', 'FOOBAZ'); foreach my $k ( keys %opts ) { $assembler->add_value( $k => $opts{ $k } ); } $assembler->change_section('Leftovers'); return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub do_weave { my( $weaver, $filename ) = @_; my $in_pod = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$filename.in.pod"; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$filename.out.pod"; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, }); is($woven->children->length, 5, "we end up with a 5-paragraph document"); for (qw(0 2 3 4)) { my $para = $woven->children->[ $_ ]; isa_ok($para, 'Pod::Elemental::Element::Nested', "element $_"); is($para->command, 'head1', "... and is =head1"); } # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving for $filename!", ); } done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; required_region.t100644000766000024 316312263123013 16611 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; is( woven( configer( 0 ) ), 0, "Doesn't throw exception for nonrequired region" ); is( woven( configer( 1 ) ), 1, "Properly throws exception for required region" ); sub configer { my $required = shift; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@Default'); $assembler->change_section('Region', 'FOOBAZ'); $assembler->add_value( 'required' => $required ); return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub woven { my $weaver = shift; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', 't/eg/basic.in.pod'; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); require Software::License::Artistic_1_0; eval { my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', authors => [ 'Ricardo Signes ', 'Molly Millions ', ], license => Software::License::Artistic_1_0->new({ holder => 'Ricardo Signes', year => 1999, }), }); }; return $@ ? 1 : 0; } done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; version_options.t100644000766000024 532212263123013 16665 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; # Test various combinations of options for Section::Version do_weave( configer( ), 'version_t1' ); do_weave( configer( is_verbatim => 1 ), 'version_t2' ); do_weave( configer( format => "%v FOOBAZ" ), 'version_t3' ); do_weave( configer( format => "%t%v%t-%t%m", is_verbatim => 1 ), 'version_t4' ); # In order to test DateTime, we have to avoid touching the time! Hence UTC and # the weird CLDR here... do_weave( configer( format => "%v - %{ZZZZ G}d", time_zone => 'UTC' ), 'version_t5', ); do_weave( configer( format => ["%v", "FOOBAZ", "", "EXPLANATION"] ), 'version_t6', ); do_weave( configer(format => [ "%v", "FOOBAZ", "", "EXPLANATION", "%T", "%T This is a trial release.", ]), 'version_t6', 'version_t6', ); do_weave( configer(format => [ "%v", "FOOBAZ", "", "EXPLANATION", "%T", "%T This is a trial release.", ]), 'version_t6', 'version_t6-trial', { is_trial => 1 }, ); sub configer { my %opts = @_; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@CorePrep'); $assembler->change_section('Name'); $assembler->change_section('Version'); foreach my $k ( keys %opts ) { if (ref $opts{ $k }) { $assembler->add_value( $k => $_ ) for @{ $opts{ $k } }; } else { $assembler->add_value( $k => $opts{ $k } ); } } $assembler->change_section('Leftovers'); return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub do_weave { my( $weaver, $filename, $expect_fn, $extra ) = @_; $expect_fn ||= $filename; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', "t/eg/$filename.in.pod"; <$fh>; }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$expect_fn.out.pod"; <$fh>; }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', %{ $extra || {} }, }); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving for $filename!", ); } done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; encoding.in.pod100644000766000024 67612263123013 16521 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =for :prelude Please pay close attention to the following. =for :postlude Thank you for your attention. =head1 DESCRIPTION =encoding utf8 This is a simple document meant to be used in testing Pod::Weaver. Glory to Queensrÿche! =head1 BE FOREWARNED This is not supported: much at all Happy haĉking! =encoding UTF-8 =head1 SYNOPSIS This should probably get moved up front. =attr is_awesome (This is true by default.) =cut legal_t1.in.pod100644000766000024 40612263123013 16412 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut legal_t2.in.pod100644000766000024 40612263123013 16413 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut required_section.t100644000766000024 316612263123013 16775 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; is( woven( configer( 0 ) ), 0, "Doesn't throw exception for nonrequired section" ); is( woven( configer( 1 ) ), 1, "Properly throws exception for required section" ); sub configer { my $required = shift; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@Default'); $assembler->change_section('Generic', 'FOOBAZ'); $assembler->add_value( 'required' => $required ); return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub woven { my $weaver = shift; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', 't/eg/basic.in.pod'; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); require Software::License::Artistic_1_0; eval { my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', authors => [ 'Ricardo Signes ', 'Molly Millions ', ], license => Software::License::Artistic_1_0->new({ holder => 'Ricardo Signes', year => 1999, }), }); }; return $@ ? 1 : 0; } done_testing; __DATA__ package Module::Name; # ABSTRACT: abstract text my $this = 'a test'; encoding.out.pod100644000766000024 140512263123013 16731 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =encoding UTF-8 =head1 NAME Module::Name - abstract text =head1 VERSION version 1.012078 Please pay close attention to the following. =head1 SYNOPSIS This should probably get moved up front. =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. Glory to Queensrÿche! =head1 ATTRIBUTES =head2 is_awesome (This is true by default.) =head1 BE FOREWARNED This is not supported: much at all Happy haĉking! Thank you for your attention. =head1 AUTHORS =over 4 =item * Ricardo Signes =item * Molly Millions =back =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 1999 by Ricardo Signes. This is free software, licensed under: The Artistic License 1.0 =cut legal_t1.out.pod100644000766000024 100512263123013 16627 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2010 by RJBS. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut legal_t2.out.pod100644000766000024 115012263123013 16631 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2010 by RJBS. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. The full text of the license can be found in the F file included with this distribution. =cut region_t1.in.pod100644000766000024 47612263123013 16620 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =begin :FOOBAZ Wow, this is the FOOBAZ! =end :FOOBAZ =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t2.in.pod100644000766000024 45512263123013 16616 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =for :FOOBAZ Wow, this is the FOOBAZ! =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t3.in.pod100644000766000024 47612263123013 16622 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =begin :FOOBAZ Wow, this is the FOOBAZ! =end :FOOBAZ =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t4.in.pod100644000766000024 47612263123013 16623 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =begin :FOOBAZ Wow, this is the FOOBAZ! =end :FOOBAZ =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t1.out.pod100644000766000024 51312263123013 17011 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text Wow, this is the FOOBAZ! =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t2.out.pod100644000766000024 51312263123013 17012 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text Wow, this is the FOOBAZ! =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t3.out.pod100644000766000024 53012263123013 17012 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =for :FOOBAZ Wow, this is the FOOBAZ! =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut region_t4.out.pod100644000766000024 51312263123013 17014 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text Wow, this is the FOOBAZ! =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t1.in.pod100644000766000024 40612263123013 17013 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t2.in.pod100644000766000024 40612263123013 17014 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t3.in.pod100644000766000024 40612263123013 17015 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t4.in.pod100644000766000024 40612263123013 17016 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t5.in.pod100644000766000024 40612263123013 17017 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t6.in.pod100644000766000024 40612263123013 17020 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t1.out.pod100644000766000024 52312263123013 17214 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION version 1.012078 =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t2.out.pod100644000766000024 52512263123013 17217 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION version 1.012078 =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t3.out.pod100644000766000024 52212263123013 17215 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION 1.012078 FOOBAZ =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t4.out.pod100644000766000024 53512263123013 17222 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION 1.012078 - Module::Name =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t5.out.pod100644000766000024 53112263123013 17217 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION 1.012078 - UTC+0000 AD =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut version_t6.out.pod100644000766000024 53712263123013 17226 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION 1.012078 FOOBAZ EXPLANATION =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut release000755000766000024 012263123013 14706 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/xtpod-syntax.t100644000766000024 33212263123013 17317 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/xt/release#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. 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(); Weaver000755000766000024 012263123013 15354 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/PodConfig.pm100644000766000024 237612263123013 17267 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaverpackage Pod::Weaver::Config; { $Pod::Weaver::Config::VERSION = '4.006'; } use Moose::Role; # ABSTRACT: stored configuration loader role use Config::MVP 2; use Pod::Weaver::Config::Assembler; sub build_assembler { my $assembler = Pod::Weaver::Config::Assembler->new; my $root = $assembler->section_class->new({ name => '_', }); $assembler->sequence->add_section($root); return $assembler; } no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Config - stored configuration loader role =head1 VERSION version 4.006 =head1 DESCRIPTION The config role provides some helpers for writing a configuration loader using the L system to load and validate its configuration. =head1 ATTRIBUTES =head2 assembler The L attribute must be a Config::MVP::Assembler, has a sensible default that will handle the standard needs of a config loader. Namely, it will be pre-loaded with a starting section for root configuration. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut version_without_package.t100644000766000024 343012263123013 20346 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t# Mostly lifted from version_options.t but with different data section. use strict; use warnings; use Test::More; use Test::Differences; use Moose::Autobox 0.10; use PPI; use Pod::Elemental; use Pod::Weaver; do_weave( configer( ), 'version_without_package' ); do_weave( configer( format => "%t%v%t-%t%m", is_verbatim => 1 ), 'version_t4'); sub configer { my %opts = @_; # TODO Hmpf, is there an easier way for this? --APOCAL my $assembler = Pod::Weaver::Config::Assembler->new; $assembler->sequence->add_section( $assembler->section_class->new({ name => '_' }) ); $assembler->change_section('@CorePrep'); $assembler->change_section('Name'); $assembler->change_section('Version'); foreach my $k ( keys %opts ) { $assembler->add_value( $k => $opts{ $k } ); } $assembler->change_section('Leftovers'); return Pod::Weaver->new_from_config_sequence( $assembler->sequence ); } my $perl_document; sub do_weave { my( $weaver, $filename ) = @_; my $in_pod = do { local $/; open my $fh, '<:raw:bytes', "t/eg/$filename.in.pod"; <$fh> }; my $expected = do { local $/; open my $fh, '<:encoding(UTF-8)', "t/eg/$filename.out.pod"; <$fh> }; my $document = Pod::Elemental->read_string($in_pod); $perl_document = do { local $/; } if ! defined $perl_document; my $ppi_document = PPI::Document->new(\$perl_document); my $woven = $weaver->weave_document({ pod_document => $document, ppi_document => $ppi_document, version => '1.012078', }); # XXX: This test is extremely risky as things change upstream. # -- rjbs, 2009-10-23 eq_or_diff( $woven->as_pod_string, $expected, "exactly the pod string we wanted after weaving for $filename!", ); } done_testing; __DATA__ # ABSTRACT: abstract text # PODNAME: Module::Name my $this = 'a test'; 000-report-versions-tiny.t100644000766000024 1033412263123013 20103 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/tuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = "any version"; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Config::MVP','2') }; eval { $v .= pmver('Config::MVP::Assembler','any version') }; eval { $v .= pmver('Config::MVP::Assembler::WithBundles','any version') }; eval { $v .= pmver('Config::MVP::Reader::Finder','any version') }; eval { $v .= pmver('Config::MVP::Reader::INI','any version') }; eval { $v .= pmver('DateTime','any version') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('List::MoreUtils','any version') }; eval { $v .= pmver('Log::Dispatchouli','1.100710') }; eval { $v .= pmver('Mixin::Linewise::Readers','0.103') }; eval { $v .= pmver('Module::Runtime','any version') }; eval { $v .= pmver('Moose','any version') }; eval { $v .= pmver('Moose::Autobox','0.10') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('Moose::Util::TypeConstraints','any version') }; eval { $v .= pmver('PPI','any version') }; eval { $v .= pmver('Params::Util','any version') }; eval { $v .= pmver('Pod::Elemental','0.100220') }; eval { $v .= pmver('Pod::Elemental::Document','any version') }; eval { $v .= pmver('Pod::Elemental::Element::Nested','any version') }; eval { $v .= pmver('Pod::Elemental::Element::Pod5::Command','any version') }; eval { $v .= pmver('Pod::Elemental::Element::Pod5::Ordinary','any version') }; eval { $v .= pmver('Pod::Elemental::Element::Pod5::Region','any version') }; eval { $v .= pmver('Pod::Elemental::Element::Pod5::Verbatim','any version') }; eval { $v .= pmver('Pod::Elemental::Selectors','any version') }; eval { $v .= pmver('Pod::Elemental::Transformer::Gatherer','any version') }; eval { $v .= pmver('Pod::Elemental::Transformer::Nester','any version') }; eval { $v .= pmver('Pod::Elemental::Transformer::Pod5','any version') }; eval { $v .= pmver('Pod::Elemental::Types','any version') }; eval { $v .= pmver('Software::License::Artistic_1_0','any version') }; eval { $v .= pmver('Software::License::Perl_5','any version') }; eval { $v .= pmver('String::Flogger','1') }; eval { $v .= pmver('String::Formatter','0.100680') }; eval { $v .= pmver('String::RewritePrefix','any version') }; eval { $v .= pmver('Test::Differences','any version') }; eval { $v .= pmver('Test::More','0.96') }; eval { $v .= pmver('Text::Wrap','any version') }; eval { $v .= pmver('namespace::autoclean','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; Role000755000766000024 012263123013 16255 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/WeaverPlugin.pm100644000766000024 257112263123013 20216 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Plugin; { $Pod::Weaver::Role::Plugin::VERSION = '4.006'; } use Moose::Role; # ABSTRACT: a Pod::Weaver plugin use Params::Util qw(_HASHLIKE); use namespace::autoclean; has plugin_name => ( is => 'ro', isa => 'Str', required => 1, ); has weaver => ( is => 'ro', isa => 'Pod::Weaver', required => 1, weak_ref => 1, ); has logger => ( is => 'ro', lazy => 1, handles => [ qw(log log_debug log_fatal) ], default => sub { $_[0]->weaver->logger->proxy({ proxy_prefix => '[' . $_[0]->plugin_name . '] ', }); }, ); 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Plugin - a Pod::Weaver plugin =head1 VERSION version 4.006 =head1 ATTRIBUTES =head2 plugin_name This name must be unique among all other plugins loaded into a weaver. In general, this will be set up by the configuration reader. =head2 weaver This is the Pod::Weaver object into which the plugin was loaded. In general, this will be set up when the weaver is instantiated from config. =head1 IMPLEMENTING This is the most basic role that all plugins must perform. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut version_t6-trial.out.pod100644000766000024 57112263123013 20335 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION 1.012078 FOOBAZ EXPLANATION This is a trial release. =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut Dialect.pm100644000766000024 176612263123013 20332 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Dialect; { $Pod::Weaver::Role::Dialect::VERSION = '4.006'; } use Moose::Role; with 'Pod::Weaver::Role::Plugin'; # ABSTRACT: something that translates Pod subdialects to standard Pod5 requires 'translate_dialect'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Dialect - something that translates Pod subdialects to standard Pod5 =head1 VERSION version 4.006 =head1 IMPLEMENTING The Dialect role indicates that a plugin will be used to pre-process the input Pod document before weaving begins. The plugin must provide a C method which will be called with the input hashref's C entry. It is expected to modify the document in place. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Section.pm100644000766000024 207312263123013 20361 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Section; { $Pod::Weaver::Role::Section::VERSION = '4.006'; } use Moose::Role; with 'Pod::Weaver::Role::Plugin'; # ABSTRACT: a plugin that will get a section into a woven document requires 'weave_section'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Section - a plugin that will get a section into a woven document =head1 VERSION version 4.006 =head1 IMPLEMENTING This role is used by plugins that will append sections to the output document. They must provide a method, C which will be invoked like this: $section_plugin->weave_section($output_document, \%input); They are expected to append their output to the output document, but they are free to behave differently if it's needed to do something really cool. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Section000755000766000024 012263123013 16760 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/WeaverBugs.pm100644000766000024 565612263123013 20372 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Bugs; { $Pod::Weaver::Section::Bugs::VERSION = '4.006'; } use Moose; use Text::Wrap (); with 'Pod::Weaver::Role::Section'; # ABSTRACT: a section for bugtracker info use Moose::Autobox; sub weave_section { my ($self, $document, $input) = @_; return unless exists $input->{distmeta}{resources}{bugtracker}; my $bugtracker = $input->{distmeta}{resources}{bugtracker}; my ($web,$mailto) = @{$bugtracker}{qw/web mailto/}; return unless defined $web || defined $mailto; my $text = "Please report any bugs or feature requests "; if (defined $web) { $text .= "on the bugtracker website $web"; $text .= defined $mailto ? " or " : "\n"; } if (defined $mailto) { $text .= "by email to $mailto\.\n"; } $text = Text::Wrap::wrap(q{}, q{}, $text); $text .= <<'HERE'; When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. HERE $document->children->push( Pod::Elemental::Element::Nested->new({ command => 'head1', content => 'BUGS', children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => $text }), ], }), ); } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Bugs - a section for bugtracker info =head1 VERSION version 4.006 =head1 OVERVIEW This section plugin will produce a hunk of Pod giving bug reporting information for the document, like this: =head1 BUGS Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/Dist/Display.html?Queue=Pod-Weaver When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. This plugin requires a C parameter containing a hash reference of L distribution metadata and at least one of one of the parameters C or C defined in C<< $meta->{resources}{bugtracker} >>. =head2 Using Pod::Weaver::Section::Bugs with Dist::Zilla When the PodWeaver plugin is used, the C parameter comes from the dist's distmeta data. Since this section is skipped when no bugtracker data is in the distmeta, you'll need to make sure it's there. A number of plugins set this data up automatically. To manually configure your bugtracker data, you can add something like the following to C: [MetaResources] bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=Pod-Weaver-Example bugtracker.mailto = bug-pod-weaver-example@rt.cpan.org ; Perhaps add repository stuff here: repository.url = repository.web = repository.type = [PodWeaver] =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Name.pm100644000766000024 575112263123013 20346 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Name; { $Pod::Weaver::Section::Name::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; with 'Pod::Weaver::Role::StringFromComment'; # ABSTRACT: add a NAME section with abstract (for your Perl module) use Moose::Autobox; use Pod::Elemental::Element::Pod5::Command; use Pod::Elemental::Element::Pod5::Ordinary; use Pod::Elemental::Element::Nested; sub _get_docname_via_statement { my ($self, $ppi_document) = @_; my $pkg_node = $ppi_document->find_first('PPI::Statement::Package'); return unless $pkg_node; return $pkg_node->namespace; } sub _get_docname_via_comment { my ($self, $ppi_document) = @_; return $self->_extract_comment_content($ppi_document, 'PODNAME'); } sub _get_docname { my ($self, $input) = @_; my $ppi_document = $input->{ppi_document}; my $docname = $self->_get_docname_via_comment($ppi_document) || $self->_get_docname_via_statement($ppi_document); return $docname; } sub _get_abstract { my ($self, $input) = @_; my $comment = $self->_extract_comment_content($input->{ppi_document}, 'ABSTRACT'); return $comment if $comment; # If that failed, fall back to searching the whole document my ($abstract) = $input->{ppi_document}->serialize =~ /^\s*#+\s*ABSTRACT:\s*(.+)$/m; return $abstract; } sub weave_section { my ($self, $document, $input) = @_; my $filename = $input->{filename} || 'file'; my $docname = $self->_get_docname($input); my $abstract = $self->_get_abstract($input); Carp::croak sprintf "couldn't determine document name for %s\nAdd something like this to %s:\n# PODNAME: bobby_tables.pl", $filename, $filename unless $docname; $self->log([ "couldn't find abstract in %s", $filename ]) unless $abstract; my $name = $docname; $name .= " - $abstract" if $abstract; my $name_para = Pod::Elemental::Element::Nested->new({ command => 'head1', content => 'NAME', children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => $name }), ], }); $document->children->push($name_para); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Name - add a NAME section with abstract (for your Perl module) =head1 VERSION version 4.006 =head1 OVERVIEW This section plugin will produce a hunk of Pod giving the name of the document as well as an abstract, like this: =head1 NAME Some::Document - a document for some It will determine the name and abstract by inspecting the C which must be given. It looks for comments in the form: # ABSTRACT: a document for some # PODNAME: Some::Package::Name If no C comment is present, but a package declaration can be found, the package name will be used as the document name. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Config000755000766000024 012263123013 16561 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/WeaverFinder.pm100644000766000024 137012263123013 20467 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Configpackage Pod::Weaver::Config::Finder; { $Pod::Weaver::Config::Finder::VERSION = '4.006'; } use Moose; extends 'Config::MVP::Reader::Finder'; with 'Pod::Weaver::Config'; # ABSTRACT: the reader for weaver.ini files sub default_search_path { return qw(Pod::Weaver::Config Config::MVP::Reader); } no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Config::Finder - the reader for weaver.ini files =head1 VERSION version 4.006 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Preparer.pm100644000766000024 173412263123013 20540 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Preparer; { $Pod::Weaver::Role::Preparer::VERSION = '4.006'; } use Moose::Role; with 'Pod::Weaver::Role::Plugin'; # ABSTRACT: something that mucks about with the input before weaving begins requires 'prepare_input'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Preparer - something that mucks about with the input before weaving begins =head1 VERSION version 4.006 =head1 IMPLEMENTING The Preparer role indicates that a plugin will be used to pre-process the input hashref before weaving begins. The plugin must provide a C method which will be called with the input hashref. It is expected to modify the input in place. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Legal.pm100644000766000024 370012263123013 20502 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Legal; { $Pod::Weaver::Section::Legal::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; # ABSTRACT: a section for the copyright and license use Moose::Autobox; has license_file => ( is => 'ro', isa => 'Str', predicate => '_has_license_file', ); sub weave_section { my ($self, $document, $input) = @_; return unless $input->{license}; my $notice = $input->{license}->notice; chomp $notice; if ( $self->_has_license_file ) { $notice .= "\n\nThe full text of the license can be found in the\nF<"; $notice .= $self->license_file . "> file included with this distribution."; } $document->children->push( Pod::Elemental::Element::Nested->new({ command => 'head1', content => 'COPYRIGHT AND LICENSE', children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => $notice }), ], }), ); } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Legal - a section for the copyright and license =head1 VERSION version 4.006 =head1 OVERVIEW This section plugin will produce a hunk of Pod giving the copyright and license information for the document, like this: =head1 COPYRIGHT AND LICENSE This document is copyright (C) 1991, Ricardo Signes. This document is available under the blah blah blah. This plugin will do nothing if no C input parameter is available. The C is expected to be a L object. =head1 ATTRIBUTES =head2 license_file Specify the name of the license file and an extra line of text will be added telling users to check the file for the full text of the license. Defaults to none. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Finalizer.pm100644000766000024 201312263123013 20672 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Finalizer; { $Pod::Weaver::Role::Finalizer::VERSION = '4.006'; } use Moose::Role; with 'Pod::Weaver::Role::Plugin'; # ABSTRACT: something that goes back and finishes up after main weaving is over requires 'finalize_document'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Finalizer - something that goes back and finishes up after main weaving is over =head1 VERSION version 4.006 =head1 IMPLEMENTING The Finalizer role indicates that a plugin will be used to post-process the output document hashref after section weaving is completed. The plugin must provide a C method which will be called as follows: $finalizer_plugin->finalize_document($document, \%input); =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Region.pm100644000766000024 631612263123013 20707 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Region; { $Pod::Weaver::Section::Region::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; # ABSTRACT: find a region and put its contents in place where desired use Moose::Autobox; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Selectors -all; use Pod::Elemental::Types qw(FormatName); has required => ( is => 'ro', isa => 'Bool', default => 0, ); has region_name => ( is => 'ro', isa => FormatName, lazy => 1, required => 1, default => sub { $_[0]->plugin_name }, ); has allow_nonpod => ( is => 'ro', isa => 'Bool', default => 0, ); has flatten => ( is => 'ro', isa => 'Bool', default => 1, ); sub weave_section { my ($self, $document, $input) = @_; my @to_insert; my $idc = $input->{pod_document}->children; IDX: for (my $i = 0; $i < $idc->length; $i++) { next unless my $para = $idc->[ $i ]; next unless $para->isa('Pod::Elemental::Element::Pod5::Region') and $para->format_name eq $self->region_name; next if !$self->allow_nonpod and !$para->is_pod; if ( $self->flatten ) { push @to_insert, $para->children->flatten; } else { push @to_insert, $para; } splice @$idc, $i, 1; redo IDX; } confess "Couldn't find required Region for " . $self->region_name . " in file " . (defined $input->{filename} ? $input->{filename} : '') if $self->required and not @to_insert; $document->children->push(@to_insert); } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Region - find a region and put its contents in place where desired =head1 VERSION version 4.006 =head1 OVERVIEW This section will find and include a located hunk of Pod. In general, it will find a region with the specified name. In other words, if your configuration include: [Region] region_name = myfoo ...then this weaver will look for "=begin myfoo" ( and "=for myfoo" and... ) and include it at the appropriate location in your output. Since you'll probably want to use Region several times, and that will require giving each use a unique name, you can omit C if you provide a plugin name, and it will default to the plugin name. In other words, the configuration above could be specified just as: [Region / myfoo] If the C attribute is given, and true, then an exception will be raised if this region can't be found. =head1 ATTRIBUTES =head2 required A boolean value specifying whether this region is required to be present or not. Defaults to false. If it's enabled and the region can't be found an exception will be raised. =head2 region_name The name of this region. Defaults to the plugin name. =head2 allow_nonpod A boolean value specifying whether nonpod regions are allowed or not. Defaults to false. =head2 flatten A boolean value specifying whether the region's contents should be flattened or not. Defaults to true. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut changes_has_content.t100644000766000024 201112263123013 21222 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/xt/release#!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '4.006'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Plugin000755000766000024 012263123013 16612 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/WeaverH1Nester.pm100644000766000024 241512263123013 20743 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Pluginpackage Pod::Weaver::Plugin::H1Nester; { $Pod::Weaver::Plugin::H1Nester::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Transformer'; # ABSTRACT: structure the input pod document into head1-grouped sections use namespace::autoclean; use Moose::Autobox; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Nester; sub transform_document { my ($self, $document) = @_; my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => s_command([ qw(head1) ]), content_selectors => [ s_flat, s_command( [ qw(head2 head3 head4 over item back) ]), ], }); $nester->transform_node($document); return; } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Plugin::H1Nester - structure the input pod document into head1-grouped sections =head1 VERSION version 4.006 =head1 OVERVIEW This plugin is very, very simple: it uses the L to restructure the document under its C<=head1> elements. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Authors.pm100644000766000024 365612263123013 21115 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Authors; { $Pod::Weaver::Section::Authors::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; # ABSTRACT: a section listing authors use Moose::Autobox; use Pod::Elemental::Element::Nested; use Pod::Elemental::Element::Pod5::Verbatim; sub weave_section { my ($self, $document, $input) = @_; return unless $input->{authors}; my $multiple_authors = $input->{authors}->length > 1; my $name = $multiple_authors ? 'AUTHORS' : 'AUTHOR'; my $authors = $input->{authors}->map(sub { Pod::Elemental::Element::Pod5::Ordinary->new({ content => $_, }), }); $authors = [ Pod::Elemental::Element::Pod5::Command->new({ command => 'over', content => '4', }), $authors->map(sub { Pod::Elemental::Element::Pod5::Command->new({ command => 'item', content => '*', }), $_, })->flatten, Pod::Elemental::Element::Pod5::Command->new({ command => 'back', content => '', }), ] if $multiple_authors; $document->children->push( Pod::Elemental::Element::Nested->new({ type => 'command', command => 'head1', content => $name, children => $authors, }), ); } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Authors - a section listing authors =head1 VERSION version 4.006 =head1 OVERVIEW This section adds a listing of the documents authors. It expects a C input parameter to be an arrayref of strings. If no C parameter is given, it will do nothing. Otherwise, it produces a hunk like this: =head1 AUTHORS Author One Author Two =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Collect.pm100644000766000024 666412263123013 21057 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Collect; { $Pod::Weaver::Section::Collect::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; with 'Pod::Weaver::Role::Transformer'; # ABSTRACT: a section that gathers up specific commands use Moose::Autobox; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Selectors -all; has command => ( is => 'ro', isa => 'Str', required => 1, ); has new_command => ( is => 'ro', isa => 'Str', required => 1, default => 'head2', ); has header_command => ( is => 'ro', isa => 'Str', required => 1, default => 'head1', ); has header => ( is => 'ro', isa => 'Str', lazy => 1, required => 1, default => sub { $_[0]->plugin_name }, ); use Pod::Elemental::Transformer::Gatherer; use Pod::Elemental::Transformer::Nester; has __used_container => (is => 'rw'); sub transform_document { my ($self, $document) = @_; my $selector = s_command($self->command); return unless $document->children->grep($selector)->length; my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => $selector, content_selectors => [ s_command([ qw(head3 head4 over item back) ]), s_flat, ], }); my $container = Pod::Elemental::Element::Nested->new({ command => $self->header_command, content => $self->header, }); $self->__used_container($container); my $gatherer = Pod::Elemental::Transformer::Gatherer->new({ gather_selector => $selector, container => $container, }); $nester->transform_node($document); $gatherer->transform_node($document); $container->children->each_value(sub { $_->command( $self->new_command ) if $_->command eq $self->command; }); } sub weave_section { my ($self, $document, $input) = @_; return unless $self->__used_container; my $in_node = $input->{pod_document}->children; my @found; $in_node->each(sub { my ($i, $para) = @_; push @found, $i if ($para == $self->__used_container) && $self->__used_container->children->length; }); my @to_add; for my $i (reverse @found) { push @to_add, splice @{ $in_node }, $i, 1; } $document->children->push(@to_add); } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Collect - a section that gathers up specific commands =head1 VERSION version 4.006 =head1 OVERVIEW Given the configuration: [Collect / METHODS] command = method This plugin will start off by gathering and nesting any C<=method> commands found in the C. Those commands, along with their nestable content, will be collected under a C<=head1 METHODS> header and placed in the correct location in the output stream. Their order will be preserved as it was in the source document. =head1 ATTRIBUTES =head2 command The command that will be collected (e.g. C or C). (required) =head2 new_command The command to be used in the output instead of the collected command. (default: C) =head2 header_command The section command for the section to be added. (default: C) =head2 header The title of the section to be added. (default: the plugin name) =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Generic.pm100644000766000024 535512263123013 21042 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Generic; { $Pod::Weaver::Section::Generic::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; # ABSTRACT: a generic section, found by lifting sections use Moose::Autobox; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Selectors -all; has required => ( is => 'ro', isa => 'Bool', default => 0, ); has header => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { $_[0]->plugin_name }, ); has selector => ( is => 'ro', isa => 'CodeRef', lazy => 1, default => sub { my ($self) = @_; return sub { return unless s_command(head1 => $_[0]); return unless $_[0]->content eq $self->header; }; }, ); sub weave_section { my ($self, $document, $input) = @_; my $in_node = $input->{pod_document}->children; my @found; $in_node->each(sub { my ($i, $para) = @_; push @found, $i if $self->selector->($para); }); confess "Couldn't find required Generic section for " . $self->header . " in file " . (defined $input->{filename} ? $input->{filename} : '') if $self->required and not @found; my @to_add; for my $i (reverse @found) { push @to_add, splice @{ $in_node }, $i, 1; } $document->children->push(@to_add); } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Generic - a generic section, found by lifting sections =head1 VERSION version 4.006 =head1 OVERVIEW This section will find and include a located hunk of Pod. In general, it will find a C<=head1> command with a content of the plugin's name. In other words, if your configuration include: [Generic] header = OVERVIEW ...then this weaver will look for "=head1 OVERVIEW" and include it at the appropriate location in your output. Since you'll probably want to use Generic several times, and that will require giving each use a unique name, you can omit C
if you provide a plugin name, and it will default to the plugin name. In other words, the configuration above could be specified just as: [Generic / OVERVIEW] If the C attribute is given, and true, then an exception will be raised if this section can't be found. =head1 ATTRIBUTES =head2 required A boolean value specifying whether this section is required to be present or not. Defaults to false. If it's enabled and the section can't be found an exception will be raised. =head2 header The name of this section. Defaults to the plugin name. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Version.pm100644000766000024 1350012263123013 21122 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Version; { $Pod::Weaver::Section::Version::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Section'; with 'Pod::Weaver::Role::StringFromComment'; # ABSTRACT: add a VERSION pod section use Module::Runtime qw(use_module); use namespace::autoclean; use DateTime; use Moose::Autobox; use Moose::Util::TypeConstraints; my $MARKER; BEGIN { $MARKER = "\x{2316}" } use String::Formatter 0.100680 stringf => { -as => '_format_version', input_processor => 'require_single_input', string_replacer => 'method_replace', codes => { v => sub { $_[0]->{version} }, V => sub { $_[0]->{version} . ($_[0]->{is_trial} ? (defined $_[1] ? $_[1] : '-TRIAL') : '') }, d => sub { use_module( 'DateTime', '0.44' ); # CLDR fixes DateTime->from_epoch(epoch => $^T, time_zone => $_[0]->{self}->time_zone) ->format_cldr($_[1]), }, r => sub { $_[0]->{zilla}->name }, m => sub { return $_[0]->{module} if defined $_[0]->{module}; $_[0]->{self}->log_fatal([ "%%m format used for Version section, but no package declaration found in %s", $_[0]->{filename}, ]); }, T => sub { $MARKER }, n => sub { "\n" }, s => sub { q{ } }, t => sub { "\t" }, }, }; # Needed by Config::MVP. sub mvp_multivalue_args { 'format' } subtype 'Pod::Weaver::Section::Version::_Format', as 'ArrayRef[Str]'; coerce 'Pod::Weaver::Section::Version::_Format', from 'Str', via { [ $_ ] }; has format => ( is => 'ro', isa => 'Pod::Weaver::Section::Version::_Format', coerce => 1, default => 'version %v', ); has is_verbatim => ( is => 'ro', isa => 'Bool', default => 0, ); has time_zone => ( is => 'ro', isa => 'Str', # should be more validated later -- apocal default => 'local', ); sub build_content { my ($self, $input) = @_; return unless $input->{version}; my %args = ( self => $self, version => $input->{version}, filename => $input->{filename}, ); $args{zilla} = $input->{zilla} if exists $input->{zilla}; $args{is_trial} = exists $input->{is_trial} ? $input->{is_trial} : $args{zilla} ? $args{zilla}->is_trial : undef; if ( exists $input->{ppi_document} ) { my $pkg_node = $input->{ppi_document}->find_first('PPI::Statement::Package'); $args{module} = $pkg_node ? $pkg_node->namespace : $self->_extract_comment_content($input->{ppi_document}, 'PODNAME') ; } my $content = q{}; LINE: for my $format (@{ $self->format }) { my $line = _format_version($format, \%args); next if $line =~ s/^$MARKER\s*// and ! $args{is_trial}; Carp::croak("%T format used inside line") if $line =~ /$MARKER/; $content .= "$line\n"; } if ( $self->is_verbatim ) { $content = Pod::Elemental::Element::Pod5::Verbatim->new({ content => " $content", }); } else { $content = Pod::Elemental::Element::Pod5::Ordinary->new({ content => $content, }); } return ($content); } sub weave_section { my ($self, $document, $input) = @_; return unless $input->{version}; my @content = $self->build_content($input); $document->children->push( Pod::Elemental::Element::Nested->new({ command => 'head1', content => 'VERSION', children => \@content, }), ); } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Version - add a VERSION pod section =head1 VERSION version 4.006 =head1 OVERVIEW This section plugin will produce a hunk of Pod meant to indicate the version of the document being viewed, like this: =head1 VERSION version 1.234 It will do nothing if there is no C entry in the input. =head1 ATTRIBUTES =head2 format The string to use when generating the version string. Default: version %v The following variables are available: =over 4 =item * v - the version =item * V - the version, suffixed by "-TRIAL" if a trial release =item * d - the CLDR format for L =item * n - a newline =item * t - a tab =item * s - a space =item * r - the name of the dist, present only if you use L to generate the POD! =item * m - the name of the module, present only if L parsed the document and it contained a package declaration! =item * T - special: at the beginning of the line, followed by any amount of whitespace, indicates that the line should only be included in trial releases; otherwise, results in a fatal error =back If multiple strings are supplied as an array ref, a line of POD is produced for each string. Each line will be separated by a newline. This is useful for splitting longer text across multiple lines in a C file, for example: ; weaver.ini [Version] format = version %v format = format = This module's version numbers follow the conventions described at format = L. format = %T format = %T This is a trial release! =head2 is_verbatim A boolean value specifying whether the version paragraph should be verbatim or not. Default: false =head2 time_zone The timezone to use when using L for the format. Default: local =head1 METHODS =head2 build_content my @pod_elements = $section->build_content(\%input); This method is passed the same C<\%input> that goes to the C method, and should return a list of pod elements to insert. In almost all cases, this method is used internally, but could be usefully overridden in a subclass. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Assembler.pm100644000766000024 174412263123013 21202 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Configpackage Pod::Weaver::Config::Assembler; { $Pod::Weaver::Config::Assembler::VERSION = '4.006'; } use Moose; extends 'Config::MVP::Assembler'; with 'Config::MVP::Assembler::WithBundles'; # ABSTRACT: Pod::Weaver-specific subclass of Config::MVP::Assembler use String::RewritePrefix; sub expand_package { my $str = $_[1]; return scalar String::RewritePrefix->rewrite( { '' => 'Pod::Weaver::Section::', '-' => 'Pod::Weaver::Plugin::', '@' => 'Pod::Weaver::PluginBundle::', '=' => '', }, $str, ); } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Config::Assembler - Pod::Weaver-specific subclass of Config::MVP::Assembler =head1 VERSION version 4.006 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Transformer.pm100644000766000024 173512263123013 21263 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::Transformer; { $Pod::Weaver::Role::Transformer::VERSION = '4.006'; } use Moose::Role; with 'Pod::Weaver::Role::Plugin'; # ABSTRACT: something that restructures a Pod5 document requires 'transform_document'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::Transformer - something that restructures a Pod5 document =head1 VERSION version 4.006 =head1 IMPLEMENTING The Transformer role indicates that a plugin will be used to pre-process the input hashref's Pod document before weaving begins. The plugin must provide a C method which will be called with the input Pod document. It is expected to modify the input in place. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut EnsurePod5.pm100644000766000024 336012263123013 21303 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Pluginpackage Pod::Weaver::Plugin::EnsurePod5; { $Pod::Weaver::Plugin::EnsurePod5::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Preparer'; # ABSTRACT: ensure that the Pod5 translator has been run on this document use namespace::autoclean; use Moose::Autobox; use Pod::Elemental::Transformer::Pod5; sub _strip_nonpod { my ($self, $node) = @_; # XXX: This is really stupid. -- rjbs, 2009-10-24 $node->children->keys->reverse->each_value(sub { my ($i, $para) = ($_, $node->children->[$_]); if ($para->isa('Pod::Elemental::Element::Pod5::Nonpod')) { if ($para->content !~ /\S/) { splice @{ $node->children }, $i, 1 } else { confess "can't cope with a Nonpod element with non-whitespace content"; } } elsif ($para->does('Pod::Elemental::Node')) { $self->_strip_nonpod($para); } }); } sub prepare_input { my ($self, $input) = @_; my $pod_document = $input->{pod_document}; Pod::Elemental::Transformer::Pod5->new->transform_node($pod_document); $self->_strip_nonpod($pod_document); return; } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Plugin::EnsurePod5 - ensure that the Pod5 translator has been run on this document =head1 VERSION version 4.006 =head1 OVERVIEW This plugin is very, very simple: it runs the Pod5 transformer on the input document and removes any leftover whitespace-only Nonpod elements. If non-whitespace-only Nonpod elements are found, an exception is raised. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Leftovers.pm100644000766000024 416512263123013 21435 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Sectionpackage Pod::Weaver::Section::Leftovers; { $Pod::Weaver::Section::Leftovers::VERSION = '4.006'; } use Moose; with( 'Pod::Weaver::Role::Section', 'Pod::Weaver::Role::Finalizer', ); # ABSTRACT: a place to put everything that nothing else used use Moose::Autobox; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Types qw(FormatName); has _marker => ( is => 'ro', isa => FormatName, init_arg => undef, default => sub { my ($self) = @_; my $str = sprintf '%s_%s', ref($self), 0+$self; $str =~ s/\W/_/g; return $str; } ); sub weave_section { my ($self, $document, $input) = @_; my $placeholder = Pod::Elemental::Element::Pod5::Region->new({ is_pod => 0, format_name => $self->_marker, content => '', }); $document->children->push($placeholder); } sub finalize_document { my ($self, $document, $input) = @_; my $children = $input->{pod_document}->children; $input->{pod_document}->children([]); INDEX: for my $i (0 .. $document->children->length - 1) { my $para = $document->children->[$i]; next unless $para->isa('Pod::Elemental::Element::Pod5::Region') and $para->format_name eq $self->_marker; splice @{ $document->children }, $i, 1, @$children; last INDEX; } } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Section::Leftovers - a place to put everything that nothing else used =head1 VERSION version 4.006 =head1 OVERVIEW This section plugin is used to designate where in the output sequence all unused parts of the input C should be placed. Other section plugins are expected to remove from the input Pod document any sections that are consumed. At the end of all section weaving, the Leftovers section will inject any leftover input Pod into its position in the output document. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut version_without_package.in.pod100644000766000024 40612263123013 21645 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut Transformer.pm100644000766000024 411612263123013 21614 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Pluginpackage Pod::Weaver::Plugin::Transformer; { $Pod::Weaver::Plugin::Transformer::VERSION = '4.006'; } use Moose; with 'Pod::Weaver::Role::Dialect'; # ABSTRACT: apply arbitrary transformers use namespace::autoclean; use Moose::Autobox; use Module::Runtime qw(use_module); use List::MoreUtils qw(part); use String::RewritePrefix; has transformer => (is => 'ro', required => 1); sub BUILDARGS { my ($class, @arg) = @_; my %copy = ref $arg[0] ? %{$arg[0]} : @arg; my @part = part { /\A\./ ? 0 : 1 } keys %copy; my %class_args = map { s/\A\.//; $_ => $copy{ ".$_" } } @{ $part[0] }; my %xform_args = map { $_ => $copy{ $_ } } @{ $part[1] }; my $xform_class = String::RewritePrefix->rewrite( { '' => 'Pod::Elemental::Transformer::', '=' => '' }, delete $xform_args{transformer}, ); use_module($xform_class); my $plugin_name = delete $xform_args{plugin_name}; my $weaver = delete $xform_args{weaver}; my $xform = $xform_class->new(\%xform_args); return { %class_args, plugin_name => $plugin_name, weaver => $weaver, transformer => $xform, } } sub translate_dialect { my ($self, $pod_document) = @_; $self->transformer->transform_node( $pod_document ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Plugin::Transformer - apply arbitrary transformers =head1 VERSION version 4.006 =head1 OVERVIEW This plugin acts as a L that applies an arbitrary L to your input document. It is configured like this: [-Transformer / Lists] transformer = List format_name = outline This will end up creating a transformer like this: my $xform = Pod::Elemental::Transformer::List->new({ format_name => 'outline', }); and that transformer will then be handed the entire input Pod document. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut version_without_package.out.pod100644000766000024 52312263123013 22046 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/t/eg=pod =head1 NAME Module::Name - abstract text =head1 VERSION version 1.012078 =head1 DESCRIPTION This is a simple document meant to be used in testing Pod::Weaver. It does not do very much. =head1 BE FOREWARNED This is not supported: much at all Happy hacking! =head1 SYNOPSIS This should probably get moved up front. =cut PluginBundle000755000766000024 012263123013 17744 5ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/WeaverDefault.pm100644000766000024 452112263123013 22030 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/PluginBundleuse strict; use warnings; package Pod::Weaver::PluginBundle::Default; { $Pod::Weaver::PluginBundle::Default::VERSION = '4.006'; } # ABSTRACT: a bundle for the most commonly-needed prep work for a pod document use namespace::autoclean; use Pod::Weaver::Config::Assembler; sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) } sub mvp_bundle_config { return ( [ '@Default/CorePrep', _exp('@CorePrep'), {} ], [ '@Default/SingleEncoding', _exp('-SingleEncoding'), {} ], [ '@Default/Name', _exp('Name'), {} ], [ '@Default/Version', _exp('Version'), {} ], [ '@Default/prelude', _exp('Region'), { region_name => 'prelude' } ], [ 'SYNOPSIS', _exp('Generic'), {} ], [ 'DESCRIPTION', _exp('Generic'), {} ], [ 'OVERVIEW', _exp('Generic'), {} ], [ 'ATTRIBUTES', _exp('Collect'), { command => 'attr' } ], [ 'METHODS', _exp('Collect'), { command => 'method' } ], [ 'FUNCTIONS', _exp('Collect'), { command => 'func' } ], [ '@Default/Leftovers', _exp('Leftovers'), {} ], [ '@Default/postlude', _exp('Region'), { region_name => 'postlude' } ], [ '@Default/Authors', _exp('Authors'), {} ], [ '@Default/Legal', _exp('Legal'), {} ], ) } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::PluginBundle::Default - a bundle for the most commonly-needed prep work for a pod document =head1 VERSION version 4.006 =head1 OVERVIEW This is the bundle used by default (specifically by Pod::Weaver's C method). It may change over time, but should remain fairly conservative and straightforward. It is nearly equivalent to the following: [@CorePrep] [-SingleEncoding] [Name] [Version] [Region / prelude] [Generic / SYNOPSIS] [Generic / DESCRIPTION] [Generic / OVERVIEW] [Collect / ATTRIBUTES] command = attr [Collect / METHODS] command = method [Collect / FUNCTIONS] command = func [Leftovers] [Region / postlude] [Authors] [Legal] =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut SingleEncoding.pm100644000766000024 535612263123013 22211 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Pluginpackage Pod::Weaver::Plugin::SingleEncoding; { $Pod::Weaver::Plugin::SingleEncoding::VERSION = '4.006'; } use Moose; with( 'Pod::Weaver::Role::Dialect', 'Pod::Weaver::Role::Finalizer', ); # ABSTRACT: ensure that there is exactly one =encoding of known value use namespace::autoclean; use Moose::Autobox; use Pod::Elemental::Selectors -all; has encoding => ( reader => 'encoding', writer => '_set_encoding', isa => 'Str', lazy => 1, default => 'UTF-8', predicate => '_has_encoding', ); sub translate_dialect { my ($self, $document) = @_; my $want; $want = $self->encoding if $self->_has_encoding; my $childs = $document->children; my $is_enc = s_command([ qw(encoding) ]); for (reverse 0 .. $#$childs) { next unless $is_enc->( $childs->[ $_ ] ); my $have = $childs->[$_]->content; $have =~ s/\s+\z//; if (defined $want) { my $ok = lc $have eq lc $want || lc $have eq 'utf8' && lc $want eq 'utf-8'; confess "expected only $want encoding but found $have" unless $ok; } else { $have = 'UTF-8' if lc $have eq 'utf8'; $self->_set_encoding($have); $want = $have; } splice @$childs, $_, 1; } return; } sub finalize_document { my ($self, $document, $input) = @_; my $encoding = Pod::Elemental::Element::Pod5::Command->new({ command => 'encoding', content => $self->encoding, }); my $childs = $document->children; my $is_pod = s_command([ qw(pod) ]); # ?? for (0 .. $#$childs) { next if $is_pod->( $childs->[ $_ ] ); splice @$childs, $_, 0, $encoding; last; } return; } no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Plugin::SingleEncoding - ensure that there is exactly one =encoding of known value =head1 VERSION version 4.006 =head1 OVERVIEW The SingleEncoding plugin is a Dialect and a Finalizer. During dialect translation, it will look for C<=encoding> directives. If it finds them, it will ensure that they all agree on one encoding and remove them. During document finalization, it will insert an C<=encoding> directive at the top of the output, using the encoding previously detected. If no encoding was detected, the plugin's C attribute will be used instead. That defaults to UTF-8. If you want to reject any C<=encoding> directive that doesn't match your expectations, set the C attribute by hand. No actual validation of the encoding is done. Pod::Weaver, after all, deals in text rather than bytes. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut CorePrep.pm100644000766000024 163612263123013 22167 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/PluginBundleuse strict; use warnings; package Pod::Weaver::PluginBundle::CorePrep; { $Pod::Weaver::PluginBundle::CorePrep::VERSION = '4.006'; } # ABSTRACT: a bundle for the most commonly-needed prep work for a pod document use Pod::Weaver::Plugin::H1Nester; sub mvp_bundle_config { return ( [ '@CorePrep/EnsurePod5', 'Pod::Weaver::Plugin::EnsurePod5', {} ], # dialects should run here [ '@CorePrep/H1Nester', 'Pod::Weaver::Plugin::H1Nester', {} ], ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::PluginBundle::CorePrep - a bundle for the most commonly-needed prep work for a pod document =head1 VERSION version 4.006 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut StringFromComment.pm100644000766000024 402312263123013 22367 0ustar00rjbsstaff000000000000Pod-Weaver-4.006/lib/Pod/Weaver/Rolepackage Pod::Weaver::Role::StringFromComment; { $Pod::Weaver::Role::StringFromComment::VERSION = '4.006'; } use Moose::Role; use namespace::autoclean; # ABSTRACT: Extract a string from a specially formatted comment use Moose::Autobox; sub _extract_comment_content { my ($self, $ppi_document, $key) = @_; my $regex = qr/^\s*#+\s*$key:\s*(.+)$/m; my $content; my $finder = sub { my $node = $_[1]; return 0 unless $node->isa('PPI::Token::Comment'); if ( $node->content =~ $regex ) { $content = $1; return 1; } return 0; }; $ppi_document->find_first($finder); return $content; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Weaver::Role::StringFromComment - Extract a string from a specially formatted comment =head1 VERSION version 4.006 =head1 OVERVIEW This role assists L by allowing them to pull strings from the source comments formatted like: # KEYNAME: Some string... This is probably the most familiar to people using lines like the following to allow the L to determine a module's abstract: # ABSTRACT: Provides the HypnoToad with mind-control powers It will extract these strings by inspecting the C which must be given. =head1 PRIVATE METHODS This role supplies only methods meant to be used internally by its consumer. =head2 _extract_comment_content($ppi_doc, $key) Given a key, try to find a comment matching C<# $key:> in the C<$ppi_document> and return everything but the prefix. e.g., given a document with a comment in it of the form: # ABSTRACT: Yada yada... ...and this is called... $self->_extract_comment_content($ppi, 'ABSTRACT') ...it returns to us: Yada yada... =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut