Parse-CPAN-Meta-1.4409/000755 000765 000024 00000000000 12220073642 014520 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/Changes000644 000765 000024 00000006466 12220073642 016027 0ustar00davidstaff000000 000000 Changes for Perl programming language extension Parse-CPAN-Meta 1.4409 2013-09-23 13:17:18 America/New_York [FIXED] - updated Makefile.PL logic to support PERL_NO_HIGHLANDER 1.4408 2013-09-23 11:06:35 America/New_York [FIXED] - Installation on Perls < 5.12 will uninstall older versions installed due to being bundled with ExtUtils::MakeMaker 1.4407 2013-09-08 10:16:29 America/New_York - Fixed incorrect resource metadata 1.4406 2013-09-08 09:59:28 America/New_York - Fixed improperly encoded META.yml 1.4405 2013-07-17 21:43:34 America/New_York - Fixed incorrect "return ... or die ..." constructs - Converted distribution to Dist::Zilla management - Noted new repository location in the Github Perl-Toolchain-Gang organization 1.4404 2012-04-05 - Protected tests from user PERL_YAML/JSON_BACKEND 1.4403 2012-04-01 - Bumped prereqs: JSON::PP to 2.27200 and CPAN::Meta::YAML to 0.008 1.4402 2012-02-07 - Minor maintenance: standardized newlines to Unix style 1.4401 2011-02-04 - Removed Module::Load::Conditional dependency 1.4400 2011-02-04 - Added 'json_backend' and 'yaml_backend' methods to provide the names of modules used for deserialization 1.4200 2011-01-24 - No changes from 1.41_04 1.41_04 2011-01-03 - Support PERL_JSON_BACKEND environment (defaulting to JSON::PP) - Support PERL_YAML_BACKEND environment (defaulting to CPAN::Meta:YAML) - Update Makefile.PL to install to sitelib on Perl 5.12+ 1.41_03 2010-12-17 - Throw exception when CPAN::Meta::YAML has a parse error (RT#47608) 1.41_02 2010-12-17 - Convert to using CPAN::Meta::YAML instead of YAML::Tiny 1.41_01 2010-12-10 - add support for JSON metafiles and load_* methods (RJBS) - Move binary file unpacking to test file from Makefile.PL so tests will pass in the Perl core using a generated Makefile.PL - Move bundled uupacktool.pl to t/bin/ 1.40 2009-07-25 - Add core perl 5.10.1's uupacktool.pl - Repackage t/data/utf_16_le_bom.yml as ASCII for https://rt.cpan.org/Ticket/Display.html?id=47844 1.39 2009-05-21 - Even though utf8 starts at 5.7+ there's no is_utf till 5.8.1 so skip in the tests if needed (ADAMK) 1.38 2009-05-16 - Synchorised version numbers with YAML::Tiny - Code shrinkages to the bloaty Unicode/BOM code - Merging a ton more tests from YAML::Tiny - Added back some pointless options to yaml_ok that keep our codebase closer to YAML::Tiny (which should help with syncing) - Changed exceptions to be closer to YAML::Tiny 0.05 2009-03-11 - Upgrade previous release to a stable release. 0.04_01 2009-03-03 - Merge Unicode / BOM fixes from YAML::Tiny 0.04 2009-01-07 - Matching changes in YAML::Tiny 1.36 - Fixing missing feature reported by H.Merijn Brand - Changes to make Padre-CPAN-Meta core-compatible (SMUELLER)++ 0.03 2008-03-20 - Adding YAML.pm compatibility in scalar context 0.02 2008-01-10 - Purging some references to YAML::Tiny that I missed 0.01 2008-01-08 - Cloned from YAML::Tiny 1.21 - Removed all write functionality - Reduced interface to Load and LoadFile - Removed object-orientation - Removed global $errstr, all errors are exceptions - Applied prototypes to all functions Parse-CPAN-Meta-1.4409/CONTRIBUTING000644 000765 000024 00000003554 12220073642 016361 0ustar00davidstaff000000 000000 ## HOW TO CONTRIBUTE Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with Dist::Zilla. This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). ### Getting dependencies See the included `cpanfile` file for a list of dependencies. If you have App::cpanminus 1.6 or later installed, you can use `cpanm` to satisfy dependencies like this: $ cpanm --installdeps . Otherwise, you can install Module::CPANfile 1.0002 or later and then satisfy dependencies with the regular `cpan` client and `cpanfile-dump`: $ cpan `cpanfile-dump` ### Running tests You can run tests directly using the `prove` tool: $ prove -l $ prove -lv t/some_test_file.t For most distributions, `prove` is entirely sufficent for you to test any patches you have. ### Patching documentation Likewise, much of the documentation Pod is generated at release time. Depending on the distribution, some documentation may be written in a Pod dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to submit a documentation edit, please limit yourself to the documentation you see. If you see typos or documentation issues in the generated docs, please email or open a bug ticket instead of patching. ### Learning Dist::Zilla Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps` $ dzil authordeps | cpanm Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil xtest You can learn more about Dist::Zilla at http://dzil.org/ Parse-CPAN-Meta-1.4409/cpanfile000644 000765 000024 00000001476 12220073642 016234 0ustar00davidstaff000000 000000 requires "CPAN::Meta::YAML" => "0.008"; requires "Carp" => "0"; requires "Exporter" => "0"; requires "File::Spec" => "0.80"; requires "JSON::PP" => "2.27200"; requires "perl" => "5.006"; requires "strict" => "0"; on 'test' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "File::Spec::Functions" => "0"; requires "File::Temp" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "List::Util" => "0"; requires "Test::More" => "0.47"; requires "vars" => "0"; requires "warnings" => "0"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "6.30"; }; on 'develop' => sub { requires "Pod::Coverage::TrustPod" => "0"; requires "Test::CPAN::Meta" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; }; Parse-CPAN-Meta-1.4409/dist.ini000644 000765 000024 00000001257 12220073642 016171 0ustar00davidstaff000000 000000 name = Parse-CPAN-Meta author = Adam Kennedy author = David Golden license = Perl_5 copyright_holder = Adam Kennedy and Contributors [Prereqs] CPAN::Meta::YAML = 0.008 File::Spec = 0.80 JSON::PP = 2.27200 [Prereqs / TestRequires] Test::More = 0.47 [@DAGOLDEN] :version = 0.053 -remove = MakeMaker authority = cpan:ADAMK github_issues = 0 no_critic = 0 stopwords = LoadFile stopwords = deserialization stopwords = deserialize stopwords = deserializes stopwords = deserializing stopwords = die'ing stopwords = json stopwords = metafiles stopwords = serializer [MakeMaker] [MakeMaker::Highlander] :version = 0.003 [DualLife] entered_core=5.010001 Parse-CPAN-Meta-1.4409/lib/000755 000765 000024 00000000000 12220073642 015266 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/LICENSE000644 000765 000024 00000043736 12220073642 015542 0ustar00davidstaff000000 000000 This software is copyright (c) 2013 by Adam Kennedy and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 by Adam Kennedy and Contributors. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 by Adam Kennedy and Contributors. 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 Parse-CPAN-Meta-1.4409/Makefile.PL000644 000765 000024 00000004154 12220073642 016476 0ustar00davidstaff000000 000000 use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "Parse META.yml and META.json CPAN metadata files", "AUTHOR" => "Adam Kennedy , David Golden ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Parse-CPAN-Meta", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Parse::CPAN::Meta", "PREREQ_PM" => { "CPAN::Meta::YAML" => "0.008", "Carp" => 0, "Exporter" => 0, "File::Spec" => "0.80", "JSON::PP" => "2.27200", "strict" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "List::Util" => 0, "Test::More" => "0.47", "vars" => 0, "warnings" => 0 }, "VERSION" => "1.4409", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; # Added by Dist::Zilla::Plugin::MakeMaker::Highlander if ( $] < 5.012 && ! $ENV{PERL_NO_HIGHLANDER} && ! ( $ENV{PERL_MM_OPT} && $ENV{PERL_MM_OPT} =~ /(?:INSTALL_BASE|PREFIX)/ ) && ! grep { /INSTALL_BASE/ || /PREFIX/ } @ARGV ) { $WriteMakefileArgs{UNINST} = 1; } $WriteMakefileArgs{INSTALLDIRS} = 'perl' if $] >= 5.010001 && $] <= 5.011000; WriteMakefile(%WriteMakefileArgs); Parse-CPAN-Meta-1.4409/MANIFEST000644 000765 000024 00000000746 12220073642 015660 0ustar00davidstaff000000 000000 CONTRIBUTING Changes LICENSE MANIFEST META.json META.yml Makefile.PL README cpanfile dist.ini lib/Parse/CPAN/Meta.pm perlcritic.rc t/00-compile.t t/00-report-prereqs.t t/02_api.t t/03_functions.t t/04_export.t t/05_errors.t t/data/META-VR.json t/data/META-VR.yml t/lib/Parse/CPAN/Meta/Test.pm xt/author/critic.t xt/author/pod-spell.t xt/release/distmeta.t xt/release/minimum-version.t xt/release/pod-coverage.t xt/release/pod-syntax.t xt/release/portability.t xt/release/test-version.t Parse-CPAN-Meta-1.4409/META.json000644 000765 000024 00000004735 12220073642 016152 0ustar00davidstaff000000 000000 { "abstract" : "Parse META.yml and META.json CPAN metadata files", "author" : [ "Adam Kennedy ", "David Golden " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Parse-CPAN-Meta", "no_index" : { "directory" : [ "t", "xt", "examples", "corpus" ], "package" : [ "DB" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Meta" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "CPAN::Meta::YAML" : "0.008", "Carp" : "0", "Exporter" : "0", "File::Spec" : "0.80", "JSON::PP" : "2.27200", "perl" : "5.006", "strict" : "0" } }, "test" : { "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "File::Spec::Functions" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "List::Util" : "0", "Test::More" : "0.47", "vars" : "0", "warnings" : "0" } } }, "provides" : { "Parse::CPAN::Meta" : { "file" : "lib/Parse/CPAN/Meta.pm", "version" : "1.4409" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Parse-CPAN-Meta" }, "homepage" : "https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta", "repository" : { "type" : "git", "url" : "https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git", "web" : "https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta" } }, "version" : "1.4409", "x_authority" : "cpan:ADAMK", "x_contributors" : [ "Joshua ben Jore ", "Neil Bowers ", "Ricardo Signes ", "Steffen Mueller " ] } Parse-CPAN-Meta-1.4409/META.yml000644 000765 000024 00000002510 12220073642 015767 0ustar00davidstaff000000 000000 --- abstract: 'Parse META.yml and META.json CPAN metadata files' author: - 'Adam Kennedy ' - 'David Golden ' build_requires: ExtUtils::MakeMaker: 0 File::Spec: 0 File::Spec::Functions: 0 File::Temp: 0 IO::Handle: 0 IPC::Open3: 0 List::Util: 0 Test::More: 0.47 vars: 0 warnings: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Parse-CPAN-Meta no_index: directory: - t - xt - examples - corpus package: - DB provides: Parse::CPAN::Meta: file: lib/Parse/CPAN/Meta.pm version: 1.4409 requires: CPAN::Meta::YAML: 0.008 Carp: 0 Exporter: 0 File::Spec: 0.80 JSON::PP: 2.27200 perl: 5.006 strict: 0 resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Parse-CPAN-Meta homepage: https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta repository: https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git version: 1.4409 x_authority: cpan:ADAMK x_contributors: - 'Joshua ben Jore ' - 'Neil Bowers ' - 'Ricardo Signes ' - 'Steffen Mueller ' Parse-CPAN-Meta-1.4409/perlcritic.rc000644 000765 000024 00000001147 12220073642 017211 0ustar00davidstaff000000 000000 severity = 5 verbose = 8 [Variables::ProhibitPunctuationVars] allow = $@ $! [TestingAndDebugging::ProhibitNoStrict] allow = refs # Turn these off [-BuiltinFunctions::ProhibitStringyEval] [-ControlStructures::ProhibitPostfixControls] [-ControlStructures::ProhibitUnlessBlocks] [-Documentation::RequirePodSections] [-InputOutput::ProhibitInteractiveTest] [-References::ProhibitDoubleSigils] [-RegularExpressions::RequireExtendedFormatting] [-InputOutput::ProhibitTwoArgOpen] [-Modules::ProhibitEvilModules] [-Subroutines::ProhibitSubroutinePrototypes] # Turn this on [Lax::ProhibitStringyEval::ExceptForRequire] Parse-CPAN-Meta-1.4409/README000644 000765 000024 00000012164 12220073642 015404 0ustar00davidstaff000000 000000 NAME Parse::CPAN::Meta - Parse META.yml and META.json CPAN metadata files VERSION version 1.4409 SYNOPSIS ############################################# # In your file --- name: My-Distribution version: 1.23 resources: homepage: "http://example.com/dist/My-Distribution" ############################################# # In your program use Parse::CPAN::Meta; my $distmeta = Parse::CPAN::Meta->load_file('META.yml'); # Reading properties my $name = $distmeta->{name}; my $version = $distmeta->{version}; my $homepage = $distmeta->{resources}{homepage}; DESCRIPTION Parse::CPAN::Meta is a parser for META.json and META.yml files, using JSON::PP and/or CPAN::Meta::YAML. Parse::CPAN::Meta provides three methods: "load_file", "load_json_string", and "load_yaml_string". These will read and deserialize CPAN metafiles, and are described below in detail. Parse::CPAN::Meta provides a legacy API of only two functions, based on the YAML functions of the same name. Wherever possible, identical calling semantics are used. These may only be used with YAML sources. All error reporting is done with exceptions (die'ing). Note that META files are expected to be in UTF-8 encoding, only. When converted string data, it must first be decoded from UTF-8. METHODS load_file my $metadata_structure = Parse::CPAN::Meta->load_file('META.json'); my $metadata_structure = Parse::CPAN::Meta->load_file('META.yml'); This method will read the named file and deserialize it to a data structure, determining whether it should be JSON or YAML based on the filename. On Perl 5.8.1 or later, the file will be read using the ":utf8" IO layer. load_yaml_string my $metadata_structure = Parse::CPAN::Meta->load_yaml_string($yaml_string); This method deserializes the given string of YAML and returns the first document in it. (CPAN metadata files should always have only one document.) If the source was UTF-8 encoded, the string must be decoded before calling "load_yaml_string". load_json_string my $metadata_structure = Parse::CPAN::Meta->load_json_string($json_string); This method deserializes the given string of JSON and the result. If the source was UTF-8 encoded, the string must be decoded before calling "load_json_string". yaml_backend my $backend = Parse::CPAN::Meta->yaml_backend; Returns the module name of the YAML serializer. See "ENVIRONMENT" for details. json_backend my $backend = Parse::CPAN::Meta->json_backend; Returns the module name of the JSON serializer. This will either be JSON::PP or JSON. Even if "PERL_JSON_BACKEND" is set, this will return JSON as further delegation is handled by the JSON module. See "ENVIRONMENT" for details. FUNCTIONS For maintenance clarity, no functions are exported. These functions are available for backwards compatibility only and are best avoided in favor of "load_file". Load my @yaml = Parse::CPAN::Meta::Load( $string ); Parses a string containing a valid YAML stream into a list of Perl data structures. LoadFile my @yaml = Parse::CPAN::Meta::LoadFile( 'META.yml' ); Reads the YAML stream from a file instead of a string. ENVIRONMENT PERL_JSON_BACKEND By default, JSON::PP will be used for deserializing JSON data. If the "PERL_JSON_BACKEND" environment variable exists, is true and is not "JSON::PP", then the JSON module (version 2.5 or greater) will be loaded and used to interpret "PERL_JSON_BACKEND". If JSON is not installed or is too old, an exception will be thrown. PERL_YAML_BACKEND By default, CPAN::Meta::YAML will be used for deserializing YAML data. If the "PERL_YAML_BACKEND" environment variable is defined, then it is interpreted as a module to use for deserialization. The given module must be installed, must load correctly and must implement the "Load()" function or an exception will be thrown. SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at . You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. git clone https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git AUTHORS * Adam Kennedy * David Golden CONTRIBUTORS * Joshua ben Jore * Neil Bowers * Ricardo Signes * Steffen Mueller COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Adam Kennedy and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Parse-CPAN-Meta-1.4409/t/000755 000765 000024 00000000000 12220073642 014763 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/xt/000755 000765 000024 00000000000 12220073642 015153 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/xt/author/000755 000765 000024 00000000000 12220073642 016455 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/xt/release/000755 000765 000024 00000000000 12220073642 016573 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/xt/release/distmeta.t000644 000765 000024 00000000217 12220073642 020572 0ustar00davidstaff000000 000000 #!perl use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); Parse-CPAN-Meta-1.4409/xt/release/minimum-version.t000644 000765 000024 00000000266 12220073642 022122 0ustar00davidstaff000000 000000 #!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.010} ); Parse-CPAN-Meta-1.4409/xt/release/pod-coverage.t000644 000765 000024 00000000527 12220073642 021337 0ustar00davidstaff000000 000000 #!perl use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Parse-CPAN-Meta-1.4409/xt/release/pod-syntax.t000644 000765 000024 00000000212 12220073642 021061 0ustar00davidstaff000000 000000 #!perl 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(); Parse-CPAN-Meta-1.4409/xt/release/portability.t000644 000765 000024 00000000332 12220073642 021320 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; options(test_one_dot => 0); run_tests(); Parse-CPAN-Meta-1.4409/xt/release/test-version.t000644 000765 000024 00000000643 12220073642 021425 0ustar00davidstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.002004 BEGIN { eval "use Test::Version; 1;" or die $@; } my @imports = ( 'version_all_ok' ); my $params = { is_strict => 0, has_version => 1, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; Parse-CPAN-Meta-1.4409/xt/author/critic.t000644 000765 000024 00000000435 12220073642 020121 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); Parse-CPAN-Meta-1.4409/xt/author/pod-spell.t000644 000765 000024 00000000751 12220073642 020544 0ustar00davidstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ LoadFile deserialization deserialize deserializes deserializing die'ing json metafiles serializer Adam Kennedy adamk David Golden dagolden and Contributors Joshua ben Jore jjore Neil Bowers neil Ricardo Signes rjbs Steffen Mueller smueller lib Parse CPAN Meta Parse-CPAN-Meta-1.4409/t/00-compile.t000644 000765 000024 00000001751 12220073642 017021 0ustar00davidstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.033 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Parse/CPAN/Meta.pm' ); # fake home for cpan-testers use File::Temp; local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); use File::Spec; use IPC::Open3; use IO::Handle; my @warnings; for my $lib (@module_files) { # see L open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($? >> 8, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; Parse-CPAN-Meta-1.4409/t/00-report-prereqs.t000644 000765 000024 00000003140 12220073642 020355 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec::Functions; use List::Util qw/max/; my @modules = qw( CPAN::Meta::YAML Carp Exporter ExtUtils::MakeMaker File::Spec File::Spec::Functions File::Temp IO::Handle IPC::Open3 JSON::PP List::Util Test::More perl strict vars warnings ); # replace modules with dynamic results from MYMETA.json if we can # (hide CPAN::Meta from prereq scanner) my $cpan_meta = "CPAN::Meta"; if ( -f "MYMETA.json" && eval "require $cpan_meta" ) { ## no critic if ( my $meta = eval { CPAN::Meta->load_file("MYMETA.json") } ) { my $prereqs = $meta->prereqs; delete $prereqs->{develop}; my %uniq = map {$_ => 1} map { keys %$_ } map { values %$_ } values %$prereqs; $uniq{$_} = 1 for @modules; # don't lose any static ones @modules = sort keys %uniq; } } my @reports = [qw/Version Module/]; for my $mod ( @modules ) { next if $mod eq 'perl'; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e catfile($_, $file) } @INC; if ( $prefix ) { my $ver = MM->parse_version( catfile($prefix, $file) ); $ver = "undef" unless defined $ver; # Newer MM should do this anyway push @reports, [$ver, $mod]; } else { push @reports, ["missing", $mod]; } } if ( @reports ) { my $vl = max map { length $_->[0] } @reports; my $ml = max map { length $_->[1] } @reports; splice @reports, 1, 0, ["-" x $vl, "-" x $ml]; diag "Prerequisite Report:\n", map {sprintf(" %*s %*s\n",$vl,$_->[0],-$ml,$_->[1])} @reports; } pass; # vim: ts=2 sts=2 sw=2 et: Parse-CPAN-Meta-1.4409/t/02_api.t000644 000765 000024 00000007754 12220073642 016237 0ustar00davidstaff000000 000000 #!/usr/bin/perl delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; # Testing of a known-bad file from an editor BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib/'; } } use strict; BEGIN { $| = 1; $^W = 1; } use File::Spec::Functions ':ALL'; use Parse::CPAN::Meta; use Parse::CPAN::Meta::Test; # use Test::More skip_all => 'Temporarily ignoring failing test'; use Test::More 'no_plan'; ##################################################################### # Testing that Perl::Smith config files work my $want = { "abstract" => "a set of version requirements for a CPAN dist", "author" => [ 'Ricardo Signes ' ], "build_requires" => { "Test::More" => "0.88" }, "configure_requires" => { "ExtUtils::MakeMaker" => "6.31" }, "generated_by" => "Dist::Zilla version 2.100991", "license" => "perl", "meta-spec" => { "url" => "http://module-build.sourceforge.net/META-spec-v1.4.html", "version" => 1.4 }, "name" => "Version-Requirements", "recommends" => {}, "requires" => { "Carp" => "0", "Scalar::Util" => "0", "version" => "0.77" }, "resources" => { "repository" => "git://git.codesimply.com/Version-Requirements.git" }, "version" => "0.101010", }; my $meta_json = catfile( test_data_directory(), 'META-VR.json' ); my $meta_yaml = catfile( test_data_directory(), 'META-VR.yml' ); ### YAML tests { local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend()'); my $from_yaml = Parse::CPAN::Meta->load_file( $meta_yaml ); is_deeply($from_yaml, $want, "load from YAML file results in expected data"); } { local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML my $yaml = load_ok( 'META-VR.yml', $meta_yaml, 100); my $from_yaml = Parse::CPAN::Meta->load_yaml_string( $yaml ); is_deeply($from_yaml, $want, "load from YAML str results in expected data"); } SKIP: { skip "YAML module not installed", 2 unless eval "require YAML; 1"; local $ENV{PERL_YAML_BACKEND} = 'YAML'; is(Parse::CPAN::Meta->yaml_backend(), 'YAML', 'yaml_backend()'); my $yaml = load_ok( 'META-VR.yml', $meta_yaml, 100); my $from_yaml = Parse::CPAN::Meta->load_yaml_string( $yaml ); is_deeply($from_yaml, $want, "load_yaml_string using PERL_YAML_BACKEND"); } ### JSON tests { # JSON tests with JSON::PP local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend()'); my $from_json = Parse::CPAN::Meta->load_file( $meta_json ); is_deeply($from_json, $want, "load from JSON file results in expected data"); } { # JSON tests with JSON::PP local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP my $json = load_ok( 'META-VR.json', $meta_json, 100); my $from_json = Parse::CPAN::Meta->load_json_string( $json ); is_deeply($from_json, $want, "load from JSON str results in expected data"); } { # JSON tests with JSON::PP, take 2 local $ENV{PERL_JSON_BACKEND} = 0; # request JSON::PP my $json = load_ok( 'META-VR.json', $meta_json, 100); my $from_json = Parse::CPAN::Meta->load_json_string( $json ); is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 0"); } { # JSON tests with JSON::PP, take 3 local $ENV{PERL_JSON_BACKEND} = 'JSON::PP'; # request JSON::PP my $json = load_ok( 'META-VR.json', $meta_json, 100); my $from_json = Parse::CPAN::Meta->load_json_string( $json ); is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 'JSON::PP'"); } SKIP: { skip "JSON module version 2.5 not installed", 2 unless eval "require JSON; JSON->VERSION(2.5); 1"; local $ENV{PERL_JSON_BACKEND} = 1; is(Parse::CPAN::Meta->json_backend(), 'JSON', 'json_backend()'); my $json = load_ok( 'META-VR.json', $meta_json, 100); my $from_json = Parse::CPAN::Meta->load_json_string( $json ); is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 1"); } Parse-CPAN-Meta-1.4409/t/03_functions.t000644 000765 000024 00000001247 12220073642 017466 0ustar00davidstaff000000 000000 #!/usr/bin/perl delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; # Testing of basic document structures BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib/'; } } use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 2; use Parse::CPAN::Meta (); my $one = <<'END_YAML'; --- - foo END_YAML my $two = <<'END_YAML'; --- - foo --- - bar END_YAML my $one_scalar_tiny = Parse::CPAN::Meta::Load( $one ); my $two_scalar_tiny = Parse::CPAN::Meta::Load( $two ); is_deeply( $one_scalar_tiny, [ 'foo' ], 'one: Parsed correctly' ); is_deeply( $two_scalar_tiny, [ 'bar' ], 'two: Parsed correctly' ); Parse-CPAN-Meta-1.4409/t/04_export.t000644 000765 000024 00000001063 12220073642 016774 0ustar00davidstaff000000 000000 #!/usr/bin/perl delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; # Testing of basic document structures BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib/'; } } use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 4; use Parse::CPAN::Meta; ok not(defined &main::Load), 'Load is not exported'; ok not(defined &main::Dump), 'Dump is not exported'; ok not(defined &main::LoadFile), 'LoadFile is not exported'; ok not(defined &main::DumpFile), 'DumpFile is not exported'; Parse-CPAN-Meta-1.4409/t/05_errors.t000644 000765 000024 00000001015 12220073642 016765 0ustar00davidstaff000000 000000 #!/usr/bin/perl delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; # Testing of basic document structures BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib/'; } } use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 1; use Parse::CPAN::Meta (); my $one = <<'END_YAML'; --- - foo: - bar END_YAML my $one_scalar_tiny = eval { Parse::CPAN::Meta->load_yaml_string( $one ) }; like( $@, '/illegal characters/', "error causes exception"); Parse-CPAN-Meta-1.4409/t/data/000755 000765 000024 00000000000 12220073642 015674 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/t/lib/000755 000765 000024 00000000000 12220073642 015531 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/t/lib/Parse/000755 000765 000024 00000000000 12220073642 016603 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/t/lib/Parse/CPAN/000755 000765 000024 00000000000 12220073642 017324 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/t/lib/Parse/CPAN/Meta/000755 000765 000024 00000000000 12220073642 020212 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/t/lib/Parse/CPAN/Meta/Test.pm000644 000765 000024 00000004116 12220073642 021471 0ustar00davidstaff000000 000000 package Parse::CPAN::Meta::Test; use strict; use Test::More (); use Parse::CPAN::Meta; use File::Spec; use vars qw{@ISA @EXPORT}; BEGIN { require Exporter; @ISA = qw{ Exporter }; @EXPORT = qw{ tests yaml_ok yaml_error slurp load_ok test_data_directory }; } sub test_data_directory { return( $ENV{PERL_CORE} ? File::Spec->catdir(File::Spec->updir, qw(lib Parse CPAN Meta t data)) : File::Spec->catdir(qw(t data)) ); } # 22 tests per call to yaml_ok # 4 tests per call to load_ok sub tests { return ( tests => count(@_) ); } sub count { my $yaml_ok = shift || 0; my $load_ok = shift || 0; my $single = shift || 0; my $count = $yaml_ok * 3 + $load_ok * 4 + $single; return $count; } sub yaml_ok { my $string = shift; my $array = shift; my $name = shift || 'unnamed'; # Does the string parse to the structure my $yaml_copy = $string; my @yaml = eval { Parse::CPAN::Meta::Load( $yaml_copy ); }; Test::More::is( $@, '', "$name: Parse::CPAN::Meta parses without error" ); Test::More::is( $yaml_copy, $string, "$name: Parse::CPAN::Meta does not modify the input string" ); SKIP: { Test::More::skip( "Shortcutting after failure", 1 ) if $@; Test::More::is_deeply( \@yaml, $array, "$name: Parse::CPAN::Meta parses correctly" ); } # Return true as a convenience return 1; } sub yaml_error { my $string = shift; my $yaml = eval { Parse::CPAN::Meta::Load( $string ); }; Test::More::like( $@, qr/$_[0]/, "CPAN::Meta::YAML throws expected error" ); } sub slurp { my $file = shift; local $/ = undef; open( FILE, " $file" ) or die "open($file) failed: $!"; my $source = ; close( FILE ) or die "close($file) failed: $!"; $source; } sub load_ok { my $name = shift; my $file = shift; my $size = shift; Test::More::ok( -f $file, "Found $name" ) or Test::More::diag("Searched at '$file'"); Test::More::ok( -r $file, "Can read $name" ); my $content = slurp( $file ); Test::More::ok( (defined $content and ! ref $content), "Loaded $name" ); Test::More::ok( ($size < length $content), "Content of $name larger than $size bytes" ); return $content; } 1; Parse-CPAN-Meta-1.4409/t/data/META-VR.json000644 000765 000024 00000001336 12220073642 017645 0ustar00davidstaff000000 000000 { "abstract" : "a set of version requirements for a CPAN dist", "author" : [ "Ricardo Signes " ], "build_requires" : { "Test::More" : "0.88" }, "configure_requires" : { "ExtUtils::MakeMaker" : "6.31" }, "generated_by" : "Dist::Zilla version 2.100991", "license" : "perl", "meta-spec" : { "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html", "version" : 1.4 }, "name" : "Version-Requirements", "recommends" : {}, "requires" : { "Carp" : "0", "Scalar::Util" : "0", "version" : "0.77" }, "resources" : { "repository" : "git://git.codesimply.com/Version-Requirements.git" }, "version" : "0.101010" } Parse-CPAN-Meta-1.4409/t/data/META-VR.yml000644 000765 000024 00000001017 12220073642 017471 0ustar00davidstaff000000 000000 --- abstract: 'a set of version requirements for a CPAN dist' author: - 'Ricardo Signes ' build_requires: Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 6.31 generated_by: 'Dist::Zilla version 2.100991' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Version-Requirements recommends: {} requires: Carp: 0 Scalar::Util: 0 version: 0.77 resources: repository: git://git.codesimply.com/Version-Requirements.git version: 0.101010 Parse-CPAN-Meta-1.4409/lib/Parse/000755 000765 000024 00000000000 12220073642 016340 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/lib/Parse/CPAN/000755 000765 000024 00000000000 12220073642 017061 5ustar00davidstaff000000 000000 Parse-CPAN-Meta-1.4409/lib/Parse/CPAN/Meta.pm000644 000765 000024 00000020551 12220073642 020310 0ustar00davidstaff000000 000000 use strict; package Parse::CPAN::Meta; # ABSTRACT: Parse META.yml and META.json CPAN metadata files our $VERSION = '1.4409'; # VERSION use Carp 'croak'; # UTF Support? sub HAVE_UTF8 () { $] >= 5.007003 } sub IO_LAYER () { $] >= 5.008001 ? ":utf8" : "" } BEGIN { if ( HAVE_UTF8 ) { # The string eval helps hide this from Test::MinimumVersion eval "require utf8;"; die "Failed to load UTF-8 support" if $@; } # Class structure require 5.004; require Exporter; @Parse::CPAN::Meta::ISA = qw{ Exporter }; @Parse::CPAN::Meta::EXPORT_OK = qw{ Load LoadFile }; } sub load_file { my ($class, $filename) = @_; if ($filename =~ /\.ya?ml$/) { return $class->load_yaml_string(_slurp($filename)); } if ($filename =~ /\.json$/) { return $class->load_json_string(_slurp($filename)); } croak("file type cannot be determined by filename"); } sub load_yaml_string { my ($class, $string) = @_; my $backend = $class->yaml_backend(); my $data = eval { no strict 'refs'; &{"$backend\::Load"}($string) }; if ( $@ ) { croak $backend->can('errstr') ? $backend->errstr : $@ } return $data || {}; # in case document was valid but empty } sub load_json_string { my ($class, $string) = @_; return $class->json_backend()->new->decode($string); } sub yaml_backend { local $Module::Load::Conditional::CHECK_INC_HASH = 1; if (! defined $ENV{PERL_YAML_BACKEND} ) { _can_load( 'CPAN::Meta::YAML', 0.002 ) or croak "CPAN::Meta::YAML 0.002 is not available\n"; return "CPAN::Meta::YAML"; } else { my $backend = $ENV{PERL_YAML_BACKEND}; _can_load( $backend ) or croak "Could not load PERL_YAML_BACKEND '$backend'\n"; $backend->can("Load") or croak "PERL_YAML_BACKEND '$backend' does not implement Load()\n"; return $backend; } } sub json_backend { local $Module::Load::Conditional::CHECK_INC_HASH = 1; if (! $ENV{PERL_JSON_BACKEND} or $ENV{PERL_JSON_BACKEND} eq 'JSON::PP') { _can_load( 'JSON::PP' => 2.27103 ) or croak "JSON::PP 2.27103 is not available\n"; return 'JSON::PP'; } else { _can_load( 'JSON' => 2.5 ) or croak "JSON 2.5 is required for " . "\$ENV{PERL_JSON_BACKEND} = '$ENV{PERL_JSON_BACKEND}'\n"; return "JSON"; } } sub _slurp { open my $fh, "<" . IO_LAYER, "$_[0]" or die "can't open $_[0] for reading: $!"; return do { local $/; <$fh> }; } sub _can_load { my ($module, $version) = @_; (my $file = $module) =~ s{::}{/}g; $file .= ".pm"; return 1 if $INC{$file}; return 0 if exists $INC{$file}; # prior load failed eval { require $file; 1 } or return 0; if ( defined $version ) { eval { $module->VERSION($version); 1 } or return 0; } return 1; } # Kept for backwards compatibility only # Create an object from a file sub LoadFile ($) { require CPAN::Meta::YAML; my $object = CPAN::Meta::YAML::LoadFile(shift) or die CPAN::Meta::YAML->errstr; return $object; } # Parse a document from a string. sub Load ($) { require CPAN::Meta::YAML; my $object = CPAN::Meta::YAML::Load(shift) or die CPAN::Meta::YAML->errstr; return $object; } 1; __END__ =pod =encoding utf-8 =head1 NAME Parse::CPAN::Meta - Parse META.yml and META.json CPAN metadata files =head1 VERSION version 1.4409 =head1 SYNOPSIS ############################################# # In your file --- name: My-Distribution version: 1.23 resources: homepage: "http://example.com/dist/My-Distribution" ############################################# # In your program use Parse::CPAN::Meta; my $distmeta = Parse::CPAN::Meta->load_file('META.yml'); # Reading properties my $name = $distmeta->{name}; my $version = $distmeta->{version}; my $homepage = $distmeta->{resources}{homepage}; =head1 DESCRIPTION B is a parser for F and F files, using L and/or L. B provides three methods: C, C, and C. These will read and deserialize CPAN metafiles, and are described below in detail. B provides a legacy API of only two functions, based on the YAML functions of the same name. Wherever possible, identical calling semantics are used. These may only be used with YAML sources. All error reporting is done with exceptions (die'ing). Note that META files are expected to be in UTF-8 encoding, only. When converted string data, it must first be decoded from UTF-8. =for Pod::Coverage HAVE_UTF8 IO_LAYER =head1 METHODS =head2 load_file my $metadata_structure = Parse::CPAN::Meta->load_file('META.json'); my $metadata_structure = Parse::CPAN::Meta->load_file('META.yml'); This method will read the named file and deserialize it to a data structure, determining whether it should be JSON or YAML based on the filename. On Perl 5.8.1 or later, the file will be read using the ":utf8" IO layer. =head2 load_yaml_string my $metadata_structure = Parse::CPAN::Meta->load_yaml_string($yaml_string); This method deserializes the given string of YAML and returns the first document in it. (CPAN metadata files should always have only one document.) If the source was UTF-8 encoded, the string must be decoded before calling C. =head2 load_json_string my $metadata_structure = Parse::CPAN::Meta->load_json_string($json_string); This method deserializes the given string of JSON and the result. If the source was UTF-8 encoded, the string must be decoded before calling C. =head2 yaml_backend my $backend = Parse::CPAN::Meta->yaml_backend; Returns the module name of the YAML serializer. See L for details. =head2 json_backend my $backend = Parse::CPAN::Meta->json_backend; Returns the module name of the JSON serializer. This will either be L or L. Even if C is set, this will return L as further delegation is handled by the L module. See L for details. =head1 FUNCTIONS For maintenance clarity, no functions are exported. These functions are available for backwards compatibility only and are best avoided in favor of C. =head2 Load my @yaml = Parse::CPAN::Meta::Load( $string ); Parses a string containing a valid YAML stream into a list of Perl data structures. =head2 LoadFile my @yaml = Parse::CPAN::Meta::LoadFile( 'META.yml' ); Reads the YAML stream from a file instead of a string. =head1 ENVIRONMENT =head2 PERL_JSON_BACKEND By default, L will be used for deserializing JSON data. If the C environment variable exists, is true and is not "JSON::PP", then the L module (version 2.5 or greater) will be loaded and used to interpret C. If L is not installed or is too old, an exception will be thrown. =head2 PERL_YAML_BACKEND By default, L will be used for deserializing YAML data. If the C environment variable is defined, then it is interpreted as a module to use for deserialization. The given module must be installed, must load correctly and must implement the C function or an exception will be thrown. =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at L. You will be notified automatically of any progress on your issue. =head2 Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. L git clone https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git =head1 AUTHORS =over 4 =item * Adam Kennedy =item * David Golden =back =head1 CONTRIBUTORS =over 4 =item * Joshua ben Jore =item * Neil Bowers =item * Ricardo Signes =item * Steffen Mueller =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Adam Kennedy and Contributors. 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