YAML-Tiny-1.70/000700 000766 000024 00000000000 13041072221 013355 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/Changes000600 000766 000024 00000034213 13041072221 014655 0ustar00etherstaff000000 000000 Revision history for YAML-Tiny 1.70 2017-01-22 08:59:54Z [FIXED] - Some errors writing to a file were incorrectly reported. 1.69 2015-07-26 00:51:03Z - No changes since 1.68-TRIAL. 1.68 2015-07-09 23:39:49Z (TRIAL RELEASE) [FIXED] - tests no longer print to stderr unnecessarily; this makes core perl builds (where this distribution is included as CPAN-Meta-YAML) a little quieter. [CHANGED] - the Test::More dependency has been reduced to 0.88 by emulating 'subtest' for those tests that need it 1.67 2015-05-12 00:10:24Z [FIXED] - instead of erroring on duplicate keys found in a hash (introduced in version 1.63), now we only warn. This fixes an issue in Strawberry Perl (via CPAN::Meta::YAML) when parsing a configuration file. [CHANGED] - Updated File::Temp test prereq to 0.19 for 'newdir' 1.66 2015-03-16 22:26:30Z [CHANGED] - removed bundled Test::TempDir::Tiny to rely on File::Temp for temporary directories during testing 1.65 2015-03-13 23:02:34Z [CHANGED] - artifacts left behind from testing are now cleaned up (GH#34) 1.64 2014-10-08 02:56:30Z [CHANGED] - remove silencing of any errors encountered while loading Scalar::Util (GH#33, Graham Knop) - now using JSON::MaybeXS in tests instead of JSON.pm 1.63 2014-06-11 21:58:18Z [FIXED] - incorrect error messages fixed, when $@ is clobbered when Carp wasn't loaded (GH#30, GH#31, Hilko Bengen) [CHANGED] - now checking for, and erroring on, duplicate keys found in a hash (GH#32, Hilko Bengen) 1.62 2014-03-16 12:28:44Z [FIXED] - fix handling of trailing colon in key name (RT#92916, H.Merijn Brand) 1.61 2014-02-24 16:59:49Z [FIXED] - fixed a test for VMS (RT#93297, Craig Berry) 1.60 2014-02-13 20:31:56Z - shipping 1.59 as stable, with no changes. 1.59 2014-02-06 03:10:35Z (TRIAL RELEASE) [CHANGED] - numeric values are now quoted whenever they've been used as a string (fixes inconsistent behaviour seen with numeric values, due to differences between the XS and pure-perl variants of Data::Dumper). (github issue #24) - numeric hash keys are now always quoted. 1.58 2014-02-04 18:01:58Z [INCOMPATIBLE CHANGE] - 1.57 omitted a change entry for the following change: - Previously, YAML::Tiny was sloppy about file encodings. It is now strict. The 'read' method and 'LoadFile' function expect UTF-8 encoded files. The 'write' method and 'DumpFile' function produce UTF-8 encoded files. The 'read_string' and 'write_string' methods and the 'Load' and 'Dump' functions expect or generate (decoded) character data. 1.57 2014-01-30 22:12:38Z [INCOMPATIBLE CHANGE] - Previously, some errors would throw exceptions and some would return the error condition in $YAML::Tiny::errstr. Now all errors throw exceptions. Use of $errstr and the errstr method are deprecated. (David Golden) [FIXED] - Fixed write method to encode YAML file with UTF-8 (David Golden) - Improved SYNOPSIS and documentation of new (David Golden) [TESTING] - Tests have been cleaned up and reorganized. Test coverage has been significnatly improved. (Ingy döt Net, David Golden, Jim Keenan, Karen Etheridge) 1.56 2013-09-25 02:38:19Z - read_string documentation error fixed (RT#74409, thanks Tim Heaney!) - re-release with fixed compile test 1.55 2013-09-19 04:07:32Z - again packaging with ExtUtils::MakeMaker 1.54 2013-08-22 03:55:41Z - convert to Dist::Zilla - Updated format to conform to CPAN::Changes::Spec 1.53 2013-08-20 - really fixed metadata 1.52 2013-08-20 - updated repository metadata to reflect move to github 1.51 2012-03-11 - The fix described in 1.48 was incorrect. Removing an additional if $@ to fix it properly. - Make the Scalar::Util version check resistant to bugs caused by development versions. 1.50 2011-06-23 - Major bug fix, all code that writes arbitrary data should upgrade. - Simple scalars with no whitespace but ending in a colon like ABC: were not being quoted, which results in the parser confusing it with a mapping key and crashing. 1.49 2011-03-08 - No functional changes. - Don't depend on the YAML modules in RELEASE_TESTING, as it can pollute the advisory META.yml. 1.48 2011-02-01 - Fix to the refaddr compatibility where Scalar::Util is installed but is older than 1.18. 1.47 2011-01-31 - No functional changes - Only depend on the YAML implementations when we are release testing 1.46 2010-12-16 - No functional changes - Moving to a production release now CPAN Testers is green again 1.45_02 2010-12-07 - Adding experimental support for exception->errstr conversion - Updating test suite yaml_error to not expect exceptions 1.45_01 2010-12-07 - Added support for trailing line comments (INGY) - Added checks for some characters that are illegal or reserved in plain scalars (INGY) - Minor cleaning up of some out of date POD (ADAMK) - Updated AUTOMATED_TESTING dependencies to new versions (ADAMK) 1.44 2010-08-08 - No functional changes, upgrading is not required - Minor tweaks to Makefile.PL - Minor cleanup around the refaddr emulation code 1.43 2010-07-10 - No functional changes, upgrading is not required - Don't import Carp 'croak' any more, saving a few K 1.42 2010-06-25 - No functional changes, upgrading is not required - Clarified documation to explain that YAML::Tiny escapes "bool" keywords when it writes them as strings so that YAML parsers in other languages won't get confused, but this does not mean that YAML::Tiny actually supports boolean types itself. - Added an extra test case for boolean keyword escaping. - YAML::Perl comparison tests were loading the file back in with YAML.pm by mistake. Corrected this and added an additional case that YAML::Perl doesn't support that I wasn't catching. - Author tests updated and moved into xt/ - Updated the versions of the other YAML parsers we test ourselves against to the most recent versions of each. 1.41 2009-12-11 - Fixes a performance bug reported by Apocalypse. Single line double-quoted strings longer than 32,000ish characters resulted in the regular expression engine crashing due to excessive recursion. Changed to a different regex that will most likely only crash after 32,000 ESCAPED characters. If I could use negative look-behind assertions (I can't because I need 5.004) this whole issue would be MUCH simpler to fix. 1.40 2009-07-31 - Dear Ruby Community. Thank you so much for your bug report to the "Ruby Talk" mailing list regarding the lack of true/false support in Perl YAML modules. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/169943 This flaw has now been resolved, around 2 hours after we were made aware of it. Next time, we recommend you report these bugs to the people who can actually fix your problem. 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 - Moving the test suite style closer to Parse::CPAN::Meta - Changed exceptions closer to Parse::CPAN::Meta - Fixed Changes file date for 1.37 :) 1.37 2009-05-16 - Call $self->_error instead of $class->_error when we can - Refactoring away some of the code other people have been contributing lately that most certainly NOT ::Tiny style. - Avoid the need to do '' escaping by moving it to "'" - Added comparative testing with YAML::Perl 1.36 2009-01-07 - Fixing missing feature reported by H.Merijn Brand 1.35 2008-12-17 - Production release for changes in 1.34_01 - No other changes 1.34_01 2008-11-19 - Improving sub-classability by passing the indent level through to the ->_write_scalar method. 1.33 2008-07-24 - Export Load and Dump functions by default. 1.32 2008-05-14 - Adding a test to check for correct exceptions - ONLY do comparative tests when the modules to compare to are current. (Prevents false failures in some cases) 1.31 2008-05-08 - Emergency bugfix release 1.30 2008-05-04 - Better error reporting of unsupported features - Heavily bump automated testing deps to remove false errors 1.29 2008-04-12 - CPAN Testers passes ok, moving to production version 1.28_01 2008-04-05 - Adding support for document terminators (To support YAML embedded in TAP streams) 1.27 2008-03-31 - Skip 04_scalar.t if no YAML.pm - Implement YAML compatibility + tests for LoadFile - Remove the LICENSE key from Makefile.PL (Which failed on some CPAN Testers setups) 1.26 2008-03-20 - Added extra test cases to validate RT bugs that were fixed previous, but not closed at the time. - Always quote when serialising anything that starts with a non-word - YAML::Tiny::Load is now fully compatible with YAML.pm in scalar context (returns the LAST parsed document). 1.25 2008-01-14 - Wrote the specification section 1.24_01 2008-01-11 - Adding additional test cases - Adding support for YAML header for META.yml - Adding support for YAML header for YAML 1.0 - Adding support for YAML header for YAML 1.1 1.23 2008-01-10 - Identical to 1.22_01 - CPAN Testers results positive, pushing to production version 1.22_01 2008-01-09 - Correcting handling of single quote escaping - Adding protection for infinite loops caused by circular references during serializing. - Confirmed support for toolbar.yml sample 1.21 2007-12-06 - Fixing support for unprintable characters 1.20 2007-11-19 - Correcting class name in @EXPORT_OK declaration (Demetrios Biskinis) 1.19 2007-11-16 - Removing the invalid perl dep 1.18 2007-11-05 - Adding a new test file 1.17 2007-11-01 - Updating from Module::Install to the tinier ExtUtils::MakeMaker 1.16 2007-10-22 - Updating to newer AUTOMATED_TESTING tests 1.15 2007-08-25 - Incremental release to include an updated version of 99_author.t - Replace a few CODE INCOMPLETE errors with real errors (those parts of the module are now complete) 1.14 2007-08-16 - Adding support for empty reference documents 1.13 2007-07-09 - Adding a test case for support of multi-byte characters 1.12 2007-06-05 - Adding support for open hash/array at EOF 1.11 2007-06-05 - Forgot to string trailing whitespace in a few cases - 'hashkey: This was mistaken as a hash entry, not a string' - Adding explicit tests from #yaml for single quote escaping 1.10 2007-06-05 - Adding support for null hash/arrays 1.09 2007-05-21 - Fixing a bug in the trivial scalar case 1.08 2007-05-16 - Adding support for |- trimming multiline scalars 1.07 2007-05-15 - Adding support for whitespace after document headers 1.06 2007-05-14 - Bug fix to support an additional variant of null hashes 1.05 2007-05-02 - Bug fix to allow support for keys with spaces - Bug fix to allow empty comments 1.04 2007-02-21 - Adding support for LoadFile, DumpFile, freeze and thaw 1.03 2007-01-14 - Removing the forward-looking part of the preamble 1.02 2007-01-14 - Fixing exporting 1.01 2007-01-14 - Removed the ugly bold warning 1.00 2007-01-14 - What the hell, I'm as close as is needed I think 0.90 2007-01-13 - Adding support for inline multi-lines 0.11 2006-09-25 - Fixed bug in regex that detects unheadered ARRAY|HASH 0.10 2006-08-24 - Added double-quote support, making YAML::Tiny a lot more usable - Added Load and Dump for YAML.pm compatibility - Added tests for verifying compatibility with YAML::Syck 0.06 2006-07-09 - Added more tests 0.05 2006-07-08 - Added support for nested inline hashes (parse only) - Added support for naked undef array and hash entries - Can now handle sample Plagger configs from Miyagawa-san's talk - Can now handle vanilla.yml from Perl::Dist::Vanilla 0.04 2006-07-08 - Added support for implicit document start for array/hash types - Added support for colons in hash keys - Added support for simple single quotes - Can now handle our own META.yml file 0.03 2006-07-08 - Got all of the trivial test cases to pass - Good enough for an initial usable release, but still expected to fail a lot 0.02 2006-04-26 - Added support for a single root-level hash - Correcting POD bugs 0.01 2006-04-26 - Initial version - Handles only document headers and non-wrapping scalar documents YAML-Tiny-1.70/CONTRIBUTING000644 000766 000024 00000007064 13041072221 015230 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficent for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/YAML-Tiny If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends YAML::Tiny Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm You should then also install any additional requirements not needed by the dzil build but may be needed by tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends YAML::Tiny Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is hosted at GitHub. The repository is: https://github.com/Perl-Toolchain-Gang/YAML-Tiny You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://rt.cpan.org/Public/Dist/Display.html?Name=YAML-Tiny or via email: bug-YAML-Tiny@rt.cpan.org There is also an irc channel available for users of this distribution, at irc://irc.perl.org/#yaml If you send me a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.013 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.121. YAML-Tiny-1.70/dist.ini000600 000766 000024 00000002126 13041072221 015024 0ustar00etherstaff000000 000000 name = YAML-Tiny author = Adam Kennedy copyright_holder = Adam Kennedy copyright_year = 2006 license = Perl_5 abstract = Read/Write YAML files with as little code as possible [PodVersion] ; version is determined from lib/YAML/Tiny.pm and is bumped automatically ; after each release [@Author::ETHER] :version = 0.119 installer = MakeMaker changes_version_columns = 8 -remove = PodWeaver AutoPrereqs.skip = ^YAML Authority.authority = cpan:ADAMK Test::MinimumVersion.max_target_perl = 5.008001 Keywords.keywords = YAML markup language serializer serialiser string data [Prereqs / DevelopRequires] YAML = 0.66 YAML::Syck = 1.05 YAML::XS = 0.29 [Prereqs::Soften] module = JSON::MaybeXS [Prereqs / TestRequires] File::Spec = 0.80 [MetaResources] x_IRC = irc://irc.perl.org/#yaml ; x_MailingList = ??? [Encoding / data] encoding = bytes matches = ^t/data/ matches = ^t/tml- matches = ^t/README\.md$ [OnlyCorePrereqs] :version = 0.008 check_dual_life_versions = 0 starting_version = 5.007003 ; when Scalar::Util was first cored YAML-Tiny-1.70/INSTALL000644 000766 000024 00000002156 13041072221 014424 0ustar00etherstaff000000 000000 This is the Perl distribution YAML-Tiny. Installing YAML-Tiny is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm YAML::Tiny If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan YAML::Tiny ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib ## Documentation YAML-Tiny documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc YAML::Tiny YAML-Tiny-1.70/lib/000700 000766 000024 00000000000 13041072221 014123 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/LICENSE000644 000766 000024 00000043655 13041072221 014411 0ustar00etherstaff000000 000000 This software is copyright (c) 2006 by Adam Kennedy. 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) 2006 by Adam Kennedy. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2006 by Adam Kennedy. 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 YAML-Tiny-1.70/Makefile.PL000644 000766 000024 00000003555 13041072221 015351 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; use 5.008001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Read/Write YAML files with as little code as possible", "AUTHOR" => "Adam Kennedy ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "YAML-Tiny", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008001", "NAME" => "YAML::Tiny", "PREREQ_PM" => { "B" => 0, "Carp" => 0, "Exporter" => 0, "Fcntl" => 0, "Scalar::Util" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Basename" => 0, "File::Find" => 0, "File::Spec" => "0.80", "File::Spec::Functions" => 0, "File::Temp" => "0.19", "Getopt::Long" => 0, "IO::Dir" => 0, "JSON::PP" => 0, "List::Util" => 0, "Test::More" => "0.88", "base" => 0, "lib" => 0, "utf8" => 0, "vars" => 0 }, "VERSION" => "1.70", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "B" => 0, "Carp" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "Fcntl" => 0, "File::Basename" => 0, "File::Find" => 0, "File::Spec" => "0.80", "File::Spec::Functions" => 0, "File::Temp" => "0.19", "Getopt::Long" => 0, "IO::Dir" => 0, "JSON::PP" => 0, "List::Util" => 0, "Scalar::Util" => 0, "Test::More" => "0.88", "base" => 0, "lib" => 0, "strict" => 0, "utf8" => 0, "vars" => 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); YAML-Tiny-1.70/MANIFEST000644 000766 000024 00000003634 13041072221 014526 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/YAML/Tiny.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/01_api.t t/01_compile.t t/10_read.t t/11_read_string.t t/12_write.t t/13_write_string.t t/20_subclass.t t/21_yamlpm_compat.t t/30_yaml_spec_tml.t t/31_local_tml.t t/32_world_tml.t t/86_fail.t t/README.md t/data/ascii.yml t/data/latin1.yml t/data/multibyte.yml t/data/utf_16_le_bom.yml t/data/utf_8_bom.yml t/lib/SubtestCompat.pm t/lib/TestBridge.pm t/lib/TestML/Tiny.pm t/lib/TestUtils.pm t/tml t/tml-local/dump-error/circular.tml t/tml-local/load-error/document.tml t/tml-local/load-error/scalar.tml t/tml-local/load-error/tag.tml t/tml-local/load-warning/document.tml t/tml-local/perl-to-yaml/quoting.tml t/tml-local/yaml-roundtrip/collection.tml t/tml-local/yaml-roundtrip/comment.tml t/tml-local/yaml-roundtrip/document.tml t/tml-local/yaml-roundtrip/mapping.tml t/tml-local/yaml-roundtrip/quoting.tml t/tml-local/yaml-roundtrip/scalar.tml t/tml-local/yaml-roundtrip/sequence.tml t/tml-spec/basic-data.tml t/tml-spec/unicode.tml t/tml-world/Acme-Time-Baby.tml t/tml-world/Data-Swap.tml t/tml-world/Games-Nintendo-Wii-Mii.tml t/tml-world/HTML-WebDAO.tml t/tml-world/ITS-SIN-FIDS-Content-XML.tml t/tml-world/Plagger.tml t/tml-world/Spreadsheet-Read.tml t/tml-world/Template-Provider-Unicode-Japanese.tml t/tml-world/Vanilla-Perl.tml t/tml-world/YAML-Tiny-META.tml t/tml-world/toolbar.tml t/tml-world/yaml_org.tml xt/author/00-compile.t xt/author/clean-namespaces.t xt/author/eol.t xt/author/kwalitee.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-no404s.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/compare/roundtrip.t xt/lib/Test.pm xt/release/changes_has_content.t xt/release/cpan-changes.t xt/release/distmeta.t xt/release/minimum-version.t YAML-Tiny-1.70/META.json000644 000766 000024 00000115241 13041072221 015014 0ustar00etherstaff000000 000000 { "abstract" : "Read/Write YAML files with as little code as possible", "author" : [ "Adam Kennedy " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010", "keywords" : [ "YAML", "markup", "language", "serializer", "serialiser", "string", "data" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "YAML-Tiny", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.008001" }, "suggests" : { "JSON::PP" : "2.27300" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.121" }, "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0.019", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::Encoding" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", "Dist::Zilla::Plugin::Git::Commit" : "2.020", "Dist::Zilla::Plugin::Git::Contributors" : "0.029", "Dist::Zilla::Plugin::Git::Describe" : "0.004", "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Remote::Check" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0.40", "Dist::Zilla::Plugin::GithubMeta" : "0.54", "Dist::Zilla::Plugin::InstallGuide" : "1.200005", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker" : "0", "Dist::Zilla::Plugin::Manifest" : "0", "Dist::Zilla::Plugin::MetaConfig" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::MetaNoIndex" : "0", "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", "Dist::Zilla::Plugin::MetaResources" : "0", "Dist::Zilla::Plugin::MetaTests" : "0", "Dist::Zilla::Plugin::MetaYAML" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "1.006", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::OnlyCorePrereqs" : "0.008", "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::PodVersion" : "0", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", "Dist::Zilla::Plugin::Prereqs::Soften" : "0", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.004", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.041", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.012", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::CleanNamespaces" : "0.006", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::EOL" : "0.17", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000003", "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.003", "Dist::Zilla::Plugin::Test::PodSpelling" : "2.006003", "Dist::Zilla::Plugin::Test::Portability" : "2.000007", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.022", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.119", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Software::License::Perl_5" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.99", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::No404s" : "0", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "YAML" : "0.66", "YAML::Syck" : "1.05", "YAML::XS" : "0.29", "blib" : "1.01", "lib" : "0" } }, "runtime" : { "requires" : { "B" : "0", "Carp" : "0", "Exporter" : "0", "Fcntl" : "0", "Scalar::Util" : "0", "perl" : "5.008001", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900", "JSON::MaybeXS" : "1.001000" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Basename" : "0", "File::Find" : "0", "File::Spec" : "0.80", "File::Spec::Functions" : "0", "File::Temp" : "0.19", "Getopt::Long" : "0", "IO::Dir" : "0", "JSON::PP" : "0", "List::Util" : "0", "Test::More" : "0.88", "base" : "0", "lib" : "0", "perl" : "5.008001", "utf8" : "0", "vars" : "0" } } }, "provides" : { "YAML::Tiny" : { "file" : "lib/YAML/Tiny.pm", "version" : "1.70" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-YAML-Tiny@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=YAML-Tiny" }, "homepage" : "https://github.com/Perl-Toolchain-Gang/YAML-Tiny", "repository" : { "type" : "git", "url" : "https://github.com/Perl-Toolchain-Gang/YAML-Tiny.git", "web" : "https://github.com/Perl-Toolchain-Gang/YAML-Tiny" }, "x_IRC" : "irc://irc.perl.org/#yaml" }, "version" : "1.70", "x_Dist_Zilla" : { "perl" : { "version" : "5.025009" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::PodVersion", "name" : "PodVersion", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/bundle_plugins", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/RewriteVersion::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.051" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.051" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "INSTALL", "LICENSE", "README.pod" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.007" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@Author::ETHER/InstallGuide", "version" : "1.200007" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 1, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles", "@Author::ETHER/Examples" ], "skips" : [], "switch" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.056" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", ":ExtraTestFiles" ] } }, "name" : "@Author::ETHER/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":ExtraTestFiles", ":InstallModules", ":TestFiles", "@Author::ETHER/Examples" ], "trailing_whitespace" : 1 } }, "name" : "@Author::ETHER/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000007" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "examples", "lib", "script", "t", "xt" ], "spell_cmd" : "", "stopwords" : [ "irc" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.007004" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.003" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/author/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.025" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@Author::ETHER/Test::Portability", "version" : "2.001000" }, { "class" : "Dist::Zilla::Plugin::Test::CleanNamespaces", "config" : { "Dist::Zilla::Plugin::Test::CleanNamespaces" : { "filename" : "xt/author/clean-namespaces.t", "skips" : [] } }, "name" : "@Author::ETHER/Test::CleanNamespaces", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.008" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002003", "inherit_missing" : 0, "inherit_version" : 0, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.004002" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [ "YAML", "markup", "language", "serializer", "serialiser", "string", "data" ] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle_version", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/MakeMaker", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git --version" : "2.10.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 1, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ] } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.043" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" ], "fatal_errors" : 0, "quiet" : 1 } }, "name" : "@Author::ETHER/.latest", "version" : "0.043" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.2.0" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "." ], "commit_msg" : "%N-%v%t%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENSE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/release snapshot", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v1.70", "tag_format" : "v%v", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/Git::Tag", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.43" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/BumpVersionAfterRelease::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/NextRelease", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/post-release commit", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git --version" : "2.10.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.041" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ] } }, "name" : "@Author::ETHER/install release", "version" : "0.043" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1 } }, "name" : "@Author::ETHER/release complete", "version" : "0.043" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs::Soften", "config" : { "Dist::Zilla::Plugin::Prereqs::Soften" : { "copy_to" : [], "modules" : [ "JSON::MaybeXS" ], "modules_from_features" : null, "to_relationship" : "recommends" } }, "name" : "Prereqs::Soften", "version" : "0.006002" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "data", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::OnlyCorePrereqs", "config" : { "Dist::Zilla::Plugin::OnlyCorePrereqs" : { "also_disallow" : [], "check_dual_life_versions" : "0", "deprecated_ok" : 0, "phases" : [ "configure", "build", "runtime", "test" ], "skips" : [], "starting_version" : "5.007003" } }, "name" : "OnlyCorePrereqs", "version" : "0.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.014" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.008" } }, "x_authority" : "cpan:ADAMK", "x_contributors" : [ "Karen Etheridge ", "David Golden ", "Ingy d\u00f6t Net ", "James E Keenan ", "Steffen M\u00fcller ", "Alexandr Ciornii ", "Graham Knop ", "Hilko Bengen ", "Neil Bowers ", "\u05d9\u05d5\u05d1\u05dc \u05e7\u05d5\u05d2'\u05de\u05df (Yuval Kogman) ", "Olivier Mengu\u00e9 ", "Slaven Rezic ", "David Golden ", "Tim Bunce ", "Craig A. Berry " ], "x_serialization_backend" : "Cpanel::JSON::XS version 3.0225" } YAML-Tiny-1.70/META.yml000644 000766 000024 00000053722 13041072221 014651 0ustar00etherstaff000000 000000 --- abstract: 'Read/Write YAML files with as little code as possible' author: - 'Adam Kennedy ' build_requires: ExtUtils::MakeMaker: '0' File::Basename: '0' File::Find: '0' File::Spec: '0.80' File::Spec::Functions: '0' File::Temp: '0.19' Getopt::Long: '0' IO::Dir: '0' JSON::PP: '0' List::Util: '0' Test::More: '0.88' base: '0' lib: '0' perl: '5.008001' utf8: '0' vars: '0' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.008001' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010' keywords: - YAML - markup - language - serializer - serialiser - string - data license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: YAML-Tiny no_index: directory: - t - xt provides: YAML::Tiny: file: lib/YAML/Tiny.pm version: '1.70' requires: B: '0' Carp: '0' Exporter: '0' Fcntl: '0' Scalar::Util: '0' perl: '5.008001' strict: '0' warnings: '0' resources: IRC: irc://irc.perl.org/#yaml bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=YAML-Tiny homepage: https://github.com/Perl-Toolchain-Gang/YAML-Tiny repository: https://github.com/Perl-Toolchain-Gang/YAML-Tiny.git version: '1.70' x_Dist_Zilla: perl: version: '5.025009' plugins: - class: Dist::Zilla::Plugin::PodVersion name: PodVersion version: '6.008' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/bundle_plugins' version: '6.008' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/RewriteVersion::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, build' version: '0.051' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, release' version: '0.051' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '6.008' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - INSTALL - LICENSE - README.pod exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::ETHER/Git::GatherDir' version: '2.041' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '6.008' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '6.008' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '6.008' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '6.008' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '6.008' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.007' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.013' - class: Dist::Zilla::Plugin::InstallGuide name: '@Author::ETHER/InstallGuide' version: '1.200007' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '1' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' - '@Author::ETHER/Examples' skips: [] switch: [] name: '@Author::ETHER/Test::Compile' version: '2.056' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - ':ExtraTestFiles' name: '@Author::ETHER/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':ExtraTestFiles' - ':InstallModules' - ':TestFiles' - '@Author::ETHER/Examples' trailing_whitespace: 1 name: '@Author::ETHER/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '6.008' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.010' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@Author::ETHER/Test::MinimumVersion' version: '2.000007' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '6.008' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: '6.008' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - examples - lib - script - t - xt spell_cmd: '' stopwords: - irc wordlist: Pod::Wordlist name: '@Author::ETHER/Test::PodSpelling' version: '2.007004' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.003' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/author/kwalitee.t skiptest: [] name: '@Author::ETHER/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: '0.025' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::ETHER/Test::Portability' version: '2.001000' - class: Dist::Zilla::Plugin::Test::CleanNamespaces config: Dist::Zilla::Plugin::Test::CleanNamespaces: filename: xt/author/clean-namespaces.t skips: [] name: '@Author::ETHER/Test::CleanNamespaces' version: '0.006' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: '0.007' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.54' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '6.008' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.008' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002003' inherit_missing: '0' inherit_version: '0' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@Author::ETHER/MetaProvides::Package' version: '2.004002' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '6.008' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: - YAML - markup - language - serializer - serialiser - string - data name: '@Author::ETHER/Keywords' version: '0.007' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '6.008' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.006' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle_version' version: '6.008' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/MakeMaker' version: '6.008' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: 'git --version': 2.10.0 include_authors: 0 include_releaser: 1 order_by: commits paths: [] name: '@Author::ETHER/Git::Contributors' version: '0.029' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 1 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.010' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" name: '@Author::ETHER/.ackrc' version: '0.043' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" fatal_errors: 0 quiet: 1 name: '@Author::ETHER/.latest' version: '0.043' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . name: '@Author::ETHER/initial check' version: '2.041' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.014' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.2.0 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '6.008' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . name: '@Author::ETHER/after tests' version: '2.041' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.010' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '6.008' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - Changes - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - . commit_msg: '%N-%v%t%n%n%c' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING - Changes - INSTALL - LICENSE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/release snapshot' version: '2.041' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v1.70 tag_format: v%v tag_message: v%v%t Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/Git::Tag' version: '2.041' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.43' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/BumpVersionAfterRelease::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/NextRelease' version: '6.008' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/post-release commit' version: '2.041' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: 'git --version': 2.10.0 repo_root: . name: '@Author::ETHER/Git::Push' version: '2.041' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED name: '@Author::ETHER/install release' version: '0.043' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 name: '@Author::ETHER/release complete' version: '0.043' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '6.008' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '6.008' - class: Dist::Zilla::Plugin::Prereqs::Soften config: Dist::Zilla::Plugin::Prereqs::Soften: copy_to: [] modules: - JSON::MaybeXS modules_from_features: ~ to_relationship: recommends name: Prereqs::Soften version: '0.006002' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.008' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '6.008' - class: Dist::Zilla::Plugin::Encoding name: data version: '6.008' - class: Dist::Zilla::Plugin::OnlyCorePrereqs config: Dist::Zilla::Plugin::OnlyCorePrereqs: also_disallow: [] check_dual_life_versions: '0' deprecated_ok: '0' phases: - configure - build - runtime - test skips: [] starting_version: '5.007003' name: OnlyCorePrereqs version: '0.024' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.008' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.014' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.008' x_authority: cpan:ADAMK x_contributors: - 'Karen Etheridge ' - 'David Golden ' - 'Ingy döt Net ' - 'James E Keenan ' - 'Steffen Müller ' - 'Alexandr Ciornii ' - 'Graham Knop ' - 'Hilko Bengen ' - 'Neil Bowers ' - "יובל קוג'מן (Yuval Kogman) " - 'Olivier Mengué ' - 'Slaven Rezic ' - 'David Golden ' - 'Tim Bunce ' - 'Craig A. Berry ' x_serialization_backend: 'YAML::Tiny version 1.69' YAML-Tiny-1.70/README000644 000766 000024 00000000602 13041072221 014245 0ustar00etherstaff000000 000000 This archive contains the distribution YAML-Tiny, version 1.70: Read/Write YAML files with as little code as possible This software is copyright (c) 2006 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.008. YAML-Tiny-1.70/t/000700 000766 000024 00000000000 13041072221 013620 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/000700 000766 000024 00000000000 13041072221 014010 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/author/000700 000766 000024 00000000000 13041072221 015312 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/compare/000700 000766 000024 00000000000 13041072221 015436 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/lib/000700 000766 000024 00000000000 13041072221 014556 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/release/000700 000766 000024 00000000000 13041072221 015430 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/xt/release/changes_has_content.t000644 000766 000024 00000002010 13041072221 021615 0ustar00etherstaff000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '1.70'; 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; } YAML-Tiny-1.70/xt/release/cpan-changes.t000644 000766 000024 00000000344 13041072221 020157 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; YAML-Tiny-1.70/xt/release/distmeta.t000644 000766 000024 00000000172 13041072221 017441 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); YAML-Tiny-1.70/xt/release/minimum-version.t000644 000766 000024 00000000271 13041072221 020765 0ustar00etherstaff000000 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.008001} ); YAML-Tiny-1.70/xt/lib/Test.pm000600 000766 000024 00000001376 13041072221 016044 0ustar00etherstaff000000 000000 package xt::lib::Test; use strict; use warnings; use Exporter (); our @ISA = qw{ Exporter }; our @EXPORT = qw{ have_yamlpm have_yamlsyck have_yamlxs }; # Do we have the authorative YAML to test against my $HAVE_YAMLPM = !! eval { require YAML; # This doesn't currently work, but is documented to. # So if it ever turns up, use it. $YAML::UseVersion = 1; YAML->VERSION('0.66'); }; sub have_yamlpm { $HAVE_YAMLPM } # Do we have YAML::Syck to test against? my $HAVE_SYCK = !! eval { require YAML::Syck; YAML::Syck->VERSION('1.05') }; sub have_yamlsyck { $HAVE_SYCK } # Do we have YAML::XS to test against? my $HAVE_XS = !! eval { require YAML::XS; YAML::XS->VERSION('0.29') }; sub have_yamlxs{ $HAVE_XS } 1; YAML-Tiny-1.70/xt/compare/roundtrip.t000600 000766 000024 00000006324 13041072221 017660 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.99; use TestBridge; use xt::lib::Test; use YAML::Tiny; my $local_dir = "t/tml-local/yaml-roundtrip"; my $world_dir = "t/tml-world"; my @parsers = ( (have_yamlpm() ? "YAML" : () ), (have_yamlxs() ? "YAML::XS" : () ), (have_yamlsyck() ? "YAML::Syck" : () ), ); plan skip_all => "No other YAML parsers installed for comparison" unless @parsers; my %skip_map = ( 'YAML' => 'noyamlpm', 'YAML::XS' => 'noxs', 'YAML::Syck' => 'nosyck', ); my %loader_for = do { no strict 'refs'; map {; $_ => *{$_ . "::Load"}{CODE} } "YAML::Tiny", @parsers; }; my %dumper_for = do { no strict 'refs'; map {; $_ => *{$_ . "::Dump"}{CODE} } "YAML::Tiny", @parsers; }; for my $dir ( $local_dir, $world_dir ) { run_all_testml_files( "TestML", $dir, \&compare_roundtrip ); } #--------------------------------------------------------------------------# # compare_roundtrip # # two blocks: perl, yaml # # We compare behaviors for multiple parsers # # Tests that a YAML string loads to the expected perl data. Also, tests # roundtripping from perl->YAML->perl. # # We can't compare the YAML for roundtripping because YAML::Tiny doesn't # preserve order and comments. Therefore, all we can test is that given input # YAML we can produce output YAML that produces the same Perl data as the # input. # # The perl must be an array reference of data to serialize: # # [ $thing1, $thing2, ... ] # # However, if a test point called 'serializes' exists, the output YAML is # expected to match the input YAML and will be checked for equality. #--------------------------------------------------------------------------# sub compare_roundtrip { my ($block) = @_; my ($yaml, $perl, $label) = _testml_has_points($block, qw(yaml perl)) or return; my %options = (); for (qw(serializes noxs nosyck noyamlpm)) { if (defined($block->{$_})) { $options{$_} = 1; } } my $expected = eval $perl; die $@ if $@; subtest $label, sub { my %perl_from; subtest "YAML to Perl" => sub { for my $p ( 'YAML::Tiny', @parsers ) { subtest $p => sub { plan skip_all => "Not supported by $p" if $p ne 'YAML::Tiny' && $options{$skip_map{$p}}; my $yaml_copy = $yaml; ok( $perl_from{$p} = [ eval { $loader_for{$p}->($yaml_copy) } ], "Load with $p" ) or diag "ERROR: " . _error_for($p); return if $p eq 'YAML::Tiny'; # don't compare vs self cmp_deeply( $perl_from{"YAML::Tiny"}, $perl_from{$p}, "YAML::Tiny should match $p" ) or diag "\nYAML:\n$yaml"; } } }; }; } #--------------------------------------------------------------------------# # _error_for -- normalize error handling #--------------------------------------------------------------------------# sub _error_for { my $p = shift; return $p eq 'YAML::Tiny' ? YAML::Tiny->errstr : $@; } done_testing; YAML-Tiny-1.70/xt/author/00-compile.t000644 000766 000024 00000002541 13041072221 017360 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More 0.94; plan tests => 2; my @module_files = ( 'YAML/Tiny.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain(\@warnings); BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; YAML-Tiny-1.70/xt/author/clean-namespaces.t000644 000766 000024 00000000361 13041072221 020710 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CleanNamespaces 0.006 use Test::More 0.94; use Test::CleanNamespaces 0.15; subtest all_namespaces_clean => sub { all_namespaces_clean() }; done_testing; YAML-Tiny-1.70/xt/author/eol.t000644 000766 000024 00000002310 13041072221 016264 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/YAML/Tiny.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01_api.t', 't/01_compile.t', 't/10_read.t', 't/11_read_string.t', 't/12_write.t', 't/13_write_string.t', 't/20_subclass.t', 't/21_yamlpm_compat.t', 't/30_yaml_spec_tml.t', 't/31_local_tml.t', 't/32_world_tml.t', 't/86_fail.t', 't/lib/SubtestCompat.pm', 't/lib/TestBridge.pm', 't/lib/TestML/Tiny.pm', 't/lib/TestUtils.pm', 't/tml', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/compare/roundtrip.t', 'xt/lib/Test.pm', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/minimum-version.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; YAML-Tiny-1.70/xt/author/kwalitee.t000644 000766 000024 00000000275 13041072221 017322 0ustar00etherstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; YAML-Tiny-1.70/xt/author/mojibake.t000644 000766 000024 00000000151 13041072221 017267 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); YAML-Tiny-1.70/xt/author/no-tabs.t000644 000766 000024 00000002256 13041072221 017061 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/YAML/Tiny.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01_api.t', 't/01_compile.t', 't/10_read.t', 't/11_read_string.t', 't/12_write.t', 't/13_write_string.t', 't/20_subclass.t', 't/21_yamlpm_compat.t', 't/30_yaml_spec_tml.t', 't/31_local_tml.t', 't/32_world_tml.t', 't/86_fail.t', 't/lib/SubtestCompat.pm', 't/lib/TestBridge.pm', 't/lib/TestML/Tiny.pm', 't/lib/TestUtils.pm', 't/tml', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/compare/roundtrip.t', 'xt/lib/Test.pm', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/minimum-version.t' ); notabs_ok($_) foreach @files; done_testing; YAML-Tiny-1.70/xt/author/pod-coverage.t000644 000766 000024 00000000334 13041072221 020064 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); YAML-Tiny-1.70/xt/author/pod-no404s.t000644 000766 000024 00000000527 13041072221 017324 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_NO404S AUTOMATED_TESTING ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::No404s"; if ( $@ ) { plan skip_all => 'Test::Pod::No404s required for testing POD'; } else { all_pod_files_ok(); } YAML-Tiny-1.70/xt/author/pod-spell.t000644 000766 000024 00000001117 13041072221 017410 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007004 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( examples lib script t xt ) ); __DATA__ Adam Alexandr Bengen Berry Bowers Bunce Ciornii Craig David Etheridge Golden Graham Hilko Ingy James Karen Keenan Kennedy Knop Kogman Mengué Müller Neil Net Olivier Rezic Slaven Steffen Tim Tiny YAML Yuval adamk bengen chorny craigberry dagolden dolmen döt ether haarg ingy irc jkeenan lib neil nothingmuch slaven smueller xdg יובל קוג YAML-Tiny-1.70/xt/author/pod-syntax.t000644 000766 000024 00000000252 13041072221 017616 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); YAML-Tiny-1.70/xt/author/portability.t000644 000766 000024 00000000267 13041072221 020060 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); YAML-Tiny-1.70/t/00-report-prereqs.dd000644 000766 000024 00000024036 13041072221 017357 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'perl' => '5.008001' }, 'suggests' => { 'JSON::PP' => '2.27300' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.121' }, 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '1.009', 'Dist::Zilla::Plugin::AutoMetaResources' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '5.038', 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', 'Dist::Zilla::Plugin::CheckIssues' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0.019', 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', 'Dist::Zilla::Plugin::Encoding' => '0', 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', 'Dist::Zilla::Plugin::GenerateFile::FromShareDir' => '0', 'Dist::Zilla::Plugin::Git::Check' => '0', 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0.004', 'Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts' => '0', 'Dist::Zilla::Plugin::Git::Commit' => '2.020', 'Dist::Zilla::Plugin::Git::Contributors' => '0.029', 'Dist::Zilla::Plugin::Git::Describe' => '0.004', 'Dist::Zilla::Plugin::Git::GatherDir' => '2.016', 'Dist::Zilla::Plugin::Git::Push' => '0', 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', 'Dist::Zilla::Plugin::Git::Tag' => '0', 'Dist::Zilla::Plugin::GitHub::Update' => '0.40', 'Dist::Zilla::Plugin::GithubMeta' => '0.54', 'Dist::Zilla::Plugin::InstallGuide' => '1.200005', 'Dist::Zilla::Plugin::Keywords' => '0.004', 'Dist::Zilla::Plugin::License' => '5.038', 'Dist::Zilla::Plugin::MakeMaker' => '0', 'Dist::Zilla::Plugin::Manifest' => '0', 'Dist::Zilla::Plugin::MetaConfig' => '0', 'Dist::Zilla::Plugin::MetaJSON' => '0', 'Dist::Zilla::Plugin::MetaNoIndex' => '0', 'Dist::Zilla::Plugin::MetaProvides::Package' => '1.15000002', 'Dist::Zilla::Plugin::MetaResources' => '0', 'Dist::Zilla::Plugin::MetaTests' => '0', 'Dist::Zilla::Plugin::MetaYAML' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '1.006', 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', 'Dist::Zilla::Plugin::NextRelease' => '5.033', 'Dist::Zilla::Plugin::OnlyCorePrereqs' => '0.008', 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', 'Dist::Zilla::Plugin::PodVersion' => '0', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0.006', 'Dist::Zilla::Plugin::Prereqs::Soften' => '0', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::Readme' => '0', 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.004', 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.041', 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', 'Dist::Zilla::Plugin::StaticInstall' => '0.005', 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.012', 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', 'Dist::Zilla::Plugin::Test::CleanNamespaces' => '0.006', 'Dist::Zilla::Plugin::Test::Compile' => '2.039', 'Dist::Zilla::Plugin::Test::EOL' => '0.17', 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.10', 'Dist::Zilla::Plugin::Test::MinimumVersion' => '2.000003', 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.003', 'Dist::Zilla::Plugin::Test::PodSpelling' => '2.006003', 'Dist::Zilla::Plugin::Test::Portability' => '2.000007', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.022', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.119', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Software::License::Perl_5' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CleanNamespaces' => '0.15', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.99', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::No404s' => '0', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'YAML' => '0.66', 'YAML::Syck' => '1.05', 'YAML::XS' => '0.29', 'blib' => '1.01', 'lib' => '0' } }, 'runtime' => { 'requires' => { 'B' => '0', 'Carp' => '0', 'Exporter' => '0', 'Fcntl' => '0', 'Scalar::Util' => '0', 'perl' => '5.008001', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900', 'JSON::MaybeXS' => '1.001000' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Basename' => '0', 'File::Find' => '0', 'File::Spec' => '0.80', 'File::Spec::Functions' => '0', 'File::Temp' => '0.19', 'Getopt::Long' => '0', 'IO::Dir' => '0', 'JSON::PP' => '0', 'List::Util' => '0', 'Test::More' => '0.88', 'base' => '0', 'lib' => '0', 'perl' => '5.008001', 'utf8' => '0', 'vars' => '0' } } }; $x; }YAML-Tiny-1.70/t/00-report-prereqs.t000644 000766 000024 00000013003 13041072221 017223 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.025 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( JSON::PP Pod::Coverage Sub::Name YAML autodie ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do 't/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: YAML-Tiny-1.70/t/01_api.t000600 000766 000024 00000003007 13041072221 015060 0ustar00etherstaff000000 000000 # Testing of some API methods; use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use SubtestCompat; use TestBridge; use YAML::Tiny; subtest "default exports" => sub { ok( defined(&Load), 'Found exported Load function' ); ok( defined(&Dump), 'Found exported Dump function' ); ok( \&main::Load == \&YAML::Tiny::Load, 'Load is YAML::Tiny' ); ok( \&main::Dump == \&YAML::Tiny::Dump, 'Dump is YAML::Tiny' ); ok( !defined(&LoadFile), 'LoadFile function not exported' ); ok( !defined(&DumpFile), 'DumpFile function not exported' ); ok( !defined(&freeze), 'freeze function not exported' ); ok( !defined(&thaw), 'thaw functiona not exported' ); }; subtest "all exports" => sub { package main::all_exports; use Test::More 0.88; use YAML::Tiny qw/Load Dump LoadFile DumpFile freeze thaw/; ok( defined(&Load), 'Found exported Load function' ); ok( defined(&Dump), 'Found exported Dump function' ); ok( defined(&LoadFile), 'Found exported LoadFile function' ); ok( defined(&DumpFile), 'Found exported DumpFile function' ); ok( defined(&freeze), 'Found exported freeze function' ); ok( defined(&thaw), 'Found exported thaw functiona' ); }; subtest "constructor and documents" => sub { my @docs = ( { one => 'two' }, { three => 'four' } ); ok( my $yaml = YAML::Tiny->new( @docs ), "constructor" ); cmp_deeply( [ @$yaml ], \@docs, "the object is an arrayref of documents" ); }; done_testing; YAML-Tiny-1.70/t/01_compile.t000600 000766 000024 00000000541 13041072221 015737 0ustar00etherstaff000000 000000 # Load testing for YAML::Tiny use strict; use warnings; use lib 't/lib'; BEGIN { $| = 1; } use Test::More 0.88; # Check their perl version ok( "$]" ge '5.008001', "Your perl is new enough" ); # Does the module load require_ok( 'YAML::Tiny' ); require_ok( 'TestUtils' ); require_ok( 'TestBridge' ); require_ok( 'TestML::Tiny' ); done_testing; YAML-Tiny-1.70/t/10_read.t000600 000766 000024 00000006133 13041072221 015225 0ustar00etherstaff000000 000000 use strict; use warnings; use utf8; use lib 't/lib/'; use Test::More 0.88; use SubtestCompat; use TestUtils; use TestBridge; use YAML::Tiny; #--------------------------------------------------------------------------# # read() should read these files without error #--------------------------------------------------------------------------# my %passes = ( array => { file => 'ascii.yml', perl => [ [ 'foo' ] ], }, 'multibyte UTF-8' => { file => 'multibyte.yml', perl => [ { author => 'Ævar Arnfjörð Bjarmason ' } ], utf8 => 'author', }, 'UTF-8 BOM' => { file => 'utf_8_bom.yml', perl => [ { author => 'Ævar Arnfjörð Bjarmason ' } ], utf8 => 'author', }, ); for my $key ( sort keys %passes ) { subtest $key => sub { my $case = $passes{$key}; my $file = test_data_file( $case->{file} ); ok( -f $file, "Found $case->{file}" ); my $got = eval { YAML::Tiny->read( $file ) }; is( $@, '', "YAML::Tiny reads without exception" ); SKIP: { skip( "Shortcutting after failure", 2 ) if $@; isa_ok( $got, 'YAML::Tiny' ) or diag "ERROR: " . YAML::Tiny->errstr; cmp_deeply( $got, $case->{perl}, "YAML::Tiny parses correctly" ); } if ( $case->{utf8} ) { ok( utf8::is_utf8( $got->[0]->{$case->{utf8}} ), "utf8 decoded" ); } # test that read method on object is also a constructor ok( my $got2 = eval { $got->read( $file ) }, "read() object method"); isnt( $got, $got2, "objects are different" ); cmp_deeply( $got, $got2, "objects have same content" ); } } #--------------------------------------------------------------------------# # read() should fail to read these files and provide expected errors #--------------------------------------------------------------------------# my %errors = ( 'latin1.yml' => qr/latin1\.yml.*does not map to Unicode/, 'utf_16_le_bom.yml' => qr/utf_16_le_bom\.yml.*does not map to Unicode/, ); for my $key ( sort keys %errors ) { subtest $key => sub { my $file = test_data_file( $key ); ok( -f $file, "Found $key" ); my $result = eval { YAML::Tiny->read( $file ) }; ok( !$result, "returned false" ); error_like( $errors{$key}, "Got expected error" ); }; } # Additional errors without a file to read subtest "bad read arguments" => sub { eval { YAML::Tiny->read(); }; error_like(qr/You did not specify a file name/, "Got expected error: no filename provided to read()" ); eval { YAML::Tiny->read( test_data_file('nonexistent.yml') ); }; error_like(qr/File '.*?' does not exist/, "Got expected error: nonexistent filename provided to read()" ); eval { YAML::Tiny->read( test_data_directory() ); }; error_like(qr/'.*?' is a directory, not a file/, "Got expected error: directory provided to read()" ); }; done_testing; # COPYRIGHT # vim: ts=4 sts=4 sw=4 et: YAML-Tiny-1.70/t/11_read_string.t000600 000766 000024 00000003177 13041072221 016621 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use SubtestCompat; use TestUtils; use TestBridge; use YAML::Tiny (); #--------------------------------------------------------------------------# # Generally, read_string can be tested with .tml files in t/tml-local/* # # This file is for error tests that can't be easily tested via .tml #--------------------------------------------------------------------------# subtest 'read_string without arg' => sub { eval { YAML::Tiny->read_string(); }; error_like(qr/Did not provide a string to load/, "Got expected error: no string provided to read_string()" ); }; subtest 'YAML without newline' => sub { my $str = join("\n" => ('---', '- foo', '---', '- bar', '---')); my $obj = eval { YAML::Tiny->read_string($str); }; is( $@, '', "YAML without newline is OK"); }; subtest 'read_string as object method' => sub { ok( my $obj = YAML::Tiny->new( { foo => 'bar' } ), "new YAML object" ); ok( my $obj2 = $obj->read_string( "---\nfoo: bar\n" ), "read_string object method" ); isnt( $obj, $obj2, "objects are different" ); cmp_deeply( $obj, $obj2, "objects have same content" ); }; subtest 'invalid UTF-8' => sub { # get invalid UTF-8 by reading Latin-1 with lax :utf8 layer my $string = do { local $SIG{__WARN__} = sub {}; slurp( test_data_file('latin1.yml'), ":utf8" ); }; my $obj = eval { YAML::Tiny->read_string($string); }; is( $obj, undef, "read_string should return undef" ); error_like( qr/invalid UTF-8 string/, "Got expected error about invalid UTF-8 string" ); }; done_testing; YAML-Tiny-1.70/t/12_write.t000600 000766 000024 00000005317 13041072221 015451 0ustar00etherstaff000000 000000 use utf8; use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use SubtestCompat; use TestBridge; use TestUtils; use YAML::Tiny; use File::Basename qw/basename/; use File::Spec::Functions 'catfile'; use File::Temp 0.19; # newdir #--------------------------------------------------------------------------# # Error conditions #--------------------------------------------------------------------------# subtest 'no filename for write()' => sub { my $obj = YAML::Tiny->new(); eval { $obj->write(); }; error_like( qr/You did not specify a file name/, "No filename provided to write()" ); }; #--------------------------------------------------------------------------# # Test that write uses correct encoding and can round-trip #--------------------------------------------------------------------------# my @cases = ( { label => "ascii", name => "Mengue" }, { label => "latin1", name => "Mengué" }, { label => "wide", name => "あ" }, ); my @warnings; local $SIG{__WARN__} = sub { push @warnings, $_[0] }; # YAML::Tiny doesn't preserve order in the file, so we can't actually check # file equivalence. We have to see if we can round-trip a data structure # from Perl to YAML and back. for my $c ( @cases ) { subtest "write $c->{label} characters" => sub { my $data; @warnings = (); # get a tempfile name to write to my $tempdir = File::Temp->newdir("YTXXXXXX", TMPDIR => 1 ); my $short_tempfile = 'output'; my $tempfile = catfile($tempdir, $short_tempfile); # YAML::Tiny->write ok( YAML::Tiny->new($c)->write($tempfile), "case $c->{label}: write $short_tempfile" ) or diag "ERROR: " . YAML::Tiny->errstr; # YAML::Tiny->read ok( $data = eval { YAML::Tiny->read( $tempfile ) }, "case $c->{label}: read $short_tempfile" ) or diag "ERROR: " . YAML::Tiny->errstr; is( $@, '', "no error caught" ); SKIP : { skip "no data read", 1 unless $data; cmp_deeply( $data, [ $c ], "case $c->{label}: Perl -> File -> Perl roundtrip" ); } # YAML::Tiny->read_string on UTF-8 decoded data ok( $data = eval { YAML::Tiny->read_string( slurp($tempfile, ":utf8") ) }, "case $c->{label}: read_string on UTF-8 decoded $short_tempfile" ); is( $@, '', "no error caught" ); SKIP : { skip "no data read", 1 unless $data; cmp_deeply( $data, [ $c ], "case $c->{label}: Perl -> File -> Decoded -> Perl roundtrip" ); } is( scalar @warnings, 0, "case $c->{label}: no warnings caught" ) or diag @warnings; } } done_testing; YAML-Tiny-1.70/t/13_write_string.t000600 000766 000024 00000001211 13041072221 017025 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use SubtestCompat; use TestUtils; use TestBridge; use YAML::Tiny (); #--------------------------------------------------------------------------# # Generally, write_string can be tested with .tml files in t/tml-local/* # # This file is for error tests or conditions that can't be easily tested # via .tml #--------------------------------------------------------------------------# subtest 'write_string as class method' => sub { my $got = eval { YAML::Tiny->write_string }; is( $@, '', "write_string lives" ); is( $got, '', "returns empty string" ); }; done_testing; YAML-Tiny-1.70/t/20_subclass.t000600 000766 000024 00000001741 13041072221 016132 0ustar00etherstaff000000 000000 # Testing documents that should fail use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use TestUtils; use File::Spec::Functions ':ALL'; ##################################################################### # Customized Class SCOPE: { package Foo; use YAML::Tiny; use vars qw{@ISA}; BEGIN { @ISA = 'YAML::Tiny'; } # XXX-INGY subclasses should not use private methods… or if they # do they should expect method name changes. # sub _write_scalar { sub _dump_scalar { my $self = shift; my $string = shift; my $is_key = shift; if ( defined $is_key ) { return scalar reverse $string; } else { return $string; } } 1; } ##################################################################### # Generate the value my $object = Foo->new( { foo => 'bar' } ); is( $object->write_string, "---\noof: bar\n", 'Subclassing works' ); done_testing; YAML-Tiny-1.70/t/21_yamlpm_compat.t000600 000766 000024 00000003263 13041072221 017157 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use TestBridge; use File::Spec::Functions 'catfile'; use File::Temp 0.19; # newdir #--------------------------------------------------------------------------# # This file test that the YAML.pm compatible Dump/Load/DumpFile/LoadFile # work as documented #--------------------------------------------------------------------------# use YAML::Tiny; { my $scalar = 'this is a string'; my $arrayref = [ 1 .. 5 ]; my $hashref = { alpha => 'beta', gamma => 'delta' }; my $yamldump = YAML::Tiny::Dump( $scalar, $arrayref, $hashref ); my @yamldocsloaded = YAML::Tiny::Load($yamldump); cmp_deeply( [ @yamldocsloaded ], [ $scalar, $arrayref, $hashref ], "Functional interface: Dump to Load roundtrip works as expected" ); } { my $scalar = 'this is a string'; my $arrayref = [ 1 .. 5 ]; my $hashref = { alpha => 'beta', gamma => 'delta' }; my $tempdir = File::Temp->newdir("YTXXXXXX", TMPDIR => 1 ); my $filename = catfile($tempdir, 'compat'); my $rv = YAML::Tiny::DumpFile( $filename, $scalar, $arrayref, $hashref); ok($rv, "DumpFile returned true value"); my @yamldocsloaded = YAML::Tiny::LoadFile($filename); cmp_deeply( [ @yamldocsloaded ], [ $scalar, $arrayref, $hashref ], "Functional interface: DumpFile to LoadFile roundtrip works as expected" ); } { my $str = "This is not real YAML"; my @yamldocsloaded; eval { @yamldocsloaded = YAML::Tiny::Load("$str\n"); }; error_like( qr/YAML::Tiny failed to classify line '$str'/, "Correctly failed to load non-YAML string" ); } done_testing; YAML-Tiny-1.70/t/30_yaml_spec_tml.t000600 000766 000024 00000001772 13041072221 017150 0ustar00etherstaff000000 000000 # Run the appropriate tests from https://github.com/ingydotnet/yaml-spec-tml use strict; use warnings; use lib 't/lib'; use Test::More 0.88; use SubtestCompat; use TestBridge; use TestUtils; my $JSON = json_class() or Test::More::plan skip_all => 'no JSON backends available!?'; diag 'using JSON backend: ' . $JSON . ' ' . $JSON->VERSION if not $ENV{PERL_CORE}; # Each spec test will need a different bridge and arguments: my @spec_tests = ( ['t/tml-spec/basic-data.tml', 'test_yaml_json', $JSON], # This test is currently failing massively. We use LAST to only run what is # covered so far. ['t/tml-spec/unicode.tml', 'test_code_point'], # uses JSON::PP ); for my $test (@spec_tests) { my ($file, $bridge, @args) = @$test; my $code = sub { my ($file, $blocks) = @_; subtest "YAML Spec Test; file: $file" => sub { my $func = \&{$bridge}; $func->($_) for @$blocks; }; }; run_testml_file($file, $code, @args); } done_testing; YAML-Tiny-1.70/t/31_local_tml.t000600 000766 000024 00000000742 13041072221 016263 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use TestBridge; use IO::Dir; use File::Spec::Functions qw/catdir/; my $tml_local = "t/tml-local"; for my $dir ( IO::Dir->new($tml_local)->read ) { next if $dir =~ /^\./; my $fn = "test_$dir"; $fn =~ s/-/_/g; $fn =~ s/\.DIR\z//i if $^O eq 'VMS'; my $bridge = TestBridge->can($fn); next unless $bridge; run_all_testml_files( "TestML", catdir($tml_local, $dir), $bridge ); } done_testing; YAML-Tiny-1.70/t/32_world_tml.t000600 000766 000024 00000000272 13041072221 016317 0ustar00etherstaff000000 000000 use strict; use warnings; use lib 't/lib/'; use Test::More 0.88; use TestBridge; run_all_testml_files( "Real-world examples", 't/tml-world', \&test_yaml_roundtrip ); done_testing; YAML-Tiny-1.70/t/86_fail.t000644 000766 000024 00000001250 13041072221 015245 0ustar00etherstaff000000 000000 =pod This is an example of a serious design flaw in YAML::Tiny. It is generally a bad idea to fake out a parsing process. In this case, YAML::Tiny strips off all lines that look like comments. It should be easy to find dozens of bugs by looking at the assumptions the code makes and then finding a counter case like this. That's why I'm working on Tiny::YAML and YAML::Pegex, which are driven by a grammar. =cut use Test::More tests => 1; use YAML::Tiny; TODO: { local $TODO = "Failing tests for things YAML::Tiny does wrong"; my $yaml = <<'...'; - | # Perl sub: sub foo {} ... is Load($yaml)->[0], "# Perl sub:\nsub foo{}\n", "Comments in literal scalars"; } YAML-Tiny-1.70/t/data/000700 000766 000024 00000000000 13041072221 014531 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/lib/000700 000766 000024 00000000000 13041072221 014366 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/README.md000600 000766 000024 00000014404 13041072221 015104 0ustar00etherstaff000000 000000 # Guide to YAML::Tiny testing YAML::Tiny tests use several components: * .t files * Test libraries in t/lib * YAML data files in t/data * TestML data files in t/tml-* The use of each is described below. ## .t files The .t files are standard Perl test files. They may use one or more of the test libraries in t/lib. They may only use modules available in Perl 5.8.1 or later (and not subsequently deprecated), but they may use newer non-XS versions of those modules as necessary to avoid known bugs. Some .t files have complete inputs/outputs for their tests. Others iterate over .tml files in the t/tml-* directories. A .t file should load Test::More and use `done_testing` at the end to so that new tests may be added without needing to also update a test plan. Currently, the convention is to name .t files matching the pattern qr/^\d\d_\w+\.t$/ ## Test libraries There are currently three test libraries in t/lib. A .t file that uses one or more of them should put `use lib 't/lib';` at the top of the .t file. Test libraries can assume that if they were loaded, that 't/lib' is already in @INC. The test libraries are: * SubtestCompat * TestML::Tiny * TestBridge * TestUtils The "SubtestCompat" library provides a limited emulation of Test::More::subtest that is reasonably compatible back to 0.88. If using subtests, you must not set a plan in the subtest and you must use done_testing in the *.t file. The TestML::Tiny library contains functions for parsing and executing TestML tests with callbacks. TestML is a data-driven testing language; TestML::Tiny implements a small subset of its features. See the section on TestML, below, for an example. Generally, bugs should be patched upstream on CPAN and then a new Test::Tiny CPAN release can be copied here and pod-stripped. The TestBridge library contains testing functions for use in .t files or to be passed to TestML::Tiny functions as callbacks. Test functions should not include `done_testing`. They should use `subtest` for any repetitive testing that loops over test cases. Callback should check for the expected test points (see below) and skip a TML block if those points are not available. The TestUtils library contains utility functions. Testing functions should not be added here (i.e. nothing that uses Test::More). ## YAML data files in t/data Files in the t/data directory are intended to test how YAML files are loaded and decoded and typically need some custom test code to load the file and see if the result matches expectations (successful or not). If a real-world YAML file cannot be loaded due to character set encoding issues, it should be placed in this directory for testing. If a real-world YAML file is ASCII or UTF-8 encoded, can be decoded successfully, but has problems in parsing, it should be reduced to the smallest sample of YAML that demonstrates the parsing problem and added to a .tml file for testing. See below for more details. ## TestML quick intro TestML data files are UTF-8 encoded files with a .tml suffix that contain one or more test "blocks". Each block has a test label, and one or more 'test points', usually representing input and expected output, and possibly additional annotations or flags. Here is an example of a .tml file with a single block: # This is a TestML block: (this line is a comment) === This is the test label Lines until the first point are ignored # This is a "block" style point. All non-comment lines until next point # are the data for the 'yaml' point. The data ends with newline, and # trailing blank lines are trimmed. --- yaml --- foo: bar # a comment \# not a comment # This is the second point; "inline" style. The data after the colon goes # to end of line. Leading/trailing whitespace is trimmed. --- perl: [ { foo => 'bar' } ] # This is a point whose value is the empty string --- a_flag # This is the next block: === Another test case The test label is provided on a line beginning with qr/^===/. Test "points" are provided in sections beginning with qr/^--- +\w+/. All flush-left comment lines are stripped. Lines beginning with '\' are escaped. Different tests expect different test points in a .tml file, based on the specific test callback being used. Many .tml files have the points 'yaml' and 'perl' as in the example above. The 'yaml' point is a YAML document and the 'perl' point is a Data::Dumper Perl data structure. The test checks whether the YAML parses into a data structure identical to the Perl one. The 'a_flag' point is an annotation that the testing callback can use to affect the run of a given test. The semantics of points (including annotations) is specific to the callback functions used to process test blocks. # TestML data files in t/tml-* TestML data files are organized into three directories: * t/tml-spec — these test files are provided by the YAML spec maintainers and should not be modified except to skip testing features that YAML::Tiny does not support * t/tml-local — these test files are YAML::Tiny's own unit tests; generally new test cases for coverage or correctness should be added here; these are broken into subdirectories, described later * t/tml-world — these test files represent "real world" YAML and their corresponding expected Perl output Generally, if a "real world" problem can be isolated to a particular snippet of YAML, it's best to add it to a t/tml-local file (or create a new one). If the problem can only be seen in the context of the entire YAML document, include it in t/tml-world. If the problem relates to encoding, it should be put into t/data instead. # t/tml-local subdirectories The subdirectories in t/tml-local define four types of tests: * perl-to-yaml: test that perl data dump to an expected YAML string * yaml-roundtrip: test that a YAML string loads to an expected perl data structure; also tests that the perl data can be dumped and loaded back; * dump-error: test that certain perl data trigger expected errors * load-error: test that certain YAML strings trigger expected errors All .tml files in a t/tml-local directory must have the TestML test points required by the corresponding test functions defined in the TestBridge library. Generally, files should be grouped by data type or feature so that related tests are kept together. YAML-Tiny-1.70/t/tml000700 000766 000024 00000006544 13041072221 014353 0ustar00etherstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use lib 'lib', 't/lib/'; use Test::More 0.88; use SubtestCompat; use Getopt::Long qw/:config passthrough/; use List::Util qw/first/; use TestBridge; use TestUtils; #--------------------------------------------------------------------------# # Note: This program is both the proxy to select .tml files for 'prove' and the # test-runner that 'prove' executes. #--------------------------------------------------------------------------# # match path prefix under t/ my %BRIDGE_MAP = ( 'tml-local/dump-error' => \&test_dump_error, 'tml-local/load-error' => \&test_load_error, 'tml-local/load-warning' => \&test_load_warning, 'tml-local/perl-to-yaml' => \&test_perl_to_yaml, 'tml-local/yaml-roundtrip' => \&test_yaml_roundtrip, 'tml-spec/basic-data.tml' => \&test_yaml_json, 'tml-spec/unicode.tml' => \&test_code_point, 'tml-world' => \&test_yaml_roundtrip, ); sub main { my ($verbose, $run_tests); GetOptions( 'run_test' => \$run_tests, ); if ( $run_tests ) { my $file = shift @ARGV; exit 0 unless -f $file; my ($bridge) = first { $file =~ m{^t/\Q$_} } keys %BRIDGE_MAP; die "No bridge found for $file" unless $bridge; run_testml_file( $file, sub { my ($file, $blocks) = @_; subtest "TestML dev runner: $file" => sub { $BRIDGE_MAP{$bridge}->($_) for @$blocks; }; done_testing; }, ); } else { my (@opts, @files, @patterns); for (@ARGV) { if ( /^-/ ) { push @opts, $_; } elsif ( -f ) { push @files, $_; } else { push @patterns, $_; } } # if we got no files or patterns, treat that as taking anything @patterns = "." if !@patterns && !@files; if (@patterns) { FILE: for my $file ( find_tml_files('t') ) { if ( first { $file =~ /$_/ } @patterns ) { push @files, $file; } } } exec( 'prove', @opts, '--exec', "$0 --run_test", @files ) if @files; } } main; __END__ =head1 NAME =for stopwords tml t/tml - run .tml files matching a pattern =head1 SYNOPSIS t/tml [prove options] [patterns] =head1 USAGE This program runs F against a set of F<.tml> files using their corresponding test bridge functions. Any arguments beginning with C<-> will be passed through to F. All other arguments will be used as patterns to select F<.tml> files found anywhere under the F directory. You can use shell globbing syntax, and let the shell expand the patterns, or you can quote/escape the patterns and let them be treated as Perl regular expressions. For example: t/tml unicode # paths matching qr/unicode/ t/tml basic uni # paths matching qr/basic/ or qr/uni/ t/tml 'local.*re' # paths matching qr/local.*re/ t/tml '\d+' # paths matching qr/\d+/ Examples of options for prove: t/tml -v quoting # verbose run of paths matching qr/quoting/ t/tml -j9 world # parallel run of paths matching qr/world/ t/tml -j9 # parallel run of all .tml files =cut YAML-Tiny-1.70/t/tml-local/000700 000766 000024 00000000000 13041072221 015504 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-spec/000700 000766 000024 00000000000 13041072221 015344 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-world/000700 000766 000024 00000000000 13041072221 015541 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-world/Acme-Time-Baby.tml000644 000766 000024 00000001151 13041072221 020703 0ustar00etherstaff000000 000000 === Acme-Time-Baby --- yaml \# http://module-build.sourceforge.net/META-spec.html \#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Acme-Time-Baby version: 2.106 version_from: Baby.pm installdirs: site requires: warnings: distribution_type: module generated_by: ExtUtils::MakeMaker version 6.17 --- perl [ { name => 'Acme-Time-Baby', version => '2.106', version_from => 'Baby.pm', installdirs => 'site', requires => { warnings => undef, }, distribution_type => 'module', generated_by => 'ExtUtils::MakeMaker version 6.17', } ] YAML-Tiny-1.70/t/tml-world/Data-Swap.tml000644 000766 000024 00000000615 13041072221 020054 0ustar00etherstaff000000 000000 === Data-Swap # File with a YAML header --- yaml \--- #YAML:1.0 name: Data-Swap version: 0.05 license: perl distribution_type: module requires: perl: 5.6.0 dynamic_config: 0 --- perl [ { name => 'Data-Swap', version => '0.05', license => 'perl', distribution_type => 'module', requires => { perl => '5.6.0', }, dynamic_config => '0', } ] --- nosyck YAML-Tiny-1.70/t/tml-world/Games-Nintendo-Wii-Mii.tml000644 000766 000024 00000002554 13041072221 022351 0ustar00etherstaff000000 000000 === Games-Nintendo-Wii-Mii # Testing various failing META.yml files from CPAN --- yaml --- abstract: Mii in Nintendo Wii data parser and builder author: Toru Yamaguchi distribution_type: module generated_by: Module::Install version 0.65 license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 name: Games-Nintendo-Wii-Mii no_index: directory: - inc - t requires: Carp: 1.03 Class::Accessor::Fast: 0.3 File::Slurp: 9999.12 IO::File: 1.1 Readonly: 0 Tie::IxHash: 1.21 URI: 1.35 XML::LibXML: 1.62 version: 0.02 --- perl [ { abstract => 'Mii in Nintendo Wii data parser and builder', author => 'Toru Yamaguchi ', distribution_type => 'module', generated_by => 'Module::Install version 0.65', license => 'perl', 'meta-spec' => { url => 'http://module-build.sourceforge.net/META-spec-v1.3.html', version => '1.3', }, name => 'Games-Nintendo-Wii-Mii', no_index => { directory => [ qw{ inc t } ], }, requires => { 'Carp' => '1.03', 'Class::Accessor::Fast' => '0.3', 'File::Slurp' => '9999.12', 'IO::File' => '1.1', 'Readonly' => '0', 'Tie::IxHash' => '1.21', 'URI' => '1.35', 'XML::LibXML' => '1.62', }, version => '0.02', } ] YAML-Tiny-1.70/t/tml-world/HTML-WebDAO.tml000644 000766 000024 00000000762 13041072221 020101 0ustar00etherstaff000000 000000 === HTML-WebDAO --- yaml \--- #YAML:1.0 name: HTML-WebDAO version: 0.04 author: - |- Zahatski Aliaksandr, Ezagap@users.sourceforge.netE abstract: Perl extension for create complex web application license: perl --- perl [ { abstract => 'Perl extension for create complex web application', author => [ 'Zahatski Aliaksandr, Ezagap@users.sourceforge.netE', ], license => 'perl', name => 'HTML-WebDAO', version => '0.04', } ] --- nosyck YAML-Tiny-1.70/t/tml-world/ITS-SIN-FIDS-Content-XML.tml000644 000766 000024 00000001701 13041072221 022147 0ustar00etherstaff000000 000000 === ITS-SIN-FIDS-Content-XML # Testing a META.yml from a commercial project that crashed --- yaml \# http://module-build.sourceforge.net/META-spec.html \#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: ITS-SIN-FIDS-Content-XML version: 0.01 version_from: lib/ITS/SIN/FIDS/Content/XML.pm installdirs: site requires: Test::More: 0.45 XML::Simple: 2 distribution_type: module generated_by: ExtUtils::MakeMaker version 6.30 --- perl [ { name => 'ITS-SIN-FIDS-Content-XML', version => "0.01", # this kludge is to prevent floating point comparison errors version_from => 'lib/ITS/SIN/FIDS/Content/XML.pm', installdirs => 'site', requires => { 'Test::More' => 0.45, 'XML::Simple' => 2, }, distribution_type => 'module', generated_by => 'ExtUtils::MakeMaker version 6.30', } ] YAML-Tiny-1.70/t/tml-world/Plagger.tml000644 000766 000024 00000004215 13041072221 017654 0ustar00etherstaff000000 000000 ##################################################################### # Example Plagger Configuration 1 === Plagger --- yaml plugins: - module: Subscription::Bloglines config: username: you@example.pl password: foobar mark_read: 1 - module: Publish::Gmail config: mailto: example@gmail.com mailfrom: miyagawa@example.com mailroute: via: smtp host: smtp.example.com --- perl [ { plugins => [ { module => 'Subscription::Bloglines', config => { username => 'you@example.pl', password => 'foobar', mark_read => 1, }, }, { module => 'Publish::Gmail', config => { mailto => 'example@gmail.com', mailfrom => 'miyagawa@example.com', mailroute => { via => 'smtp', host => 'smtp.example.com', }, }, }, ] } ] ##################################################################### # Example Plagger Configuration 2 === plagger2 --- yaml plugins: - module: Subscription::Config config: feed: # Trac's feed for changesets - http://plagger.org/.../rss # I don't like to be notified of the same items # more than once - module: Filter::Rule rule: module: Fresh mtime: path: /tmp/rssbot.time autoupdate: 1 - module: Notify::IRC config: daemon_port: 9999 nickname: plaggerbot server_host: chat.freenode.net server_channels: - '#plagger-ja' - '#plagger' --- perl [ { plugins => [ { module => 'Subscription::Config', config => { feed => [ 'http://plagger.org/.../rss' ], }, }, { module => 'Filter::Rule', rule => { module => 'Fresh', mtime => { path => '/tmp/rssbot.time', autoupdate => 1, }, }, }, { module => 'Notify::IRC', config => { daemon_port => 9999, nickname => 'plaggerbot', server_host => 'chat.freenode.net', server_channels => [ '#plagger-ja', '#plagger', ], }, } ] } ] YAML-Tiny-1.70/t/tml-world/Spreadsheet-Read.tml000644 000766 000024 00000010657 13041072221 021422 0ustar00etherstaff000000 000000 === Spreadsheet-Read --- yaml \--- #YAML:1.1 name: Read version: VERSION abstract: Meta-Wrapper for reading spreadsheet data license: perl author: - H.Merijn Brand generated_by: Author distribution_type: module provides: Spreadsheet::Read: file: Read.pm version: VERSION requires: perl: 5.006 Exporter: 0 Carp: 0 Data::Dumper: 0 recommends: perl: 5.008005 File::Temp: 0.14 IO::Scalar: 0 build_requires: perl: 5.006 Test::Harness: 0 Test::More: 0 optional_features: - opt_csv: description: Provides parsing of CSV streams requires: Text::CSV_XS: 0.23 recommends: Text::CSV: 1.10 Text::CSV_PP: 1.10 Text::CSV_XS: 0.58 - opt_excel: description: Provides parsing of Microsoft Excel files requires: Spreadsheet::ParseExcel: 0.26 Spreadsheet::ParseExcel::FmtDefault: 0 recommends: Spreadsheet::ParseExcel: 0.42 - opt_excelx: description: Provides parsing of Microsoft Excel 2007 files requires: Spreadsheet::XLSX: 0.07 - opt_oo: description: Provides parsing of OpenOffice spreadsheets requires: Spreadsheet::ReadSXC: 0.2 - opt_tools: description: Spreadsheet tools recommends: Tk: 0 Tk::NoteBook: 0 Tk::TableMatrix::Spreadsheet: 0 resources: license: http://dev.perl.org/licenses/ meta-spec: version: 1.4 url: http://module-build.sourceforge.net/META-spec-v1.4.html --- perl [ { 'resources' => { 'license' => 'http://dev.perl.org/licenses/' }, 'meta-spec' => { 'version' => '1.4', 'url' => 'http://module-build.sourceforge.net/META-spec-v1.4.html' }, 'distribution_type' => 'module', 'generated_by' => 'Author', 'version' => 'VERSION', 'name' => 'Read', 'author' => [ 'H.Merijn Brand ' ], 'license' => 'perl', 'build_requires' => { 'Test::More' => '0', 'Test::Harness' => '0', 'perl' => '5.006' }, 'provides' => { 'Spreadsheet::Read' => { 'version' => 'VERSION', 'file' => 'Read.pm' } }, 'optional_features' => [ { 'opt_csv' => { 'requires' => { 'Text::CSV_XS' => '0.23' }, 'recommends' => { 'Text::CSV_PP' => '1.10', 'Text::CSV_XS' => '0.58', 'Text::CSV' => '1.10' }, 'description' => 'Provides parsing of CSV streams' } }, { 'opt_excel' => { 'requires' => { 'Spreadsheet::ParseExcel' => '0.26', 'Spreadsheet::ParseExcel::FmtDefault' => '0' }, 'recommends' => { 'Spreadsheet::ParseExcel' => '0.42' }, 'description' => 'Provides parsing of Microsoft Excel files' } }, { 'opt_excelx' => { 'requires' => { 'Spreadsheet::XLSX' => '0.07' }, 'description' => 'Provides parsing of Microsoft Excel 2007 files' } }, { 'opt_oo' => { 'requires' => { 'Spreadsheet::ReadSXC' => '0.2' }, 'description' => 'Provides parsing of OpenOffice spreadsheets' } }, { 'opt_tools' => { 'recommends' => { 'Tk::TableMatrix::Spreadsheet' => '0', 'Tk::NoteBook' => '0', 'Tk' => '0' }, 'description' => 'Spreadsheet tools' } } ], 'requires' => { 'perl' => '5.006', 'Data::Dumper' => '0', 'Exporter' => '0', 'Carp' => '0' }, 'recommends' => { 'perl' => '5.008005', 'IO::Scalar' => '0', 'File::Temp' => '0.14' }, 'abstract' => 'Meta-Wrapper for reading spreadsheet data' } ] --- noyamlpm YAML-Tiny-1.70/t/tml-world/Template-Provider-Unicode-Japanese.tml000644 000766 000024 00000002221 13041072221 024741 0ustar00etherstaff000000 000000 === Template-Provider-Unicode-Japanese --- yaml --- abstract: Decode all templates by Unicode::Japanese author: Hironori Yoshida C<< >> distribution_type: module generated_by: Module::Install version 0.65 license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 name: Template-Provider-Unicode-Japanese no_index: directory: - inc - t requires: Template::Config: 0 Unicode::Japanese: 0 perl: 5.6.0 version: 0 version: 1.2.1 --- perl [ { abstract => 'Decode all templates by Unicode::Japanese', author => 'Hironori Yoshida C<< >>', distribution_type => 'module', generated_by => 'Module::Install version 0.65', license => 'perl', 'meta-spec' => { url => 'http://module-build.sourceforge.net/META-spec-v1.3.html', version => '1.3', }, name => 'Template-Provider-Unicode-Japanese', no_index => { directory => [ qw{ inc t } ], }, requires => { 'Template::Config' => 0, 'Unicode::Japanese' => 0, perl => '5.6.0', version => '0', }, version => '1.2.1', } ] YAML-Tiny-1.70/t/tml-world/toolbar.tml000644 000766 000024 00000001446 13041072221 017740 0ustar00etherstaff000000 000000 === toolbar # Testing of a known-bad file from an editor --- yaml main_toolbar: - item file-new - item file-open - item file-print# - item file-close# - item file-save-all - item file-save - - item edit-changes-undo - item edit-changes-redo - - item edit-cut - item edit-copy - item edit-paste - item edit-replace - item edit-delete --- perl [ { main_toolbar => [ 'item file-new', 'item file-open', 'item file-print#', 'item file-close#', 'item file-save-all', 'item file-save', undef, 'item edit-changes-undo', 'item edit-changes-redo', undef, 'item edit-cut', 'item edit-copy', 'item edit-paste', 'item edit-replace', 'item edit-delete', ] } ] YAML-Tiny-1.70/t/tml-world/Vanilla-Perl.tml000644 000766 000024 00000016146 13041072221 020567 0ustar00etherstaff000000 000000 === vanilla_perl # VanillaPerl YAML config file --- yaml # package info package_name: VanillaPerl package_version: 5 # directories download_dir: c:\temp\vp_sources build_dir: c:\temp\vp_build image_dir: c:\vanilla-perl # Binary components binary: - name: dmake url: http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/dmake-4.5-20060619-SHAY.zip license: dmake/COPYING : dmake/COPYING dmake/readme/license.txt: dmake/license.txt install_to: dmake/dmake.exe: dmake/bin/dmake.exe dmake/startup: dmake/bin/startup - name: gcc-core url: http://umn.dl.sourceforge.net/mingw/gcc-core-3.4.5-20060117-1.tar.gz license: COPYING: gcc/COPYING COPYING.lib: gcc/COPYING.lib install_to: mingw - name: gcc-g++ url: http://umn.dl.sourceforge.net/mingw/gcc-g++-3.4.5-20060117-1.tar.gz license: install_to: mingw - name: binutils url: http://umn.dl.sourceforge.net/mingw/binutils-2.16.91-20060119-1.tar.gz license: Copying: binutils/Copying Copying.lib: binutils/Copying.lib install_to: mingw - name: mingw-runtime url: http://umn.dl.sourceforge.net/mingw/mingw-runtime-3.10.tar.gz license: doc/mingw-runtime/Contributors: mingw/Contributors doc/mingw-runtime/Disclaimer: mingw/Disclaimer install_to: mingw - name: w32api url: http://umn.dl.sourceforge.net/mingw/w32api-3.6.tar.gz license: install_to: mingw extra: extra\README.w32api: licenses\win32api\README.w32api # Source components source: - name: perl url: http://mirrors.kernel.org/CPAN/src/perl-5.8.8.tar.gz license: perl-5.8.8/Readme: perl/Readme perl-5.8.8/Artistic: perl/Artistic perl-5.8.8/Copying: perl/Copying unpack_to: perl install_to: perl after: extra\Config.pm: lib\CPAN\Config.pm # Additional modules to bundle in site\lib modules: # i.e. not used, but gets us the libwin32 dist - name: Win32::Job unpack_to: APIFile: Win32API-File - name: IO force: 1 - name: Compress::Zlib - name: IO::Zlib - name: Archive::Tar - name: Net::FTP extra: extra\libnet.cfg: libnet.cfg # Extra files to be placed # Signature.pm: perl\site\lib\Module\Signature.pm extra: README: README.txt LICENSE.txt: LICENSE.txt Changes: Release-Notes.txt extra\Config.pm: perl\lib\CPAN\Config.pm # reset this again extra\links\Perl-Documentation.url: links\Perl Documentation.url extra\links\Perl-Homepage.url: links\Perl Homepage.url extra\links\Perl-Mailing-Lists.url: links\Perl Mailing Lists.url extra\links\Perlmonks-Community-Forum.url: links\Perlmonks Community Forum.url extra\links\Search-CPAN-Modules.url: links\Search CPAN Modules.url extra\links\Vanilla-Perl-Homepage.url: links\Vanilla Perl Homepage.url --- perl [ { package_name => 'VanillaPerl', package_version => 5, download_dir => 'c:\temp\vp_sources', build_dir => 'c:\temp\vp_build', image_dir => 'c:\vanilla-perl', binary => [ { name => 'dmake', url => 'http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/dmake-4.5-20060619-SHAY.zip', license => { 'dmake/COPYING' => 'dmake/COPYING', 'dmake/readme/license.txt' => 'dmake/license.txt', }, install_to => { 'dmake/dmake.exe' => 'dmake/bin/dmake.exe', 'dmake/startup' => 'dmake/bin/startup', }, }, { name => 'gcc-core', url => 'http://umn.dl.sourceforge.net/mingw/gcc-core-3.4.5-20060117-1.tar.gz', license => { 'COPYING' => 'gcc/COPYING', 'COPYING.lib' => 'gcc/COPYING.lib', }, install_to => 'mingw', }, { name => 'gcc-g++', url => 'http://umn.dl.sourceforge.net/mingw/gcc-g++-3.4.5-20060117-1.tar.gz', license => undef, install_to => 'mingw', }, { name => 'binutils', url => 'http://umn.dl.sourceforge.net/mingw/binutils-2.16.91-20060119-1.tar.gz', license => { 'Copying' => 'binutils/Copying', 'Copying.lib' => 'binutils/Copying.lib', }, install_to => 'mingw', }, { name => 'mingw-runtime', url => 'http://umn.dl.sourceforge.net/mingw/mingw-runtime-3.10.tar.gz', license => { 'doc/mingw-runtime/Contributors' => 'mingw/Contributors', 'doc/mingw-runtime/Disclaimer' => 'mingw/Disclaimer', }, install_to => 'mingw', }, { name => 'w32api', url => 'http://umn.dl.sourceforge.net/mingw/w32api-3.6.tar.gz', license => undef, install_to => 'mingw', extra => { 'extra\README.w32api' => 'licenses\win32api\README.w32api', }, } ], source => [ { name => 'perl', url => 'http://mirrors.kernel.org/CPAN/src/perl-5.8.8.tar.gz', license => { 'perl-5.8.8/Readme' => 'perl/Readme', 'perl-5.8.8/Artistic' => 'perl/Artistic', 'perl-5.8.8/Copying' => 'perl/Copying', }, unpack_to => 'perl', install_to => 'perl', after => { 'extra\Config.pm' => 'lib\CPAN\Config.pm', }, } ], modules => [ { name => 'Win32::Job', unpack_to => { APIFile => 'Win32API-File', }, }, { name => 'IO', force => 1, }, { name => 'Compress::Zlib', }, { name => 'IO::Zlib', }, { name => 'Archive::Tar', }, { name => 'Net::FTP', extra => { 'extra\libnet.cfg' => 'libnet.cfg', }, }, ], extra => { 'README' => 'README.txt', 'LICENSE.txt' => 'LICENSE.txt', 'Changes' => 'Release-Notes.txt', 'extra\Config.pm' => 'perl\lib\CPAN\Config.pm', 'extra\links\Perl-Documentation.url' => 'links\Perl Documentation.url', 'extra\links\Perl-Homepage.url' => 'links\Perl Homepage.url', 'extra\links\Perl-Mailing-Lists.url' => 'links\Perl Mailing Lists.url', 'extra\links\Perlmonks-Community-Forum.url' => 'links\Perlmonks Community Forum.url', 'extra\links\Search-CPAN-Modules.url' => 'links\Search CPAN Modules.url', 'extra\links\Vanilla-Perl-Homepage.url' => 'links\Vanilla Perl Homepage.url', }, } ] --- nosyck YAML-Tiny-1.70/t/tml-world/YAML-Tiny-META.tml000644 000766 000024 00000001774 13041072221 020511 0ustar00etherstaff000000 000000 === YAML::Tiny # Testing YAML::Tiny's own META.yml file -- at least as of some time ago --- yaml abstract: Read/Write YAML files with as little code as possible author: 'Adam Kennedy ' build_requires: File::Spec: 0.80 Test::More: 0.47 distribution_type: module generated_by: Module::Install version 0.63 license: perl name: YAML-Tiny no_index: directory: - inc - t requires: perl: 5.005 version: 0.03 --- perl [ { abstract => 'Read/Write YAML files with as little code as possible', author => 'Adam Kennedy ', build_requires => { 'File::Spec' => '0.80', 'Test::More' => '0.47', }, distribution_type => 'module', generated_by => 'Module::Install version 0.63', license => 'perl', name => 'YAML-Tiny', no_index => { directory => [ qw{inc t} ], }, requires => { perl => '5.005', }, version => '0.03', } ] YAML-Tiny-1.70/t/tml-world/yaml_org.tml000644 000766 000024 00000002775 13041072221 020115 0ustar00etherstaff000000 000000 === yaml_org_example # Testing sample data structure from yaml.org --- yaml --- invoice: 34843 date : 2001-01-23 bill-to: given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 product: - sku : BL394D quantity : 4 description : Basketball price : 450.00 - sku : BL4438H quantity : 1 description : Super Hoop price : 2392.00 tax : 251.42 total: 4443.52 comments: > Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. --- perl [ { invoice => 34843, date => '2001-01-23', 'bill-to' => { given => 'Chris', family => 'Dumars', address => { lines => "458 Walkman Dr.\nSuite #292\n", city => 'Royal Oak', state => 'MI', postal => 48046, }, }, product => [ { sku => 'BL394D', quantity => '4', description => 'Basketball', price => '450.00', }, { sku => 'BL4438H', quantity => '1', description => 'Super Hoop', price => '2392.00', }, ], tax => '251.42', total => '4443.52', comments => <<'END_TEXT', Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. END_TEXT } ] --- nosyck YAML-Tiny-1.70/t/tml-spec/basic-data.tml000644 000766 000024 00000000466 13041072221 020072 0ustar00etherstaff000000 000000 === basic hash # This is just a simple one key hash. --- yaml a: b --- json {"a":"b"} === double quoted keys # Hash with quoted key with embedded newline --- yaml "a\nb": c --- json {"a\nb":"c"} # --- dump # "a\nb": c === basic array # This is just a simple one key hash. --- yaml - a -b --- json ["a","b"] YAML-Tiny-1.70/t/tml-spec/unicode.tml000644 000766 000024 00000015774 13041072221 017540 0ustar00etherstaff000000 000000 # Test unicode strings in key and value contexts %TestML 0.1.0 ### # These tests target unicode characters that are handled special or known to be # problematic. Test YNY (YAML→Native→YAML) and NYN roundtripping. # # YAML scalar emission does quoting based on first character, presence of # escape characters, and special ambiguous cases like ': '. These ones # character strings go a long way towards making sure an implementation is # correct. ### # Make a mapping { "$code" : "$code" } where code is a unicode code point: # Dump mapping matches *yaml *code.dump_code_key_value == *yaml # Load *yaml then dump matches *yaml *yaml.load_yaml.dump_yaml == *yaml # Dump mapping the load memory-matches mapping *code.code_key_value.dump_yaml.load_yaml === *code.code_key_value # 0 → \0 "null" # # \z is the other YAML "null" encoding. Most implementations (including # libyaml), seem to go with \0 when emitting. === Code point 0 --- code: 0 --- yaml "\0": "\0" # 1-6,14-27,29-31 → \x## === Code point 1 --- code: 1 --- yaml "\x01": "\x01" # 7 → \a "bell" (alarm) === Code point 7 --- code: 7 --- yaml "\a": "\a" # 8 → \b "backspace" === Code point 8 --- code: 8 --- yaml "\b": "\b" # 9 → \t "horizontal tab" === Code point 9 --- code: 9 --- yaml "\t": "\t" # 10 → \n "linefeed" (newline) === Code point 10 --- code: 10 --- yaml "\n": "\n" # 11 → \v "vertical tab" === Code point 11 --- code: 11 --- yaml "\v": "\v" # 11 → \f "form feed" === Code point 12 --- code: 12 --- yaml "\f": "\f" # 11 → \f "carriage return" === Code point 13 --- code: 13 --- yaml "\r": "\r" # 27 → \e "escape" === Code point 27 --- code: 27 --- yaml "\e": "\e" # Space character needs quotes. === Code point 32 --- code: 32 --- yaml ' ': ' ' # ! is a tag indicator. Needs quotes. === Code point 33 --- code: 33 --- yaml '!': '!' # Quote single quotes with double quotes. === Code point 34 --- code: 34 --- yaml '"': '"' # '#' is comment character. Needs quotes. === Code point 35 --- code: 35 --- yaml '#': '#' # $ has no special meaning. No quotes. === Code point 36 --- code: 36 --- yaml $: $ # % is directive indicator. Needs quotees. === Code point 37 --- code: 37 --- yaml '%': '%' # & is anchor indicator. Needs quotes. === Code point 38 --- code: 38 --- yaml '&': '&' # Quote double quotes with single quotes. === Code point 39 --- code: 39 --- yaml "'": "'" # ( has no special meaning. No quotes. === Code point 40 --- code: 40 --- yaml (: ( # ) has no special meaning. No quotes. === Code point 41 --- code: 41 --- yaml ): ) # * is an alias indicator. Needs quotes. === Code point 42 --- code: 42 --- yaml '*': '*' # + has no special meaning. No quotes. === Code point 43 --- code: 43 --- yaml +: + # , is a list separator. Needs quotes. === Code point 44 --- code: 44 --- yaml ',': ',' # - is a sequence element marker. In many contexts it is not ambiguous when # unquoted, but in others it is ambiguous. libyaml always quotes it so going # with that for now. === Code point 45 --- code: 45 --- yaml '-': '-' # . has no special meaning. No quotes. === Code point 46 --- code: 46 --- yaml .: . # / has no special meaning. No quotes. === Code point 47 --- code: 47 --- yaml /: / # 48-57 → 0-9 "digitss" # These values are strings, so must quote them. === Code point 48 --- code: 48 --- yaml '0': '0' # : is a key/value separator. It is not always ambigous when not quoted, but # libyaml always quotes it at start of a string. Probably wise. Going with that # for now. === Code point 58 --- code: 58 --- yaml ':': ':' # ; has no special meaning. No quotes. === Code point 59 --- code: 59 --- yaml ;: ; # < has no special meaning. No quotes. === Code point 60 --- code: 60 --- yaml <: < # = has no special meaning. No quotes. === Code point 61 --- code: 61 --- yaml =: = # > is a folded scalar indicator. Needs quotes. === Code point 62 --- code: 62 --- yaml '>': '>' # ? is a mapping key indicator. Needs quotes. === Code point 63 --- code: 63 --- yaml '?': '?' # @ is a reserved character. Needs quotes. # TODO Check spec on this. === Code point 64 --- code: 64 --- yaml '@': '@' # 65-90 → A-Z "upper case letters". No quotes. === Code point 65 --- code: 65 --- yaml A: A # Some implementations think N means false. This should not be the case in a # default schema. No quotes. # # NOTE: # http://yaml.org/type/bool.html suggests that many simple strings should be # loaded as boolean, but this is an outdated concept. Currently, only the # words true/false/null (lower case) should be loaded specially (not as # strings). This may become even more restrictive in the future. ie Only # true/false/null in a flow context. === Code point 78 --- code: 78 --- yaml N: N # Some implementations think Y means true. This should not be the case in a # default schema. No quotes. === Code point 89 --- code: 89 --- yaml Y: Y # [ is a flow sequence start indicator. Needs quotes. === Code point 91 --- code: 91 --- yaml '[': '[' # \ is an escape indicator in double quoted strings. Used on its own it has no # special meaning. No quotes. === Code point 92 --- SKIP --- code: 92 --- yaml \: \ # ] is a flow sequence end indicator. Needs quotes. === Code point 93 --- code: 93 --- yaml ']': ']' # ^ has no special meaning. No quotes. === Code point 94 --- code: 94 --- yaml ^: ^ # _ has no special meaning. No quotes. === Code point 95 --- code: 95 --- yaml _: _ # ` is a reserved character. Needs quotes. === Code point 96 --- code: 96 --- yaml '`': '`' # 65-90 → a-z "lower case letters". No quotes. === Code point 97 --- code: 97 --- yaml a: a # Some implementations think n means false. This should not be the case in a # default schema. No quotes. === Code point 110 --- code: 110 --- yaml n: n # Some implementations think y means true. This should not be the case in a # default schema. No quotes. === Code point 121 --- code: 121 --- yaml y: y # { is a flow mapping start indicator. Needs quotes. === Code point 123 --- code: 123 --- yaml '{': '{' # | is a literal scalar indicator. Needs quotes. === Code point 124 --- code: 124 --- yaml '|': '|' # } is a flow mapping end indicator. Needs quotes. === Code point 125 --- code: 125 --- yaml '}': '}' # A single ~ has long been used as a plain scalar representation of null. This # should be deprecated, but may take a while. === Code point 126 --- code: 126 --- yaml '~': '~' --- unquoted ~: ~ # 127 → "escape" # YAML does not have a special character. YAML2 should consider \?. === Code point 127 --- code: 127 --- yaml "\x7F": "\x7F" # 80-84,86-159 → \x## === Code point 128 --- code: 128 --- yaml "\x80": "\x80" # 133 (\x85) → "next line" (NEL) === Code point 133 --- code: 133 --- yaml "\N": "\N" # 160 (\xA0) → "non-breaking space" # It seems extremely odd that YAML does not escape this. # Investigate further. === Code point 160 --- SKIP --- code: 160 --- yaml  :   # 161-… → From here on up use printable unicode chars. # XXX Need to look into other special code blocks. Especially those known to # libyaml. === Code point 161 --- code: 161 --- yaml ¡: ¡ YAML-Tiny-1.70/t/tml-local/dump-error/000700 000766 000024 00000000000 13041072221 017600 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-local/load-error/000700 000766 000024 00000000000 13041072221 017552 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-local/load-warning/000700 000766 000024 00000000000 13041072221 020066 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-local/perl-to-yaml/000700 000766 000024 00000000000 13041072221 020026 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/000700 000766 000024 00000000000 13041072221 020472 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/collection.tml000644 000766 000024 00000003530 13041072221 023356 0ustar00etherstaff000000 000000 #--------------------------------------------------------------------------# # This file is for testing combinations of sequences and mappings #--------------------------------------------------------------------------# ##################################################################### # Null HASH/ARRAY === null hash in array --- yaml --- - foo - {} - bar --- perl [ [ 'foo', {}, 'bar' ] ] === null array in array --- yaml --- - foo - [] - bar --- perl [ [ 'foo', [], 'bar' ] ] === null hash in hash --- yaml --- foo: {} bar: 1 --- perl [ { foo => {}, bar => 1 } ] === null array in hash --- yaml --- foo: [] bar: 1 --- perl [ { foo => [], bar => 1 } ] # Simple array inside a hash with an undef === array_in_hash --- yaml --- foo: - bar - ~ - baz --- perl [ { foo => [ 'bar', undef, 'baz' ] } ] # Simple hash inside a hash with an undef === hash_in_hash --- yaml --- foo: ~ bar: foo: bar --- perl [ { foo => undef, bar => { foo => 'bar' } } ] # Mixed hash and scalars inside an array === hash_in_array --- yaml --- - foo: ~ this: that - foo - ~ - foo: bar this: that --- perl [ [ { foo => undef, this => 'that' }, 'foo', undef, { foo => 'bar', this => 'that' }, ] ] ###################################################################### # Non-Indenting Sub-List === Non-indenting sub-list --- yaml --- foo: - list bar: value --- perl [ { foo => [ 'list' ], bar => 'value' } ] --- noyamlpm # Inline nested hash === inline_nested_hash --- yaml --- - ~ - foo: bar this: that - baz --- perl [ [ undef, { foo => 'bar', this => 'that' }, 'baz' ] ] # RT 51491 === space after hypen --- yaml \--- FOO: - bar: baz --- perl [ { 'FOO' => [ { bar => 'baz' } ] } ] # RT 92916 (a Test::Database ticket) === colon at end of key --- yaml \--- dbi:SQLite:: foo: bar --- perl [ { 'dbi:SQLite:' => { 'foo' => 'bar' } } ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/comment.tml000644 000766 000024 00000004313 13041072221 022665 0ustar00etherstaff000000 000000 ##################################################################### # Main Tests === Properly ignore comments --- yaml --- a: b#content c: d #comment e: - f #comment - g# content h: 'single' # comment h2: 'single # content' # comment i: "double" # comment i2: "double # content" # comment j: | # comment literal # content block # content k: {} # comment l: [] # comment m: # comment n: o --- perl [ { a => 'b#content', c => 'd', e => [ 'f', 'g# content', ], h => 'single', h2 => 'single # content', i => 'double', i2 => 'double # content', j => "literal # content\nblock # content\n", k => {}, l => [], m => { n => 'o', }, }, ] --- noyamlpm # Repeat, with otherwise illegal characters in the comments === Properly ignore comments (with otherwise illegal characters) --- yaml --- a: b#content c: d #comment '"!&@%` e: - f #comment '"!&@%` - g# content h: 'single' # comment '"!&@%` h2: 'single # content' # comment '"!&@%` i: "double" # comment '"!&@%` i2: "double # content" # comment '"!&@%` j: | # comment '"!&@%` literal # content block # content k: {} # comment '"!&@%` l: [] # comment '"!&@%` m: # comment '"!&@%` n: o --- perl [ { a => 'b#content', c => 'd', e => [ 'f', 'g# content', ], h => 'single', h2 => 'single # content', i => 'double', i2 => 'double # content', j => "literal # content\nblock # content\n", k => {}, l => [], m => { n => 'o', }, }, ] --- noyamlpm #################################################################### # Comment on the Document Line === comment header --- yaml --- # Comment foo: bar --- perl [ { foo => 'bar' } ] --- noyamlpm # Empty comments === empty_comment_in_list --- yaml --- - foo \# - bar --- perl [ [ 'foo', 'bar' ] ] === empty_comment_in_hash --- yaml --- foo: bar \# foo one: two --- perl [ { foo => 'bar', one => 'two' } ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/document.tml000644 000766 000024 00000004632 13041072221 023045 0ustar00etherstaff000000 000000 ##################################################################### # Support for YAML version directives # Simple inline case (comment variant) === simple_doctype_comment --- yaml --- #YAML:1.0 foo: bar --- perl [ { foo => 'bar' } ] --- nosyck # Simple inline case (percent variant) === simple_doctype_percent --- yaml --- %YAML:1.0 foo: bar --- perl [ { foo => 'bar' } ] --- noyamlpm --- noxs # Simple header (comment variant) === predocument_1_0 --- yaml \%YAML:1.0 --- foo: bar --- perl [ { foo => 'bar' } ] --- noyamlpm --- nosyck --- noxs # Simple inline case (comment variant) === predocument_1_1 --- yaml \%YAML 1.1 --- foo: bar --- perl [ { foo => 'bar' } ] --- noyamlpm --- nosyck # Multiple inline documents (comment variant) === multi_doctype_comment --- yaml --- #YAML:1.0 foo: bar --- #YAML:1.0 - 1 --- #YAML:1.0 foo: bar --- perl [ { foo => 'bar' }, [ 1 ], { foo => 'bar' } ] # Simple pre-document case (comment variant) === predocument_percent --- yaml \%YAML 1.1 --- foo: bar --- perl [ { foo => 'bar' } ] --- noyamlpm --- nosyck # Simple pre-document case (comment variant) === predocument_comment --- yaml \#YAML 1.1 --- foo: bar --- perl [ { foo => 'bar' } ] === two documents --- yaml \--- - foo \--- - bar --- perl [ [ 'foo' ], [ 'bar' ] ] # Document ending (hash) === document_end_hash --- yaml --- foo: bar ... --- perl [ { foo => "bar" } ] --- noyamlpm --- nosyck # Document ending (array) === document_end_array --- yaml --- - foo ... --- perl [ [ 'foo' ] ] --- noyamlpm # Multiple documents (simple) === multi_document_simple --- yaml --- - foo ... --- - foo ... --- perl [ [ 'foo' ], [ 'foo' ] ] --- noyamlpm # Multiple documents (whitespace-separated) === multi_document_space --- yaml --- - foo ... --- - foo ... --- perl [ [ 'foo' ], [ 'foo' ] ] --- noyamlpm ##################################################################### # Sample Testing # Test a completely empty document === empty --- yaml --- perl [ ] # Just a newline ### YAML.pm has a bug where it dies on a single newline === only_newlines --- yaml \ \ --- perl [ ] # Just a comment === only_comment --- yaml \# comment --- perl [ ] # Empty documents === only_header --- yaml --- --- perl [ undef ] === two_header --- yaml --- --- --- perl [ undef, undef ] === one_undef --- yaml --- ~ --- perl [ undef ] === one_undef2 --- yaml --- ~ --- perl [ undef ] === two_undef --- yaml --- ~ --- --- perl [ undef, undef ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/mapping.tml000644 000766 000024 00000004550 13041072221 022661 0ustar00etherstaff000000 000000 === Empty mapping --- yaml \--- {} --- perl [ {} ] # Simple hashs === one_hash1 --- yaml --- foo: bar --- perl [ { foo => 'bar' } ] === one_hash2 --- yaml --- foo: bar this: ~ --- perl [ { this => undef, foo => 'bar' } ] === one_hash3 --- yaml --- -foo: bar --- perl [ { '-foo' => 'bar' } ] # Implicit document start === implicit_hash --- yaml foo: bar --- perl [ { foo => 'bar' } ] # Make sure we support x-foo keys === x-foo key --- yaml --- x-foo: 1 --- perl [ { 'x-foo' => 1 } ] # Hash key legally containing a colon === module_hash_key --- yaml --- Foo::Bar: 1 --- perl [ { 'Foo::Bar' => 1 } ] # Hash indented === hash_indented --- yaml --- foo: bar --- perl [ { foo => "bar" } ] ##################################################################### # Empty Values and Premature EOF === empty hash keys --- yaml --- foo: 0 requires: build_requires: --- perl [ { foo => 0, requires => undef, build_requires => undef } ] --- noyamlpm ##################################################################### # Confirm we can read the synopsis === synopsis --- yaml --- rootproperty: blah section: one: two three: four Foo: Bar empty: ~ --- perl [ { rootproperty => 'blah', section => { one => 'two', three => 'four', Foo => 'Bar', empty => undef, }, } ] ##################################################################### # Indentation after empty hash value === Indentation after empty hash value --- yaml --- Test: optmods: Bad: 0 Foo: 1 Long: 0 version: 5 Test_IncludeA: optmods: Test_IncludeB: optmods: _meta: name: 'test profile' note: 'note this test profile' --- perl [ { Test => { optmods => { Bad => 0, Foo => 1, Long => 0, }, version => 5, }, Test_IncludeA => { optmods => undef, }, Test_IncludeB => { optmods => undef, }, _meta => { name => 'test profile', note => 'note this test profile', }, } ] ##################################################################### # Spaces in the Key === spaces in the key --- yaml --- the key: the value --- perl [ { 'the key' => 'the value' } ] # Complex keys === key_with_whitespace --- yaml --- a b: c d --- perl [ { 'a b' => 'c d' } ] === quoted_empty_key --- yaml --- '': foo --- perl [ { '' => 'foo' } ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/quoting.tml000644 000766 000024 00000003571 13041072221 022716 0ustar00etherstaff000000 000000 === Empty double-quote --- yaml \--- - "" --- perl [ [ "" ] ] # Simple single quote === single_quote1 --- yaml --- - 'foo' --- perl [ [ 'foo' ] ] === single_spaces --- yaml --- - ' ' --- perl [ [ ' ' ] ] === single_null --- yaml --- - '' --- perl [ [ '' ] ] # Double quotes === only_spaces --- noyamlpm --- yaml --- " " --- perl [ ' ' ] === leading_trailing_spaces --- noyamlpm --- yaml --- " foo" --- "bar " --- perl [ " foo", "bar " ] === single quotes in double quotes --- yaml \--- "'foo'" --- perl [ "'foo'" ] === double quotes in single quotes --- yaml \--- '"foo"' --- perl [ '"foo"' ] ##################################################################### # Quote vs Hash === hash-like quote --- yaml --- author: - 'mst: Matt S. Trout ' --- perl [ { author => [ 'mst: Matt S. Trout ' ] } ] ##################################################################### # Quote and Escaping Idiosyncracies === single quote subtleties --- yaml --- name1: 'O''Reilly' name2: 'O''Reilly O''Tool' name3: 'Double '''' Quote' --- perl [ { name1 => "O'Reilly", name2 => "O'Reilly O'Tool", name3 => "Double '' Quote", } ] === single quote subtleties --- yaml --- slash1: '\\' slash2: '\\foo' slash3: '\\foo\\\\' --- perl [ { slash1 => "\\\\", slash2 => "\\\\foo", slash3 => "\\\\foo\\\\\\\\", } ] ##################################################################### # Check Multiple-Escaping # RT #42119: write of two single quotes === Multiple escaping of quote ok --- yaml --- "A'B'C" --- perl [ "A'B'C" ] # Escapes without whitespace === Multiple escaping of escape ok --- yaml \--- A\B\C --- perl [ "A\\B\\C" ] # Escapes with whitespace === Multiple escaping of escape with whitespace ok --- yaml --- 'A\B \C' --- perl [ "A\\B \\C" ] === Single Dash --- yaml --- foo: '-' --- perl [ { foo => '-' } ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/scalar.tml000644 000766 000024 00000003520 13041072221 022467 0ustar00etherstaff000000 000000 %PointMarker +++ # Just a scalar === one_scalar +++ yaml --- foo +++ perl [ 'foo' ] === one_scalar2 +++ yaml --- foo +++ perl [ 'foo' ] === two_scalar +++ yaml --- foo --- bar +++ perl [ 'foo', 'bar' ] ##################################################################### # Support for literal multi-line scalars # Declarative multi-line scalar === simple_multiline +++ yaml --- foo: > bar baz +++ perl [ { foo => "bar baz\n" } ] # Piped multi-line scalar === indented +++ yaml --- - | foo bar - 1 +++ perl [ [ "foo\nbar\n", 1 ] ] # ... with a pointless hyphen === indented +++ yaml --- - |- foo bar - 1 +++ perl [ [ "foo\nbar", 1 ] ] ##################################################################### # Hitchhiker Scalar === hitchhiker scalar +++ yaml --- 42 +++ perl [ 42 ] +++ serializes ##################################################################### # Newlines and tabs === special characters +++ yaml foo: "foo\\\n\tbar" +++ perl [ { foo => "foo\\\n\tbar" } ] ##################################################################### # Unprintable Characters === unprintable +++ yaml --- "foo\n\x00" +++ perl [ "foo\n\0" ] ##################################################################### # Ticker #32402 # Tests a particular pathological case === Pathological >< case +++ yaml --- - value - '><' +++ perl [ [ 'value', '><' ] ] ##################################################################### # Special Characters === Special Characters +++ SKIP # Encoding failure +++ yaml --- - "Ingy d\xC3\xB6t Net" +++ perl [ [ "Ingy d\xC3\xB6t Net" ] ] ###################################################################### # Check illegal characters that are in legal places === Bang in a quote +++ yaml --- 'Wow!' +++ perl [ "Wow!" ] === Ampersand in a quote +++ yaml --- 'This&that' +++ perl [ "This&that" ] YAML-Tiny-1.70/t/tml-local/yaml-roundtrip/sequence.tml000644 000766 000024 00000002301 13041072221 023026 0ustar00etherstaff000000 000000 === Empty sequence --- yaml \--- [] --- perl [ [] ] # Simple lists === one_list1 --- yaml --- - foo --- perl [ [ 'foo' ] ] # Implicit document start === implicit_array --- yaml - foo --- perl [ [ 'foo' ] ] === one_list2 --- yaml --- - foo - bar --- perl [ [ 'foo', 'bar' ] ] === one_listundef --- yaml --- - ~ - bar --- perl [ [ undef, 'bar' ] ] === one_listundefs --- noyamlpm --- yaml --- - ~ - - --- perl [ [ undef, undef, undef ] ] ##################################################################### # Empty Values and Premature EOF === empty array keys --- yaml --- - foo - - --- perl [ [ 'foo', undef, undef ] ] --- noyamlpm ##################################################################### # Empty Quote Line === empty quote line --- yaml --- - foo \# - bar --- perl [ [ "foo", "bar" ] ] ##################################################################### # Trailing Whitespace # === trailing whitespace --- yaml --- abstract: Generate fractal curves foo: ~ arr: # THESE LINES HAVE INTENTIONAL TRAILING WHITESPACE - foo - ~ - 'bar' --- perl [ { abstract => 'Generate fractal curves', foo => undef, arr => [ 'foo', undef, 'bar' ], } ] YAML-Tiny-1.70/t/tml-local/perl-to-yaml/quoting.tml000644 000766 000024 00000000531 13041072221 022243 0ustar00etherstaff000000 000000 === Quote boolean-like string (scalar) # Strings that could be confused with booleans should be quoted --- perl [ 'true' ] --- yaml \--- 'true' === Quote boolean-like string (list) --- perl [ [ qw{ null true false } ] ] --- yaml \--- - 'null' - 'true' - 'false' === Quote scalars ending in colon --- perl [ [ 'A:' ] ] --- yaml \--- - 'A:' YAML-Tiny-1.70/t/tml-local/load-warning/document.tml000644 000766 000024 00000000111 13041072221 022425 0ustar00etherstaff000000 000000 === mapping with double key --- yaml foo: 1 foo: 2 --- warning: E_DUPKEY YAML-Tiny-1.70/t/tml-local/load-error/document.tml000644 000766 000024 00000000125 13041072221 022116 0ustar00etherstaff000000 000000 === scalar document followed by mapping --- yaml \--- foo a: 1 --- error: E_CLASSIFY YAML-Tiny-1.70/t/tml-local/load-error/scalar.tml000644 000766 000024 00000001136 13041072221 021550 0ustar00etherstaff000000 000000 === multiline quote --- yaml - 'Multiline quote' --- error: E_FEATURE === dash dash 2 --- yaml - - 2 --- error: E_PLAIN === dash --- yaml foo: - --- error: E_PLAIN === leading ampersand --- yaml foo: @INC --- error: E_PLAIN === leading percent --- yaml foo: %INC --- error: E_PLAIN === trailing colon --- yaml foo: bar: --- error: E_PLAIN === key key value --- yaml foo: bar: baz --- error: E_PLAIN === backticks --- yaml foo: `perl -V` --- error: E_PLAIN === double-dash --- yaml -- --- error: E_PLAIN === multi-line scalar document starting on header --- yaml \--- foo bar --- error: E_CLASSIFY YAML-Tiny-1.70/t/tml-local/load-error/tag.tml000644 000766 000024 00000000221 13041072221 021050 0ustar00etherstaff000000 000000 === version object --- yaml \--- version: !!perl/hash:version original: v2.0.2 qv: 1 version: - 2 - 0 - 2 --- error: E_FEATURE YAML-Tiny-1.70/t/tml-local/dump-error/circular.tml000644 000766 000024 00000000560 13041072221 022135 0ustar00etherstaff000000 000000 === Circular Reference Protection # When we try to serialize, it should NOT infinite loop --- perl $VAR1 = [ { 'a' => 'b', 'c' => [ {}, 2 ] }, [] ]; $VAR1->[0]{'c'}[0] = $VAR1->[0]; $VAR1->[1] = $VAR1->[0]{'c'}; [ $VAR1 ] --- error: E_CIRCULAR YAML-Tiny-1.70/t/lib/SubtestCompat.pm000600 000766 000024 00000003164 13041072221 017527 0ustar00etherstaff000000 000000 use 5.008001; use strict; use warnings; package SubtestCompat; # XXX must be used with no_plan or done_testing use Test::More 0.88; use base 'Exporter'; our @EXPORT; our $INDENT = -2; # intercept 'skip_all' in subtest and turn into a regular skip sub _fake_plan { my ( $self, $cmd, $arg ) = @_; return unless $cmd; if ( $cmd eq 'skip_all' ) { die bless { reason => $arg }, "Subtest::SKIP"; } else { goto &Test::Builder::plan; } } unless ( Test::More->can("subtest") ) { *subtest = sub { my ( $label, $code ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; local $INDENT = $INDENT + 2; $label = "TEST: $label"; my $sep_len = 60 - length($label); note( " " x $INDENT . "$label { " . ( " " x ($sep_len-$INDENT-2) ) ); eval { no warnings 'redefine'; local *Test::Builder::plan = \&_fake_plan; # only want subtest error reporting to look up to the code ref # for where test was called, not further up to *our* callers, # so we *reset* the Level, rather than increment it local $Test::Builder::Level = 1; $code->(); }; if ( my $err = $@ ) { if ( ref($err) eq 'Subtest::SKIP' ) { SKIP: { skip $err->{reason}, 1; } } else { fail("SUBTEST: $label"); diag("Caught exception: $err"); die "$err\n"; } } note( " " x $INDENT . "}" ); }; push @EXPORT, 'subtest'; } 1; YAML-Tiny-1.70/t/lib/TestBridge.pm000600 000766 000024 00000027165 13041072221 016775 0ustar00etherstaff000000 000000 package TestBridge; use strict; use warnings; use lib 't/lib'; use Test::More 0.88; use SubtestCompat; use TestUtils; use TestML::Tiny; BEGIN { $| = 1; binmode(Test::More->builder->$_, ":utf8") for qw/output failure_output todo_output/; } use YAML::Tiny; use Exporter (); our @ISA = qw{ Exporter }; our @EXPORT = qw{ run_all_testml_files run_testml_file test_yaml_roundtrip test_perl_to_yaml test_dump_error test_load_error test_load_warning test_yaml_json test_code_point error_like cmp_deeply _testml_has_points }; # regular expressions for checking error messages; incomplete, but more # can be added as more error messages get test coverage my %ERROR = ( E_CIRCULAR => qr{\QYAML::Tiny does not support circular references}, E_FEATURE => qr{\QYAML::Tiny does not support a feature}, E_PLAIN => qr{\QYAML::Tiny found illegal characters in plain scalar}, E_CLASSIFY => qr{\QYAML::Tiny failed to classify the line}, ); my %WARN = ( E_DUPKEY => qr{\QYAML::Tiny found a duplicate key}, ); # use XXX -with => 'YAML::XS'; #--------------------------------------------------------------------------# # run_all_testml_files # # Iterate over all .tml files in a directory using a particular test bridge # code # reference. Each file is wrapped in a subtest. #--------------------------------------------------------------------------# sub run_all_testml_files { my ($label, $dir, $bridge, @args) = @_; my $code = sub { my ($file, $blocks) = @_; subtest "$label: $file" => sub { $bridge->($_, @args) for @$blocks; }; }; my @files = find_tml_files($dir); run_testml_file($_, $code) for sort @files; } sub run_testml_file { my ($file, $code) = @_; my $blocks = TestML::Tiny->new( testml => $file, version => '0.1.0', )->{function}{data}; $code->($file, $blocks); } # retrieves all the keys in @point from the $block hash, returning them in # order, along with $block->{Label}. # returns false if any keys cannot be found sub _testml_has_points { my ($block, @points) = @_; my @values; for my $point (@points) { defined $block->{$point} or return; push @values, $block->{$point}; } push @values, $block->{Label}; return @values; } #--------------------------------------------------------------------------# # test_yaml_roundtrip # # two blocks: perl, yaml # # Tests that a YAML string loads to the expected perl data. Also, tests # roundtripping from perl->YAML->perl. # # We can't compare the YAML for roundtripping because YAML::Tiny doesn't # preserve order and comments. Therefore, all we can test is that given input # YAML we can produce output YAML that produces the same Perl data as the # input. # # The perl must be an array reference of data to serialize: # # [ $thing1, $thing2, ... ] # # However, if a test point called 'serializes' exists, the output YAML is # expected to match the input YAML and will be checked for equality. #--------------------------------------------------------------------------# sub test_yaml_roundtrip { my ($block) = @_; my ($yaml, $perl, $label) = _testml_has_points($block, qw(yaml perl)) or return; my %options = (); for (qw(serializes)) { if (defined($block->{$_})) { $options{$_} = 1; } } my $expected = eval $perl; die $@ if $@; bless $expected, 'YAML::Tiny'; subtest $label, sub { # Does the string parse to the structure my $yaml_copy = $yaml; my $got = eval { YAML::Tiny->read_string( $yaml_copy ); }; is( $@, '', "YAML::Tiny parses without error" ); is( $yaml_copy, $yaml, "YAML::Tiny does not modify the input string" ); SKIP: { skip( "Shortcutting after failure", 2 ) if $@; isa_ok( $got, 'YAML::Tiny' ); cmp_deeply( $got, $expected, "YAML::Tiny parses correctly" ) or diag "ERROR: $YAML::Tiny::errstr\n\nYAML:$yaml"; } # Does the structure serialize to the string. # We can't test this by direct comparison, because any # whitespace or comments would be lost. # So instead we parse back in. my $output = eval { $expected->write_string }; is( $@, '', "YAML::Tiny serializes without error" ); SKIP: { skip( "Shortcutting after failure", 5 ) if $@; ok( !!(defined $output and ! ref $output), "YAML::Tiny serializes to scalar", ); my $roundtrip = eval { YAML::Tiny->read_string( $output ) }; is( $@, '', "YAML::Tiny round-trips without error" ); skip( "Shortcutting after failure", 2 ) if $@; isa_ok( $roundtrip, 'YAML::Tiny' ); cmp_deeply( $roundtrip, $expected, "YAML::Tiny round-trips correctly" ); # Testing the serialization skip( "Shortcutting perfect serialization tests", 1 ) unless $options{serializes}; is( $output, $yaml, 'Serializes ok' ); } }; } #--------------------------------------------------------------------------# # test_perl_to_yaml # # two blocks: perl, yaml # # Tests that perl references serialize correctly to a specific YAML output # # The perl must be an array reference of data to serialize: # # [ $thing1, $thing2, ... ] #--------------------------------------------------------------------------# sub test_perl_to_yaml { my ($block) = @_; my ($perl, $yaml, $label) = _testml_has_points($block, qw(perl yaml)) or return; my $input = eval "no strict; $perl"; die $@ if $@; subtest $label, sub { my $result = eval { YAML::Tiny->new( @$input )->write_string }; is( $@, '', "write_string lives" ); is( $result, $yaml, "dumped YAML correct" ); }; } #--------------------------------------------------------------------------# # test_dump_error # # two blocks: perl, error # # Tests that perl references result in an error when dumped # # The perl must be an array reference of data to serialize: # # [ $thing1, $thing2, ... ] # # The error must be a key in the %ERROR hash in this file #--------------------------------------------------------------------------# sub test_dump_error { my ($block) = @_; my ($perl, $error, $label) = _testml_has_points($block, qw(perl error)) or return; my $input = eval "no strict; $perl"; die $@ if $@; chomp $error; my $expected = $ERROR{$error}; subtest $label, sub { my $result = eval { YAML::Tiny->new( @$input )->write_string }; ok( !$result, "returned false" ); error_like( $expected, "Got expected error" ); }; } #--------------------------------------------------------------------------# # test_load_error # # two blocks: yaml, error # # Tests that a YAML string results in an error when loaded # # The error must be a key in the %ERROR hash in this file #--------------------------------------------------------------------------# sub test_load_error { my ($block) = @_; my ($yaml, $error, $label) = _testml_has_points($block, qw(yaml error)) or return; chomp $error; my $expected = $ERROR{$error}; subtest $label, sub { my $result = eval { YAML::Tiny->read_string( $yaml ) }; is( $result, undef, 'read_string returns undef' ); error_like( $expected, "Got expected error" ) or diag "YAML:\n$yaml"; }; } #--------------------------------------------------------------------------# # test_load_warning # # two blocks: yaml, warning # # Tests that a YAML string results in warning when loaded # # The warning must be a key in the %WARN hash in this file #--------------------------------------------------------------------------# sub test_load_warning { my ($block) = @_; my ($yaml, $warning, $label) = _testml_has_points($block, qw(yaml warning)) or return; chomp $warning; my $expected = $WARN{$warning}; subtest $label, sub { # this is not in a sub like warning_like because of the danger of # matching the regex parameter against something earlier in the stack my @warnings; local $SIG{__WARN__} = sub { push @warnings, shift; }; my $result = eval { YAML::Tiny->read_string( $yaml ) }; is(scalar(@warnings), 1, 'got exactly one warning'); like( $warnings[0], $expected, 'Got expected warning', ) or diag "YAML:\n$yaml\n", 'warning: ', explain(\@warnings); }; } #--------------------------------------------------------------------------# # test_yaml_json # # two blocks: yaml, json # # Tests that a YAML string can be loaded to Perl and dumped to JSON and # match an expected JSON output. The expected JSON is loaded and dumped # to ensure similar JSON dump options. #--------------------------------------------------------------------------# sub test_yaml_json { my ($block, $json_lib) = @_; $json_lib ||= do { require JSON::PP; 'JSON::PP' }; my ($yaml, $json, $label) = _testml_has_points($block, qw(yaml json)) or return; subtest "$label", sub { # test YAML Load my $object = eval { YAML::Tiny::Load($yaml); }; my $err = $@; ok !$err, "YAML loads"; return if $err; # test YAML->Perl->JSON # N.B. round-trip JSON to decode any \uNNNN escapes and get to # characters my $want = $json_lib->new->encode( $json_lib->new->decode($json) ); my $got = $json_lib->new->encode($object); is $got, $want, "Load is accurate"; }; } #--------------------------------------------------------------------------# # test_code_point # # two blocks: code, yaml # # Tests that a Unicode codepoint is correctly dumped to YAML as both # key and value. # # The code test point must be a non-negative integer # # The yaml code point is the expected output of { $key => $value } where # both key and value are the character represented by the codepoint. #--------------------------------------------------------------------------# sub test_code_point { my ($block) = @_; my ($code, $yaml, $label) = _testml_has_points($block, qw(code yaml)) or return; subtest "$label - Unicode map key/value test" => sub { my $data = { chr($code) => chr($code) }; my $dump = YAML::Tiny::Dump($data); $dump =~ s/^---\n//; is $dump, $yaml, "Dump key and value of code point char $code"; my $yny = YAML::Tiny::Dump(YAML::Tiny::Load($yaml)); $yny =~ s/^---\n//; is $yny, $yaml, "YAML for code point $code YNY roundtrips"; my $nyn = YAML::Tiny::Load(YAML::Tiny::Dump($data)); cmp_deeply( $nyn, $data, "YAML for code point $code NYN roundtrips" ); } } #--------------------------------------------------------------------------# # error_like # # Test YAML::Tiny->errstr against a regular expression and clear the # errstr afterwards #--------------------------------------------------------------------------# sub error_like { my ($regex, $label) = @_; $label = "Got expected error" unless defined $label; local $Test::Builder::Level = $Test::Builder::Level + 1; my $ok = like( $@, $regex, $label ); return $ok; } #--------------------------------------------------------------------------# # cmp_deeply # # is_deeply with some better diagnostics #--------------------------------------------------------------------------# sub cmp_deeply { my ($got, $want, $label) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; is_deeply( $got, $want, $label ) or diag "GOT:\n", explain($got), "\nWANTED:\n", explain($want); } 1; YAML-Tiny-1.70/t/lib/TestML/000700 000766 000024 00000000000 13041072221 015536 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/t/lib/TestUtils.pm000644 000766 000024 00000002064 13041072221 016700 0ustar00etherstaff000000 000000 package TestUtils; use strict; use warnings; use Exporter (); use File::Spec (); use File::Find (); our @ISA = qw{ Exporter }; our @EXPORT = qw{ find_tml_files json_class slurp test_data_directory test_data_file }; sub find_tml_files { my $dir = shift; my @files; File::Find::find( sub { push @files, $File::Find::name if -f and /\.tml$/ }, $dir ); return @files; } sub json_class { return eval { require JSON::MaybeXS; JSON::MaybeXS->VERSION('1.001000'); $JSON::MaybeXS::JSON_Class } || do { require JSON::PP; 'JSON::PP' }; } sub test_data_directory { return File::Spec->catdir( 't', 'data' ); } sub test_data_file { return File::Spec->catfile( test_data_directory(), shift ); } sub slurp { my $file = shift; local $/ = undef; open( FILE, " $file" ) or die "open($file) failed: $!"; binmode( FILE, $_[0] ) if @_ > 0; # binmode(FILE); # disable perl's BOM interpretation my $source = ; close( FILE ) or die "close($file) failed: $!"; $source; } 1; YAML-Tiny-1.70/t/lib/TestML/Tiny.pm000600 000766 000024 00000023750 13041072221 017030 0ustar00etherstaff000000 000000 use 5.008001; use strict; use warnings; package TestML::Tiny; $TestML::Tiny::VERSION = 0.000001; use Carp(); use Test::More 0.88 (); # use XXX; sub import { strict->import; warnings->import; } sub new { my $self = bless { @_[1..$#_] }, $_[0]; my $testml = $self->_get_testml; my $bridge = $self->_get_bridge; $self->{runtime} ||= TestML::Tiny::Runtime->new( bridge => $bridge, ); my $compiler = TestML::Tiny::Compiler->new( $self->{version} ? (version => $self->{version}) : (), ); $self->{function} = $compiler->compile($testml); return $self; } sub run { my ($self) = @_; my $runtime = $self->{runtime} || ''; Carp::croak "Missing or invalid runtime object for TestML::Tiny::run()" unless defined($runtime) and ref($runtime) eq 'TestML::Tiny::Runtime'; $runtime->run; } sub _get_testml { my ($self) = @_; my $testml = $self->{testml} or Carp::croak "TestML object requires a testml attribute"; $testml = $self->_slurp($testml) if $testml !~ /\n/; return $testml; } sub _get_bridge { my ($self) = @_; my $bridge = $self->{bridge} || 'main'; return $bridge if ref $bridge; eval "require $bridge"; Carp::croak $@ if $@ and $@ !~ /^Can't locate /; return ( defined(&{"${bridge}::new"}) ? $bridge->new : bless {}, $bridge ); } sub _slurp { open my $fh, "<:raw:encoding(UTF-8)", $_[1] or die "Can't open $_[1] for input"; local $/; <$fh>; } #------------------------------------------------------------------------------ =comment ::Runtime -- Run a TestML Function The TestML Code and Data get compiled into a Function, and the Function is run by this Runtime class. Typically data is manipulated by Bridge functions, and at some point Assertions are made. The assertions are the things that call Test::More::is and Test::More::ok. =cut package TestML::Tiny::Runtime; # use XXX; sub new { my $self = $TestML::Tiny::Runtime::Singleton = bless { @_[1..$#_] }, $_[0]; }; sub run { Test::More::fail 'not done yet!'; Test::More::done_testing; } #------------------------------------------------------------------------------ =comment ::Compiler -- Turn a TestML document into a runnable TestML Function. A TestML "document" is comprised of 3 main parts: Meta, Code, Data. This information often is in a single TestML (.tml) file or string, but it doesn't need to be. The information can come from anywhere and be in any form that is supported; it just must all be present when it is needed. The Meta information must be known first. It dictates where the Code and Data come from, and in what format they are. Also the Code and Data formats depend on the TestML API Version that is supplied. Before the Code and Data can be compiled, a Version must be supplied (no default) and then the compiler must support that Version. This allows TestML to change over time with no confusion. The compile function returns a Function object, which in turn contains an array of Statements and an array of Data Blocks. This function is the run by the Runtime object. =cut package TestML::Tiny::Compiler; # use XXX; my $ID = qr/\w+/; my $SP = qr/[\ \t]/; my $LINE = qr/.*$/m; my $DIRECTIVE = qr/^%($ID)$SP+($LINE)/m; sub new { my $self = bless { @_[1..$#_] }, $_[0]; } sub runtime { $TestML::Tiny::Runtime::Singleton; } sub compile { my ($self, $testml) = @_; my $function = $self->{function} = TestML::Tiny::Function->new; $self->{testml} = $testml; $self->preprocess; my $version = $self->check_version; my ($code_syntax, $data_syntax) = @{$self}{qw(code_syntax data_syntax)}; my $code_method = "compile_code_${code_syntax}_$version"; Carp::croak "Don't know how to compile TestML '$code_syntax' code" unless $self->can($code_method); my $data_method = "compile_data_${data_syntax}_$version"; Carp::croak "Don't know how to compile TestML '$data_syntax' data" unless $self->can($data_method); $function->{statements} = $self->$code_method; $function->{data} = $self->$data_method; return $function; } my %directives = ( code_syntax => 'tiny', data_syntax => 'testml', data_marker => '===', block_marker => '===', point_marker => '---', ); sub preprocess { my ($self) = @_; my $version = $self->{version} || undef; my $testml = $self->{testml}; my $directives = [ $testml =~ /$DIRECTIVE/gm ]; $testml =~ s/($DIRECTIVE)/#$1/g; while (@$directives) { my ($key, $value) = splice(@$directives, 0, 2); if ($key eq "TestML") { $self->check_not_set_and_set($key, $value, 'version'); } elsif ($key eq "BlockMarker") { $self->check_not_set_and_set( 'BlockMarker', $value, 'block_marker' ); ($self->{block_marker} = $value) =~ s/([\*\^\$\+\?\(\)\.])/\\$1/g; } elsif ($key eq "PointMarker") { $self->check_not_set_and_set( 'PointMarker', $value, 'point_marker' ); ($self->{point_marker} = $value) =~ s/([\*\^\$\+\?\(\)\.])/\\$1/g; } elsif ($key eq "CodeSyntax") { die "Untested"; $self->check_not_set_and_set( 'CodeSyntax', $value, 'code_syntax' ); $self->{code_syntax} = $value; } elsif ($key eq "DataSyntax") { die "Untested"; $self->check_not_set_and_set( 'DataSyntax', $value, 'data_syntax' ); $self->{data_syntax} = $value; } else { Carp::croak "Unknown TestML directive: '%$key'"; } } $self->{data_marker} = $self->{block_marker} if not($self->{data_marker}) and $self->{block_marker}; for my $directive (keys %directives) { $self->{$directive} ||= $directives{$directive}; } ($self->{code}, $self->{data}) = ($testml =~ /(.*?)(^$self->{data_marker}.*)/msg); $self->{code} ||= ''; $self->{data} ||= ''; } sub check_not_set_and_set { my ($self, $key, $value, $attr) = @_; if (defined $self->{$attr} and $self->{$attr} ne $value) { Carp::croak "Can't set TestML '$key' directive to '$value'. " . "Already set to '$self->{$attr}'"; } $self->{$attr} = $value; } sub check_version { my ($self) = @_; my $version = $self->{version} || undef; Carp::croak "TestML syntax version not defined. Cannot continue" unless defined $version; Carp::croak "Invalid value for TestML version '$version'. Must be 0.1.0" unless $version eq '0.1.0'; $version =~ s/\./_/g; return $version; } sub compile_code_tiny_0_1_0 { my ($self) = @_; my $num = 1; [ grep { not /(^#|^\s*$)/ } split /\n/, $self->{code} ]; } sub compile_data_testml_0_1_0 { my ($self) = @_; my $lines = [ grep { ! /^#/ } split /\n/, $self->{data} ]; my $blocks = []; my $parse = []; push @$lines, undef; # sentinel while (@$lines) { push @$parse, shift @$lines; if (!defined($lines->[0]) or $lines->[0] =~ /^$self->{block_marker}/ ) { my $block = $self->_parse_testml_block($parse); push @$blocks, $block unless exists $block->{SKIP}; last if exists $block->{LAST}; $parse = []; # clear for next parse } last if !defined($lines->[0]); } my $only = [ grep { exists $_->{ONLY} } @$blocks ]; return @$only ? $only : $blocks; } sub _parse_testml_block { my ($self, $lines) = @_; my ($label) = $lines->[0] =~ /^$self->{block_marker}(?:\s+(.*))?$/; shift @$lines until not(@$lines) or $lines->[0] =~ /^$self->{point_marker} +\w+/; my $block = $self->_parse_testml_points($lines); $block->{Label} = $label || ''; return $block; } sub _parse_testml_points { my ($self, $lines) = @_; my $block = {}; while (@$lines) { my $line = shift @$lines; $line =~ /^$self->{point_marker} +(\w+)/ or die "Invalid TestML line:\n'$line'"; my $point_name = $1; die "$block repeats $point_name" if exists $block->{$point_name}; $block->{$point_name} = ''; if ($line =~ /^$self->{point_marker} +(\w+): +(.*?) *$/) { ($block->{$1} = $2) =~ s/^ *(.*?) *$/$1/; shift @$lines while @$lines and $lines->[0] !~ /^$self->{point_marker} +(\w)/; } elsif ($line =~ /^$self->{point_marker} +(\w+)$/) { $point_name = $1; while ( @$lines ) { $line = shift @$lines; if ($line =~ /^$self->{point_marker} \w+/) { unshift @$lines, $line; last; } $block->{$point_name} .= "$line\n"; } $block->{$point_name} =~ s/\n\s*\z/\n/; $block->{$point_name} =~ s/^\\//gm; } else { die "Invalid TestML line:\n'$line'"; } } return $block; } #------------------------------------------------------------------------------ =comment A Function is just an array of "executable" statements that are proceseded in order. Some of the statements maybe be function declarations and function calls. The Compiler produces a top level scope function, with a Data set, and a Namespace for variables. All functions are anonymous, but they can be assigned to variables, and then you can call that variable name. =cut package TestML::Tiny::Function; sub new { my $self = bless { statements => [], data => [], namespace => {}, }, $_[0]; } #------------------------------------------------------------------------------ package TestML::Tiny::Bridge; sub new { my $self = bless { @_[1..$#_] }, $_[0]; } #------------------------------------------------------------------------------ package TestML::Tiny::Library::Standard; sub new { my $self = bless { @_[1..$#_] }, $_[0]; } 1; YAML-Tiny-1.70/t/data/ascii.yml000644 000766 000024 00000000012 13041072221 016347 0ustar00etherstaff000000 000000 --- - foo YAML-Tiny-1.70/t/data/latin1.yml000644 000766 000024 00000001114 13041072221 016453 0ustar00etherstaff000000 000000 --- invoice: 34843 date : 2001-01-23 bill-to: given : Chris family : Dumrs address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 product: - sku : BL394D quantity : 4 description : Basketball price : 450.00 - sku : BL4438H quantity : 1 description : Super Hoop price : 2392.00 tax : 251.42 total: 4443.52 comments: > Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. YAML-Tiny-1.70/t/data/multibyte.yml000644 000766 000024 00000000072 13041072221 017303 0ustar00etherstaff000000 000000 --- author: "Ævar Arnfjörð Bjarmason " YAML-Tiny-1.70/t/data/utf_16_le_bom.yml000644 000766 000024 00000000026 13041072221 017705 0ustar00etherstaff000000 000000 --- - foo YAML-Tiny-1.70/t/data/utf_8_bom.yml000644 000766 000024 00000000075 13041072221 017152 0ustar00etherstaff000000 000000 --- author: "Ævar Arnfjörð Bjarmason " YAML-Tiny-1.70/lib/YAML/000700 000766 000024 00000000000 13041072221 014665 5ustar00etherstaff000000 000000 YAML-Tiny-1.70/lib/YAML/Tiny.pm000600 000766 000024 00000123147 13041072221 016160 0ustar00etherstaff000000 000000 use 5.008001; # sane UTF-8 support use strict; use warnings; package YAML::Tiny; # git description: v1.69-8-g2c1e266 # XXX-INGY is 5.8.1 too old/broken for utf8? # XXX-XDG Lancaster consensus was that it was sufficient until # proven otherwise our $VERSION = '1.70'; ##################################################################### # The YAML::Tiny API. # # These are the currently documented API functions/methods and # exports: use Exporter; our @ISA = qw{ Exporter }; our @EXPORT = qw{ Load Dump }; our @EXPORT_OK = qw{ LoadFile DumpFile freeze thaw }; ### # Functional/Export API: sub Dump { return YAML::Tiny->new(@_)->_dump_string; } # XXX-INGY Returning last document seems a bad behavior. # XXX-XDG I think first would seem more natural, but I don't know # that it's worth changing now sub Load { my $self = YAML::Tiny->_load_string(@_); if ( wantarray ) { return @$self; } else { # To match YAML.pm, return the last document return $self->[-1]; } } # XXX-INGY Do we really need freeze and thaw? # XXX-XDG I don't think so. I'd support deprecating them. BEGIN { *freeze = \&Dump; *thaw = \&Load; } sub DumpFile { my $file = shift; return YAML::Tiny->new(@_)->_dump_file($file); } sub LoadFile { my $file = shift; my $self = YAML::Tiny->_load_file($file); if ( wantarray ) { return @$self; } else { # Return only the last document to match YAML.pm, return $self->[-1]; } } ### # Object Oriented API: # Create an empty YAML::Tiny object # XXX-INGY Why do we use ARRAY object? # NOTE: I get it now, but I think it's confusing and not needed. # Will change it on a branch later, for review. # # XXX-XDG I don't support changing it yet. It's a very well-documented # "API" of YAML::Tiny. I'd support deprecating it, but Adam suggested # we not change it until YAML.pm's own OO API is established so that # users only have one API change to digest, not two sub new { my $class = shift; bless [ @_ ], $class; } # XXX-INGY It probably doesn't matter, and it's probably too late to # change, but 'read/write' are the wrong names. Read and Write # are actions that take data from storage to memory # characters/strings. These take the data to/from storage to native # Perl objects, which the terms dump and load are meant. As long as # this is a legacy quirk to YAML::Tiny it's ok, but I'd prefer not # to add new {read,write}_* methods to this API. sub read_string { my $self = shift; $self->_load_string(@_); } sub write_string { my $self = shift; $self->_dump_string(@_); } sub read { my $self = shift; $self->_load_file(@_); } sub write { my $self = shift; $self->_dump_file(@_); } ##################################################################### # Constants # Printed form of the unprintable characters in the lowest range # of ASCII characters, listed by ASCII ordinal position. my @UNPRINTABLE = qw( 0 x01 x02 x03 x04 x05 x06 a b t n v f r x0E x0F x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x1A e x1C x1D x1E x1F ); # Printable characters for escapes my %UNESCAPES = ( 0 => "\x00", z => "\x00", N => "\x85", a => "\x07", b => "\x08", t => "\x09", n => "\x0a", v => "\x0b", f => "\x0c", r => "\x0d", e => "\x1b", '\\' => '\\', ); # XXX-INGY # I(ngy) need to decide if these values should be quoted in # YAML::Tiny or not. Probably yes. # These 3 values have special meaning when unquoted and using the # default YAML schema. They need quotes if they are strings. my %QUOTE = map { $_ => 1 } qw{ null true false }; # The commented out form is simpler, but overloaded the Perl regex # engine due to recursion and backtracking problems on strings # larger than 32,000ish characters. Keep it for reference purposes. # qr/\"((?:\\.|[^\"])*)\"/ my $re_capture_double_quoted = qr/\"([^\\"]*(?:\\.[^\\"]*)*)\"/; my $re_capture_single_quoted = qr/\'([^\']*(?:\'\'[^\']*)*)\'/; # unquoted re gets trailing space that needs to be stripped my $re_capture_unquoted_key = qr/([^:]+(?::+\S(?:[^:]*|.*?(?=:)))*)(?=\s*\:(?:\s+|$))/; my $re_trailing_comment = qr/(?:\s+\#.*)?/; my $re_key_value_separator = qr/\s*:(?:\s+(?:\#.*)?|$)/; ##################################################################### # YAML::Tiny Implementation. # # These are the private methods that do all the work. They may change # at any time. ### # Loader functions: # Create an object from a file sub _load_file { my $class = ref $_[0] ? ref shift : shift; # Check the file my $file = shift or $class->_error( 'You did not specify a file name' ); $class->_error( "File '$file' does not exist" ) unless -e $file; $class->_error( "'$file' is a directory, not a file" ) unless -f _; $class->_error( "Insufficient permissions to read '$file'" ) unless -r _; # Open unbuffered with strict UTF-8 decoding and no translation layers open( my $fh, "<:unix:encoding(UTF-8)", $file ); unless ( $fh ) { $class->_error("Failed to open file '$file': $!"); } # flock if available (or warn if not possible for OS-specific reasons) if ( _can_flock() ) { flock( $fh, Fcntl::LOCK_SH() ) or warn "Couldn't lock '$file' for reading: $!"; } # slurp the contents my $contents = eval { use warnings FATAL => 'utf8'; local $/; <$fh> }; if ( my $err = $@ ) { $class->_error("Error reading from file '$file': $err"); } # close the file (release the lock) unless ( close $fh ) { $class->_error("Failed to close file '$file': $!"); } $class->_load_string( $contents ); } # Create an object from a string sub _load_string { my $class = ref $_[0] ? ref shift : shift; my $self = bless [], $class; my $string = $_[0]; eval { unless ( defined $string ) { die \"Did not provide a string to load"; } # Check if Perl has it marked as characters, but it's internally # inconsistent. E.g. maybe latin1 got read on a :utf8 layer if ( utf8::is_utf8($string) && ! utf8::valid($string) ) { die \<<'...'; Read an invalid UTF-8 string (maybe mixed UTF-8 and 8-bit character set). Did you decode with lax ":utf8" instead of strict ":encoding(UTF-8)"? ... } # Ensure Unicode character semantics, even for 0x80-0xff utf8::upgrade($string); # Check for and strip any leading UTF-8 BOM $string =~ s/^\x{FEFF}//; # Check for some special cases return $self unless length $string; # Split the file into lines my @lines = grep { ! /^\s*(?:\#.*)?\z/ } split /(?:\015{1,2}\012|\015|\012)/, $string; # Strip the initial YAML header @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines; # A nibbling parser my $in_document = 0; while ( @lines ) { # Do we have a document header? if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) { # Handle scalar documents shift @lines; if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) { push @$self, $self->_load_scalar( "$1", [ undef ], \@lines ); next; } $in_document = 1; } if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) { # A naked document push @$self, undef; while ( @lines and $lines[0] !~ /^---/ ) { shift @lines; } $in_document = 0; # XXX The final '-+$' is to look for -- which ends up being an # error later. } elsif ( ! $in_document && @$self ) { # only the first document can be explicit die \"YAML::Tiny failed to classify the line '$lines[0]'"; } elsif ( $lines[0] =~ /^\s*\-(?:\s|$|-+$)/ ) { # An array at the root my $document = [ ]; push @$self, $document; $self->_load_array( $document, [ 0 ], \@lines ); } elsif ( $lines[0] =~ /^(\s*)\S/ ) { # A hash at the root my $document = { }; push @$self, $document; $self->_load_hash( $document, [ length($1) ], \@lines ); } else { # Shouldn't get here. @lines have whitespace-only lines # stripped, and previous match is a line with any # non-whitespace. So this clause should only be reachable via # a perlbug where \s is not symmetric with \S # uncoverable statement die \"YAML::Tiny failed to classify the line '$lines[0]'"; } } }; my $err = $@; if ( ref $err eq 'SCALAR' ) { $self->_error(${$err}); } elsif ( $err ) { $self->_error($err); } return $self; } sub _unquote_single { my ($self, $string) = @_; return '' unless length $string; $string =~ s/\'\'/\'/g; return $string; } sub _unquote_double { my ($self, $string) = @_; return '' unless length $string; $string =~ s/\\"/"/g; $string =~ s{\\([Nnever\\fartz0b]|x([0-9a-fA-F]{2}))} {(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}}gex; return $string; } # Load a YAML scalar string to the actual Perl scalar sub _load_scalar { my ($self, $string, $indent, $lines) = @_; # Trim trailing whitespace $string =~ s/\s*\z//; # Explitic null/undef return undef if $string eq '~'; # Single quote if ( $string =~ /^$re_capture_single_quoted$re_trailing_comment\z/ ) { return $self->_unquote_single($1); } # Double quote. if ( $string =~ /^$re_capture_double_quoted$re_trailing_comment\z/ ) { return $self->_unquote_double($1); } # Special cases if ( $string =~ /^[\'\"!&]/ ) { die \"YAML::Tiny does not support a feature in line '$string'"; } return {} if $string =~ /^{}(?:\s+\#.*)?\z/; return [] if $string =~ /^\[\](?:\s+\#.*)?\z/; # Regular unquoted string if ( $string !~ /^[>|]/ ) { die \"YAML::Tiny found illegal characters in plain scalar: '$string'" if $string =~ /^(?:-(?:\s|$)|[\@\%\`])/ or $string =~ /:(?:\s|$)/; $string =~ s/\s+#.*\z//; return $string; } # Error die \"YAML::Tiny failed to find multi-line scalar content" unless @$lines; # Check the indent depth $lines->[0] =~ /^(\s*)/; $indent->[-1] = length("$1"); if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) { die \"YAML::Tiny found bad indenting in line '$lines->[0]'"; } # Pull the lines my @multiline = (); while ( @$lines ) { $lines->[0] =~ /^(\s*)/; last unless length($1) >= $indent->[-1]; push @multiline, substr(shift(@$lines), length($1)); } my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n"; my $t = (substr($string, 1, 1) eq '-') ? '' : "\n"; return join( $j, @multiline ) . $t; } # Load an array sub _load_array { my ($self, $array, $indent, $lines) = @_; while ( @$lines ) { # Check for a new document if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { while ( @$lines and $lines->[0] !~ /^---/ ) { shift @$lines; } return 1; } # Check the indent level $lines->[0] =~ /^(\s*)/; if ( length($1) < $indent->[-1] ) { return 1; } elsif ( length($1) > $indent->[-1] ) { die \"YAML::Tiny found bad indenting in line '$lines->[0]'"; } if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) { # Inline nested hash my $indent2 = length("$1"); $lines->[0] =~ s/-/ /; push @$array, { }; $self->_load_hash( $array->[-1], [ @$indent, $indent2 ], $lines ); } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) { shift @$lines; unless ( @$lines ) { push @$array, undef; return 1; } if ( $lines->[0] =~ /^(\s*)\-/ ) { my $indent2 = length("$1"); if ( $indent->[-1] == $indent2 ) { # Null array entry push @$array, undef; } else { # Naked indenter push @$array, [ ]; $self->_load_array( $array->[-1], [ @$indent, $indent2 ], $lines ); } } elsif ( $lines->[0] =~ /^(\s*)\S/ ) { push @$array, { }; $self->_load_hash( $array->[-1], [ @$indent, length("$1") ], $lines ); } else { die \"YAML::Tiny failed to classify line '$lines->[0]'"; } } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) { # Array entry with a value shift @$lines; push @$array, $self->_load_scalar( "$2", [ @$indent, undef ], $lines ); } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) { # This is probably a structure like the following... # --- # foo: # - list # bar: value # # ... so lets return and let the hash parser handle it return 1; } else { die \"YAML::Tiny failed to classify line '$lines->[0]'"; } } return 1; } # Load a hash sub _load_hash { my ($self, $hash, $indent, $lines) = @_; while ( @$lines ) { # Check for a new document if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { while ( @$lines and $lines->[0] !~ /^---/ ) { shift @$lines; } return 1; } # Check the indent level $lines->[0] =~ /^(\s*)/; if ( length($1) < $indent->[-1] ) { return 1; } elsif ( length($1) > $indent->[-1] ) { die \"YAML::Tiny found bad indenting in line '$lines->[0]'"; } # Find the key my $key; # Quoted keys if ( $lines->[0] =~ s/^\s*$re_capture_single_quoted$re_key_value_separator// ) { $key = $self->_unquote_single($1); } elsif ( $lines->[0] =~ s/^\s*$re_capture_double_quoted$re_key_value_separator// ) { $key = $self->_unquote_double($1); } elsif ( $lines->[0] =~ s/^\s*$re_capture_unquoted_key$re_key_value_separator// ) { $key = $1; $key =~ s/\s+$//; } elsif ( $lines->[0] =~ /^\s*\?/ ) { die \"YAML::Tiny does not support a feature in line '$lines->[0]'"; } else { die \"YAML::Tiny failed to classify line '$lines->[0]'"; } if ( exists $hash->{$key} ) { warn "YAML::Tiny found a duplicate key '$key' in line '$lines->[0]'"; } # Do we have a value? if ( length $lines->[0] ) { # Yes $hash->{$key} = $self->_load_scalar( shift(@$lines), [ @$indent, undef ], $lines ); } else { # An indent shift @$lines; unless ( @$lines ) { $hash->{$key} = undef; return 1; } if ( $lines->[0] =~ /^(\s*)-/ ) { $hash->{$key} = []; $self->_load_array( $hash->{$key}, [ @$indent, length($1) ], $lines ); } elsif ( $lines->[0] =~ /^(\s*)./ ) { my $indent2 = length("$1"); if ( $indent->[-1] >= $indent2 ) { # Null hash entry $hash->{$key} = undef; } else { $hash->{$key} = {}; $self->_load_hash( $hash->{$key}, [ @$indent, length($1) ], $lines ); } } } } return 1; } ### # Dumper functions: # Save an object to a file sub _dump_file { my $self = shift; require Fcntl; # Check the file my $file = shift or $self->_error( 'You did not specify a file name' ); my $fh; # flock if available (or warn if not possible for OS-specific reasons) if ( _can_flock() ) { # Open without truncation (truncate comes after lock) my $flags = Fcntl::O_WRONLY()|Fcntl::O_CREAT(); sysopen( $fh, $file, $flags ) or $self->_error("Failed to open file '$file' for writing: $!"); # Use no translation and strict UTF-8 binmode( $fh, ":raw:encoding(UTF-8)"); flock( $fh, Fcntl::LOCK_EX() ) or warn "Couldn't lock '$file' for reading: $!"; # truncate and spew contents truncate $fh, 0; seek $fh, 0, 0; } else { open $fh, ">:unix:encoding(UTF-8)", $file; } # serialize and spew to the handle print {$fh} $self->_dump_string; # close the file (release the lock) unless ( close $fh ) { $self->_error("Failed to close file '$file': $!"); } return 1; } # Save an object to a string sub _dump_string { my $self = shift; return '' unless ref $self && @$self; # Iterate over the documents my $indent = 0; my @lines = (); eval { foreach my $cursor ( @$self ) { push @lines, '---'; # An empty document if ( ! defined $cursor ) { # Do nothing # A scalar document } elsif ( ! ref $cursor ) { $lines[-1] .= ' ' . $self->_dump_scalar( $cursor ); # A list at the root } elsif ( ref $cursor eq 'ARRAY' ) { unless ( @$cursor ) { $lines[-1] .= ' []'; next; } push @lines, $self->_dump_array( $cursor, $indent, {} ); # A hash at the root } elsif ( ref $cursor eq 'HASH' ) { unless ( %$cursor ) { $lines[-1] .= ' {}'; next; } push @lines, $self->_dump_hash( $cursor, $indent, {} ); } else { die \("Cannot serialize " . ref($cursor)); } } }; if ( ref $@ eq 'SCALAR' ) { $self->_error(${$@}); } elsif ( $@ ) { $self->_error($@); } join '', map { "$_\n" } @lines; } sub _has_internal_string_value { my $value = shift; my $b_obj = B::svref_2object(\$value); # for round trip problem return $b_obj->FLAGS & B::SVf_POK(); } sub _dump_scalar { my $string = $_[1]; my $is_key = $_[2]; # Check this before checking length or it winds up looking like a string! my $has_string_flag = _has_internal_string_value($string); return '~' unless defined $string; return "''" unless length $string; if (Scalar::Util::looks_like_number($string)) { # keys and values that have been used as strings get quoted if ( $is_key || $has_string_flag ) { return qq['$string']; } else { return $string; } } if ( $string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/ ) { $string =~ s/\\/\\\\/g; $string =~ s/"/\\"/g; $string =~ s/\n/\\n/g; $string =~ s/[\x85]/\\N/g; $string =~ s/([\x00-\x1f])/\\$UNPRINTABLE[ord($1)]/g; $string =~ s/([\x7f-\x9f])/'\x' . sprintf("%X",ord($1))/ge; return qq|"$string"|; } if ( $string =~ /(?:^[~!@#%&*|>?:,'"`{}\[\]]|^-+$|\s|:\z)/ or $QUOTE{$string} ) { return "'$string'"; } return $string; } sub _dump_array { my ($self, $array, $indent, $seen) = @_; if ( $seen->{refaddr($array)}++ ) { die \"YAML::Tiny does not support circular references"; } my @lines = (); foreach my $el ( @$array ) { my $line = (' ' x $indent) . '-'; my $type = ref $el; if ( ! $type ) { $line .= ' ' . $self->_dump_scalar( $el ); push @lines, $line; } elsif ( $type eq 'ARRAY' ) { if ( @$el ) { push @lines, $line; push @lines, $self->_dump_array( $el, $indent + 1, $seen ); } else { $line .= ' []'; push @lines, $line; } } elsif ( $type eq 'HASH' ) { if ( keys %$el ) { push @lines, $line; push @lines, $self->_dump_hash( $el, $indent + 1, $seen ); } else { $line .= ' {}'; push @lines, $line; } } else { die \"YAML::Tiny does not support $type references"; } } @lines; } sub _dump_hash { my ($self, $hash, $indent, $seen) = @_; if ( $seen->{refaddr($hash)}++ ) { die \"YAML::Tiny does not support circular references"; } my @lines = (); foreach my $name ( sort keys %$hash ) { my $el = $hash->{$name}; my $line = (' ' x $indent) . $self->_dump_scalar($name, 1) . ":"; my $type = ref $el; if ( ! $type ) { $line .= ' ' . $self->_dump_scalar( $el ); push @lines, $line; } elsif ( $type eq 'ARRAY' ) { if ( @$el ) { push @lines, $line; push @lines, $self->_dump_array( $el, $indent + 1, $seen ); } else { $line .= ' []'; push @lines, $line; } } elsif ( $type eq 'HASH' ) { if ( keys %$el ) { push @lines, $line; push @lines, $self->_dump_hash( $el, $indent + 1, $seen ); } else { $line .= ' {}'; push @lines, $line; } } else { die \"YAML::Tiny does not support $type references"; } } @lines; } ##################################################################### # DEPRECATED API methods: # Error storage (DEPRECATED as of 1.57) our $errstr = ''; # Set error sub _error { require Carp; $errstr = $_[1]; $errstr =~ s/ at \S+ line \d+.*//; Carp::croak( $errstr ); } # Retrieve error my $errstr_warned; sub errstr { require Carp; Carp::carp( "YAML::Tiny->errstr and \$YAML::Tiny::errstr is deprecated" ) unless $errstr_warned++; $errstr; } ##################################################################### # Helper functions. Possibly not needed. # Use to detect nv or iv use B; # XXX-INGY Is flock YAML::Tiny's responsibility? # Some platforms can't flock :-( # XXX-XDG I think it is. When reading and writing files, we ought # to be locking whenever possible. People (foolishly) use YAML # files for things like session storage, which has race issues. my $HAS_FLOCK; sub _can_flock { if ( defined $HAS_FLOCK ) { return $HAS_FLOCK; } else { require Config; my $c = \%Config::Config; $HAS_FLOCK = grep { $c->{$_} } qw/d_flock d_fcntl_can_lock d_lockf/; require Fcntl if $HAS_FLOCK; return $HAS_FLOCK; } } # XXX-INGY Is this core in 5.8.1? Can we remove this? # XXX-XDG Scalar::Util 1.18 didn't land until 5.8.8, so we need this ##################################################################### # Use Scalar::Util if possible, otherwise emulate it use Scalar::Util (); BEGIN { local $@; if ( eval { Scalar::Util->VERSION(1.18); } ) { *refaddr = *Scalar::Util::refaddr; } else { eval <<'END_PERL'; # Scalar::Util failed to load or too old sub refaddr { my $pkg = ref($_[0]) or return undef; if ( !! UNIVERSAL::can($_[0], 'can') ) { bless $_[0], 'Scalar::Util::Fake'; } else { $pkg = undef; } "$_[0]" =~ /0x(\w+)/; my $i = do { no warnings 'portable'; hex $1 }; bless $_[0], $pkg if defined $pkg; $i; } END_PERL } } delete $YAML::Tiny::{refaddr}; 1; # XXX-INGY Doc notes I'm putting up here. Changing the doc when it's wrong # but leaving grey area stuff up here. # # I would like to change Read/Write to Load/Dump below without # changing the actual API names. # # It might be better to put Load/Dump API in the SYNOPSIS instead of the # dubious OO API. # # null and bool explanations may be outdated. __END__ =pod =head1 NAME YAML::Tiny - Read/Write YAML files with as little code as possible =head1 VERSION version 1.70 =head1 PREAMBLE The YAML specification is huge. Really, B huge. It contains all the functionality of XML, except with flexibility and choice, which makes it easier to read, but with a formal specification that is more complex than XML. The original pure-Perl implementation L costs just over 4 megabytes of memory to load. Just like with Windows F<.ini> files (3 meg to load) and CSS (3.5 meg to load) the situation is just asking for a B module, an incomplete but correct and usable subset of the functionality, in as little code as possible. Like the other C<::Tiny> modules, YAML::Tiny has no non-core dependencies, does not require a compiler to install, is back-compatible to Perl v5.8.1, and can be inlined into other modules if needed. In exchange for this adding this extreme flexibility, it provides support for only a limited subset of YAML. But the subset supported contains most of the features for the more common uses of YAML. =head1 SYNOPSIS Assuming F like this: --- rootproperty: blah section: one: two three: four Foo: Bar empty: ~ Read and write F like this: use YAML::Tiny; # Open the config my $yaml = YAML::Tiny->read( 'file.yml' ); # Get a reference to the first document my $config = $yaml->[0]; # Or read properties directly my $root = $yaml->[0]->{rootproperty}; my $one = $yaml->[0]->{section}->{one}; my $Foo = $yaml->[0]->{section}->{Foo}; # Change data directly $yaml->[0]->{newsection} = { this => 'that' }; # Add a section $yaml->[0]->{section}->{Foo} = 'Not Bar!'; # Change a value delete $yaml->[0]->{section}; # Delete a value # Save the document back to the file $yaml->write( 'file.yml' ); To create a new YAML file from scratch: # Create a new object with a single hashref document my $yaml = YAML::Tiny->new( { wibble => "wobble" } ); # Add an arrayref document push @$yaml, [ 'foo', 'bar', 'baz' ]; # Save both documents to a file $yaml->write( 'data.yml' ); Then F will contain: --- wibble: wobble --- - foo - bar - baz =head1 DESCRIPTION B is a perl class for reading and writing YAML-style files, written with as little code as possible, reducing load time and memory overhead. Most of the time it is accepted that Perl applications use a lot of memory and modules. The B<::Tiny> family of modules is specifically intended to provide an ultralight and zero-dependency alternative to many more-thorough standard modules. This module is primarily for reading human-written files (like simple config files) and generating very simple human-readable files. Note that I said B and not B. The sort of files that your average manager or secretary should be able to look at and make sense of. =for stopwords normalise L does not generate comments, it won't necessarily preserve the order of your hashes, and it will normalise if reading in and writing out again. It only supports a very basic subset of the full YAML specification. =for stopwords embeddable Usage is targeted at files like Perl's META.yml, for which a small and easily-embeddable module is extremely attractive. Features will only be added if they are human readable, and can be written in a few lines of code. Please don't be offended if your request is refused. Someone has to draw the line, and for YAML::Tiny that someone is me. If you need something with more power move up to L (7 megabytes of memory overhead) or L (6 megabytes memory overhead and requires a C compiler). To restate, L does B preserve your comments, whitespace, or the order of your YAML data. But it should round-trip from Perl structure to file and back again just fine. =head1 METHODS =for Pod::Coverage HAVE_UTF8 refaddr =head2 new The constructor C creates a C object as a blessed array reference. Any arguments provided are taken as separate documents to be serialized. =head2 read $filename The C constructor reads a YAML file from a file name, and returns a new C object containing the parsed content. Returns the object on success or throws an error on failure. =head2 read_string $string; The C constructor reads YAML data from a character string, and returns a new C object containing the parsed content. If you have read the string from a file yourself, be sure that you have correctly decoded it into characters first. Returns the object on success or throws an error on failure. =head2 write $filename The C method generates the file content for the properties, and writes it to disk using UTF-8 encoding to the filename specified. Returns true on success or throws an error on failure. =head2 write_string Generates the file content for the object and returns it as a character string. This may contain non-ASCII characters and should be encoded before writing it to a file. Returns true on success or throws an error on failure. =for stopwords errstr =head2 errstr (DEPRECATED) Prior to version 1.57, some errors were fatal and others were available only via the C<$YAML::Tiny::errstr> variable, which could be accessed via the C method. Starting with version 1.57, all errors are fatal and throw exceptions. The C<$errstr> variable is still set when exceptions are thrown, but C<$errstr> and the C method are deprecated and may be removed in a future release. The first use of C will issue a deprecation warning. =head1 FUNCTIONS YAML::Tiny implements a number of functions to add compatibility with the L API. These should be a drop-in replacement. =head2 Dump my $string = Dump(list-of-Perl-data-structures); Turn Perl data into YAML. This function works very much like Data::Dumper::Dumper(). It takes a list of Perl data structures and dumps them into a serialized form. It returns a character string containing the YAML stream. Be sure to encode it as UTF-8 before serializing to a file or socket. The structures can be references or plain scalars. Dies on any error. =head2 Load my @data_structures = Load(string-containing-a-YAML-stream); Turn YAML into Perl data. This is the opposite of Dump. Just like L's thaw() function or the eval() function in relation to L. It parses a character string containing a valid YAML stream into a list of Perl data structures representing the individual YAML documents. Be sure to decode the character string correctly if the string came from a file or socket. my $last_data_structure = Load(string-containing-a-YAML-stream); For consistency with YAML.pm, when Load is called in scalar context, it returns the data structure corresponding to the last of the YAML documents found in the input stream. Dies on any error. =head2 freeze() and thaw() Aliases to Dump() and Load() for L fans. This will also allow YAML::Tiny to be plugged directly into modules like POE.pm, that use the freeze/thaw API for internal serialization. =head2 DumpFile(filepath, list) Writes the YAML stream to a file with UTF-8 encoding instead of just returning a string. Dies on any error. =head2 LoadFile(filepath) Reads the YAML stream from a UTF-8 encoded file instead of a string. Dies on any error. =head1 YAML TINY SPECIFICATION This section of the documentation provides a specification for "YAML Tiny", a subset of the YAML specification. It is based on and described comparatively to the YAML 1.1 Working Draft 2004-12-28 specification, located at L. Terminology and chapter numbers are based on that specification. =head2 1. Introduction and Goals The purpose of the YAML Tiny specification is to describe a useful subset of the YAML specification that can be used for typical document-oriented use cases such as configuration files and simple data structure dumps. =for stopwords extensibility Many specification elements that add flexibility or extensibility are intentionally removed, as is support for complex data structures, class and object-orientation. In general, the YAML Tiny language targets only those data structures available in JSON, with the additional limitation that only simple keys are supported. As a result, all possible YAML Tiny documents should be able to be transformed into an equivalent JSON document, although the reverse is not necessarily true (but will be true in simple cases). =for stopwords PCRE As a result of these simplifications the YAML Tiny specification should be implementable in a (relatively) small amount of code in any language that supports Perl Compatible Regular Expressions (PCRE). =head2 2. Introduction YAML Tiny supports three data structures. These are scalars (in a variety of forms), block-form sequences and block-form mappings. Flow-style sequences and mappings are not supported, with some minor exceptions detailed later. The use of three dashes "---" to indicate the start of a new document is supported, and multiple documents per file/stream is allowed. Both line and inline comments are supported. Scalars are supported via the plain style, single quote and double quote, as well as literal-style and folded-style multi-line scalars. The use of explicit tags is not supported. The use of "null" type scalars is supported via the ~ character. The use of "bool" type scalars is not supported. =for stopwords serializer However, serializer implementations should take care to explicitly escape strings that match a "bool" keyword in the following set to prevent other implementations that do support "bool" accidentally reading a string as a boolean y|Y|yes|Yes|YES|n|N|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF The use of anchors and aliases is not supported. The use of directives is supported only for the %YAML directive. =head2 3. Processing YAML Tiny Information B =for stopwords deserialization The YAML specification dictates three-phase serialization and three-phase deserialization. The YAML Tiny specification does not mandate any particular methodology or mechanism for parsing. Any compliant parser is only required to parse a single document at a time. The ability to support streaming documents is optional and most likely non-typical. =for stopwords acyclic Because anchors and aliases are not supported, the resulting representation graph is thus directed but (unlike the main YAML specification) B. Circular references/pointers are not possible, and any YAML Tiny serializer detecting a circular reference should error with an appropriate message. B =for stopwords unicode YAML Tiny reads and write UTF-8 encoded files. Operations on strings expect or produce Unicode characters not UTF-8 encoded bytes. B =for stopwords modality =for stopwords parsers YAML Tiny parsers and emitters are not expected to recover from, or adapt to, errors. The specific error modality of any implementation is not dictated (return codes, exceptions, etc.) but is expected to be consistent. =head2 4. Syntax B YAML Tiny streams are processed in memory as Unicode characters and read/written with UTF-8 encoding. The escaping and unescaping of the 8-bit YAML escapes is required. The escaping and unescaping of 16-bit and 32-bit YAML escapes is not required. B Support for the "~" null/undefined indicator is required. Implementations may represent this as appropriate for the underlying language. Support for the "-" block sequence indicator is required. Support for the "?" mapping key indicator is B required. Support for the ":" mapping value indicator is required. Support for the "," flow collection indicator is B required. Support for the "[" flow sequence indicator is B required, with one exception (detailed below). Support for the "]" flow sequence indicator is B required, with one exception (detailed below). Support for the "{" flow mapping indicator is B required, with one exception (detailed below). Support for the "}" flow mapping indicator is B required, with one exception (detailed below). Support for the "#" comment indicator is required. Support for the "&" anchor indicator is B required. Support for the "*" alias indicator is B required. Support for the "!" tag indicator is B required. Support for the "|" literal block indicator is required. Support for the ">" folded block indicator is required. Support for the "'" single quote indicator is required. Support for the """ double quote indicator is required. Support for the "%" directive indicator is required, but only for the special case of a %YAML version directive before the "---" document header, or on the same line as the document header. For example: %YAML 1.1 --- - A sequence with a single element Special Exception: To provide the ability to support empty sequences and mappings, support for the constructs [] (empty sequence) and {} (empty mapping) are required. For example, %YAML 1.1 # A document consisting of only an empty mapping --- {} # A document consisting of only an empty sequence --- [] # A document consisting of an empty mapping within a sequence - foo - {} - bar B Other than the empty sequence and mapping cases described above, YAML Tiny supports only the indentation-based block-style group of contexts. All five scalar contexts are supported. Indentation spaces work as per the YAML specification in all cases. Comments work as per the YAML specification in all simple cases. Support for indented multi-line comments is B required. Separation spaces work as per the YAML specification in all cases. B The only directive supported by the YAML Tiny specification is the %YAML language/version identifier. Although detected, this directive will have no control over the parsing itself. =for stopwords recognise The parser must recognise both the YAML 1.0 and YAML 1.1+ formatting of this directive (as well as the commented form, although no explicit code should be needed to deal with this case, being a comment anyway) That is, all of the following should be supported. --- #YAML:1.0 - foo %YAML:1.0 --- - foo % YAML 1.1 --- - foo Support for the %TAG directive is B required. Support for additional directives is B required. Support for the document boundary marker "---" is required. Support for the document boundary market "..." is B required. If necessary, a document boundary should simply by indicated with a "---" marker, with not preceding "..." marker. Support for empty streams (containing no documents) is required. Support for implicit document starts is required. That is, the following must be equivalent. # Full form %YAML 1.1 --- foo: bar # Implicit form foo: bar B Support for nodes optional anchor and tag properties is B required. Support for node anchors is B required. Support for node tags is B required. Support for alias nodes is B required. Support for flow nodes is B required. Support for block nodes is required. B Support for all five scalar styles is required as per the YAML specification, although support for quoted scalars spanning more than one line is B required. Support for multi-line scalar documents starting on the header is not required. Support for the chomping indicators on multi-line scalar styles is required. B Support for block-style sequences is required. Support for flow-style sequences is B required. Support for block-style mappings is required. Support for flow-style mappings is B required. Both sequences and mappings should be able to be arbitrarily nested. Support for plain-style mapping keys is required. Support for quoted keys in mappings is B required. Support for "?"-indicated explicit keys is B required. =for stopwords endeth Here endeth the specification. =head2 Additional Perl-Specific Notes For some Perl applications, it's important to know if you really have a number and not a string. That is, in some contexts is important that 3 the number is distinctive from "3" the string. Because even Perl itself is not trivially able to understand the difference (certainly without XS-based modules) Perl implementations of the YAML Tiny specification are not required to retain the distinctiveness of 3 vs "3". =head1 SUPPORT Bugs should be reported via the CPAN bug tracker at L =begin html For other issues, or commercial enhancement or support, please contact Adam Kennedy directly. =end html =head1 AUTHOR Adam Kennedy Eadamk@cpan.orgE =head1 SEE ALSO =over 4 =item * L =item * L =item * L =item * L =item * L =item * L =back =head1 COPYRIGHT Copyright 2006 - 2013 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =cut