MooseX-Storage-0.53/000770 000766 000024 00000000000 13646474070 014540 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/INSTALL000644 000766 000024 00000004346 13646474070 015603 0ustar00etherstaff000000 000000 This is the Perl distribution MooseX-Storage. Installing MooseX-Storage is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::Storage 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 MooseX::Storage ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, install configure prerequisites (see below), then build it: % perl Makefile.PL % make && make test Then install it: % make install On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. 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 The prerequisites of this distribution will also have to be installed manually. The prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated by running the manual build process described above. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Makefile.PL. Look for prerequisites in the following phases: * to run make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation MooseX-Storage documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc MooseX::Storage For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html MooseX-Storage-0.53/LICENSE000644 000766 000024 00000043724 13646474070 015562 0ustar00etherstaff000000 000000 This software is copyright (c) 2007 by Infinity Interactive, Inc. 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) 2007 by Infinity Interactive, Inc. 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) 2007 by Infinity Interactive, Inc. 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 MooseX-Storage-0.53/CONTRIBUTING000644 000766 000024 00000010103 13646474070 016370 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 sufficient 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/MooseX-Storage If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends MooseX::Storage 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 MooseX::Storage 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/moose/MooseX-Storage You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Please include a suitable end-user-oriented entry in the Changes file describing your change. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request All pull requests for this distribution will be automatically tested on Linux by Travis at: https://travis-ci.com/moose/MooseX-Storage Results will be visible in the pull request on GitHub. Follow the appropriate links for details when tests fail. Changes will not be mergeable until all tests pass. 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=MooseX-Storage or via email: bug-MooseX-Storage@rt.cpan.org There is also a mailing list available for users of this distribution, at http://lists.perl.org/list/moose.html There is also an irc channel available for users of this distribution, at irc://irc.perl.org/#moose 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.014 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.154. MooseX-Storage-0.53/Changes000640 000766 000024 00000024710 13646474070 016036 0ustar00etherstaff000000 000000 Revision history for MooseX-Storage 0.53 2020-04-18 03:46:55Z - minor prerequisite improvements 0.52 2016-06-22 03:22:12Z - when looking for a serializer for a type constraint, always use the user-defined type handler first, before recursing into parent types 0.51 2016-02-10 20:06:41Z (TRIAL RELEASE) - support serialization of "maybe" types created by MooseX::Types (PR#12) 0.50 2015-05-05 20:09:42Z - revert changes in 0.49 for deeply-nested objects (see RT#104106) 0.49 2015-03-29 00:24:43Z - now handling more deeply-nested objects (PR#7, RT#81236, thanks Dmitry Latin!) - fix error in DateTime example (PR#8, thanks sillitoe!) 0.48 2014-10-12 02:01:31Z - switched the JSON serializer from JSON::Any to JSON::MaybeXS - interactive prompting at install time is now back! 0.47 2014-08-23 22:34:21Z - report the versions of all JSON and YAML backends during tests, in an attempt to track down an elusive bug - now properly serializing attributes that are set to the undefined value (github #6, thanks, Jason Pope!) - fix compatibility problem with MooseX::Role::Parameterized 1.03+ and MooseX::Storage::Format::JSONpm (some internal details changed that we were relying on) 0.46 2014-03-23 18:26:44Z - numerous small documentation clarifications and fixes 0.45 2013-12-22 00:48:10Z - new 'Value' type handler added (thanks David Golden) 0.44 2013-11-30 20:09:54Z - re-release to fix compile test 0.43 2013-09-11 01:47:40Z - removed use of deprecated Class::MOP::load_class 0.42 2013-09-08 18:00:22Z - all features are now configured as x_default => 1 in metadata (not yet supported by any cpan clients), signalling to automatically add to prereqs when installing non-interactively - re-release with properly encoded META.yml 0.41 2013-09-03 01:05:15Z - re-release with updated Dist::Zilla plugins to clear the dynamic_config flag in metadata - repository has moved to the GitHub Moose organization 0.40 2013-08-29 01:57:00Z - replaced last use of Best (held over since 2010!) to YAML::Any - fixed another test making use of optional features 0.39 2013-07-27 00:02:26Z - re-release as stable (full working Dist::Zilla conversion) 0.38 2013-07-20 16:42:03Z (TRIAL RELEASE) - re-release with new compile test, which properly declares all its prerequisites 0.37 2013-07-20 00:41:17Z (TRIAL RELEASE) - fixed compile tests so that modules using optional features are skipped (from 0.36-TRIAL) 0.36 2013-07-17 04:41:39Z (TRIAL RELEASE) - convert to Dist::Zilla, with new optional prereq handling 0.35 2013-07-15 - properly skip optional tests when the required JSON backends aren't available 0.34 2013-06-20 - JSON storage works when Cpanel::JSON::XS is the only JSON backend installed 0.33 2013-03-29 - always JSONify data with sorted keys, to handle hash order randomization introduced in 5.17.* (RT#84287, Karen Etheridge) 0.32 2012-12-04 - Change to use core Digest and Digest::SHA dists, rather than Digest::SHA1. RT#69811 - Create a JSON::Any object, so setting $ENV{JSON_ANY_CONFIG} works. Adjust tests that were setting the wrong values and the default happened to work. - Don't rely on hash key order in tests (RT#81695) 0.31 2012-02-28 - Add example for add_custom_type_handler to the MooseX::Storage::Engine docs. (perigrin) - Incorrect documentation for ->unpack method's inject parameter fixed. - The test suite now uses Test::Fatal instead of Test::Exception (Karen Etheridge). 0.30 2011-04-29 - Make Makefile.PL features work again. RT#67170 0.29 2010-11-17 - Remove use of Test::TempDir in favor of File::Temp (gphat) 0.28 2010-10-03 - Make the engine_traits parameter be able to use a '+My::Trait::Name' prefix to specify a trait name which isn't in the MooseX::Storage::Engine::Trait namespace - Misc POD and test cleanups. 0.27 2010-04-15 - use of parameterized roles (first added in 0.22) now works in Deferred Example: $object->freeze({ format => [ $role_name => \%args ] }) 0.26 2010-03-25 - Fix URI for repository in metadata. - Fix infinite recursion when collapsing objects which overload stringify to freeze themselves. 0.25 2010-03-09 - Add support for Union types (bumps Moose dep to 0.99) 0.24 2010-01-11 - Add additional YAML implementation tests. - Switch from using Best to YAML::Any. - Remove Test::YAML::Valid. 0.23 2009-11-10 - Revert whitespace change in tests which breaks the tests if you have Test::YAML::Valid installed. 0.22 2009-11-05 - Fix warnings when types do not have a parent type. - allow the use of roles outside MooseX::Storage:: (rjbs) - allow the use of parameterized roles (rjbs) 0.21 2009-07-14 - Fix inconsistent dist versions with Perl::Version 0.20 2009-07-14 - Add support for Storage( traits => [...] ) with a MooseX::Storage::Traits::XX namespace to alter the behaviour of the storage engine. (Suggestions for how to make this less fugly appreciated) - Add feature to disable cycle checking, either via engine trait or option - add docs & tests (including 1 TODO test) - Add feature to only serialize attributes whose predicate returns 'true' - Implement the unpack( $data, inject => {...} ) feature. - add docs & tests - Move Base::WithChecksum to build upon Basic.pm, avoid code duplication - Add extra test to ensure restoring fails if required argument isn't provided - Fix a bug where if a required constructor argument was not serialized, it was impossible to ->unpack again. 0.19 2009-07-14 - Skip pod tests when not in author mode 0.18 2009-06-02 - Fix test failures without JSON::Any. Patch from RT#46343 (Nicholas Clarke) - Added support for Maybe[...] constraints fixing RT#43165 (plu) 0.17 2009-04-06 - Change MooseX::Storage::Engine to use get_all_attributes, rather than the deprecated compute_all_applicable_attributes (t0m) - Don't fail tests when Best is unavailable (t0m) 0.15 2008-09-29 - MooseX::Storage - Remove use of deprecated alias_method routine which was causing issues when you used multiple Roles which used MooseX::Storage (t0m). 0.14 2008-06-22 - MooseX::Storage::Engine - cycles are now tracked by refaddr instead of stringified object, which broke for any overloaded objects (Thanks to Jonathan Rockway) - Don't fail tests when YAML is unavailable - Use temporary files in test suite, instead of cwd 0.13 2008-05-24 - MooseX::Storage::Engine: - added find_type_handler_for($name) method to make finding type handlers easier - improved error messages - removed Build.PL since Module::Install no longer supports it 0.12 2008-03-14 - added build_requires for Test::Deep (awwaiid) - upped the Moose dependency to support the custom meta-attribute-traits - t/ - fixing all the tests to properly skip if optional features are not being used, this should help get rid of all our CPANtester failures - tested against 5.10 as well - MooseX::Storage::Engine MooseX::Storage::Meta::Attribute::DoNotSerialize MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize - adding meta-attribute-trait support for DoNotSerialize - added tests for this 0.11 2008-01-10 - upped the Test::JSON dependency so that we use the version that supports JSON::Any - upped the JSON::Any requirement - minor test cleanups to handle optional dependencies better - MooseX::Storage::Engine - the numbers now have to numify (+0) in the expand/collapse so that certain JSON engines will not choke on them 0.10 2009-01-10 - updated copyright information - MooseX::Storage::Deferred - added this role, which allows you to wait until you actually call a method to determine what formatter and/or IO engine you want to use - added tests for this 0.09 2007-10-23 - MooseX::Storage::Util - added support to deal with utf8 strings correctly - MooseX::Storage::Engine::File MooseX::Storage::Engine::AtomicFile - fixed utf8 handling when storing string - added tests for this - t/ - added an extra test for the utf8 handling - Change build system to Module::Install 0.08 2007-10-10 - MooseX::Storage::Format::JSON - added support to deal with utf8 strings correctly 0.07 2007-09-27 - MooseX::Storage::Format::Storable - this will use Storable to freeze/thaw objects - added tests for this - MooseX::Storage::IO::StorableFile - this will use Storable to load/store objects - added tests for this - t/ - fixed tests in 030_with_checksum.t (thanks to sartak) 0.06 2007-08-07 - MooseX::Storage::Engine - added the Bool type and fixed a few bugs that it exposed (thanks to Sartak) - added tests for this 0.05 2007-07-15 - MooseX::Storage::Base::WithChecksum - Fixed minor issue where the WithChecksum would choke with a bad checksum due to odd Data::Dumper output. - t/ - forced JSON::Any in the basic JSON tests to use JSON.pm since this is what Test::JSON uses and subtle (and annoying) issues can arise. 0.04 2007-07-03 - MooseX::Storage::Util - made this more robust when it tries to use YAML and JSON loaders and fails to find one - fixed tests to reflect this 0.03 2007-06-27 - MooseX::Storage::Util - this is a collection of useful tools for working with MooseX::Storage data - added docs and test - t/ - added test for a custom type handler - fixed checksum test to skip if Digest::SHA1 (our default) is not available 0.02 2007-06-08 - MooseX::Storage::Base::WithChecksum - added a simple base role which makes a checksum of the data structure before packing, and checks the checksum before unpacking. - added tests for this - MooseX::Storage::Engine - better error reporting when cycles are found - class names are now stored as the full identifier (--) and are checked when they are expanded. - added docs and tests for this - MooseX::Storage::Engine::IO::(AtomicFile, File) - added checks to make sure the file gets opened correctly and dies if it does not. 0.01 2007-04-30 - This was Chris's idea originally (blame him), and we expanded on it to create what you see here :) MooseX-Storage-0.53/MANIFEST000644 000766 000024 00000004146 13646474070 015701 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.014. CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/MooseX/Storage.pm lib/MooseX/Storage/Base/WithChecksum.pm lib/MooseX/Storage/Basic.pm lib/MooseX/Storage/Deferred.pm lib/MooseX/Storage/Engine.pm lib/MooseX/Storage/Engine/IO/AtomicFile.pm lib/MooseX/Storage/Engine/IO/File.pm lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm lib/MooseX/Storage/Format/JSON.pm lib/MooseX/Storage/Format/Storable.pm lib/MooseX/Storage/Format/YAML.pm lib/MooseX/Storage/IO/AtomicFile.pm lib/MooseX/Storage/IO/File.pm lib/MooseX/Storage/IO/StorableFile.pm lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm lib/MooseX/Storage/Traits/DisableCycleDetection.pm lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm lib/MooseX/Storage/Util.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/000_load.t t/001_basic.t t/002_basic_io.t t/002_basic_w_subtypes.t t/003_basic_w_embedded_objects.t t/004_w_cycles.t t/005_w_versions_and_authority_check.t t/006_w_custom_type_handlers.t t/007_false.t t/008_do_not_serialize.t t/009_do_not_serialize_lazy.t t/010_basic_json.t t/011_basic_json_w_utf8.t t/012_param_json.t t/020_basic_yaml.t t/020_basic_yaml_syck.t t/020_basic_yaml_xs.t t/030_with_checksum.t t/040_basic_utils.t t/050_basic_storable.t t/060_basic_deferred.t t/061_basic_deferred_w_io.t t/070_basic_maybe.t t/080_basic_json_boolean.t t/100_io.t t/101_io_atomic.t t/102_io_storable_file.t t/103_io_storable_file_custom.t t/104_io_w_utf8.t t/105_io_atomic_w_utf8.t t/200_combined_in_roles.t t/300_overloaded.t t/400_moosex_types.t t/zzz-check-breaks.t xt/author/00-compile.t xt/author/changes_has_content.t xt/author/clean-namespaces.t xt/author/eol.t xt/author/kwalitee.t xt/author/minimum-version.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/release/changes_has_content.t xt/release/cpan-changes.t xt/release/distmeta.t MooseX-Storage-0.53/t/000770 000766 000024 00000000000 13646474070 015003 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/xt/000770 000766 000024 00000000000 13646474070 015173 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/README000644 000766 000024 00000000607 13646474070 015426 0ustar00etherstaff000000 000000 This archive contains the distribution MooseX-Storage, version 0.53: A serialization framework for Moose classes This software is copyright (c) 2007 by Infinity Interactive, Inc. 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.014. MooseX-Storage-0.53/META.yml000644 000766 000024 00000107455 13646474070 016030 0ustar00etherstaff000000 000000 --- abstract: 'A serialization framework for Moose classes' author: - 'Chris Prather ' - 'Stevan Little ' - "יובל קוג'מן (Yuval Kogman) " build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' File::Spec::Functions: '0' File::Temp: '0' JSON::PP: '0' Moose::Util::TypeConstraints: '0' Test::Deep: '0' Test::Deep::Type: '0' Test::Fatal: '0' Test::More: '0.88' Test::Needs: '0' open: '0' overload: '0' perl: '5.008' strict: '0' utf8: '0' warnings: '0' configure_requires: CPAN::Meta::Requirements: '2.120620' ExtUtils::MakeMaker: '0' Module::Metadata: '0' perl: '5.006' dynamic_config: 1 generated_by: 'Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010' keywords: - moose - extension - serial - serialization - class - object - store - storage - types - strings license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooseX-Storage no_index: directory: - t - xt optional_features: File: description: 'the ability to save the file to disk' requires: IO::AtomicFile: '0' IO::File: '0' JSON: description: 'Serialize to JSON. You should have at least one serialization format.' recommends: MooseX::Storage::Format::JSONpm: '0' requires: JSON::MaybeXS: '1.001000' Storable: description: 'Serialize to Storable. You should have at least one serialization format.' requires: Storable: '0' YAML: description: 'Serialize to YAML. You should have at least one serialization format.' recommends: YAML: '0' YAML::Syck: '0' YAML::XS: '0' requires: YAML::Any: '0' provides: MooseX::Storage: file: lib/MooseX/Storage.pm version: '0.53' MooseX::Storage::Base::WithChecksum: file: lib/MooseX/Storage/Base/WithChecksum.pm version: '0.53' MooseX::Storage::Basic: file: lib/MooseX/Storage/Basic.pm version: '0.53' MooseX::Storage::Deferred: file: lib/MooseX/Storage/Deferred.pm version: '0.53' MooseX::Storage::Engine: file: lib/MooseX/Storage/Engine.pm version: '0.53' MooseX::Storage::Engine::IO::AtomicFile: file: lib/MooseX/Storage/Engine/IO/AtomicFile.pm version: '0.53' MooseX::Storage::Engine::IO::File: file: lib/MooseX/Storage/Engine/IO/File.pm version: '0.53' MooseX::Storage::Engine::Trait::DisableCycleDetection: file: lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm version: '0.53' MooseX::Storage::Engine::Trait::OnlyWhenBuilt: file: lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm version: '0.53' MooseX::Storage::Format::JSON: file: lib/MooseX/Storage/Format/JSON.pm version: '0.53' MooseX::Storage::Format::Storable: file: lib/MooseX/Storage/Format/Storable.pm version: '0.53' MooseX::Storage::Format::YAML: file: lib/MooseX/Storage/Format/YAML.pm version: '0.53' MooseX::Storage::IO::AtomicFile: file: lib/MooseX/Storage/IO/AtomicFile.pm version: '0.53' MooseX::Storage::IO::File: file: lib/MooseX/Storage/IO/File.pm version: '0.53' MooseX::Storage::IO::StorableFile: file: lib/MooseX/Storage/IO/StorableFile.pm version: '0.53' MooseX::Storage::Meta::Attribute::DoNotSerialize: file: lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm version: '0.53' MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize: file: lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm version: '0.53' MooseX::Storage::Traits::DisableCycleDetection: file: lib/MooseX/Storage/Traits/DisableCycleDetection.pm version: '0.53' MooseX::Storage::Traits::OnlyWhenBuilt: file: lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm version: '0.53' MooseX::Storage::Util: file: lib/MooseX/Storage/Util.pm version: '0.53' recommends: IO::AtomicFile: '0' IO::File: '0' JSON::MaybeXS: '1.001000' Storable: '0' YAML: '0' YAML::Any: '0' YAML::Syck: '0' YAML::XS: '0' requires: Carp: '0' Data::Dumper: '0' Digest: '0' Module::Runtime: '0' Moose: '0.99' Moose::Meta::Attribute: '0' Moose::Role: '0' Scalar::Util: '0' String::RewritePrefix: '0' namespace::autoclean: '0' perl: '5.008' resources: IRC: irc://irc.perl.org/#moose MailingList: http://lists.perl.org/list/moose.html bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage homepage: https://github.com/moose/MooseX-Storage repository: https://github.com/moose/MooseX-Storage.git version: '0.53' x_Dist_Zilla: perl: version: '5.031010' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle version' version: '6.014' - 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.055' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '6.014' - 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.046' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '6.014' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '6.014' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '6.014' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '6.014' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '6.014' - 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.009' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.014' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/InstallGuide' version: '1.200013' - 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.058' - 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.014' - 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::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: xt/author/changes_has_content.t dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 location: build source_filename: changes_has_content.t Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.009' name: '@Author::ETHER/generate xt/author/changes_has_content.t' version: '0.014' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: '5.008003' name: '@Author::ETHER/Test::MinimumVersion' version: '2.000010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '6.014' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: '6.014' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - examples - lib - script - t - xt spell_cmd: '' stopwords: - cpan - irc wordlist: Pod::Wordlist name: '@Author::ETHER/Test::PodSpelling' version: '2.007005' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.004' - 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.027' - 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::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@Author::ETHER' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@Author::ETHER/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@Author::ETHER/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::ETHER/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/List' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/Verbatim' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/header' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Author::ETHER/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Author::ETHER/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Author::ETHER/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/postlude' version: '4.015' - class: Pod::Weaver::Section::GenerateSection name: '@Author::ETHER/generate SUPPORT' version: '1.06' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override SUPPORT' version: '0.05' - class: Pod::Weaver::Section::Authors name: '@Author::ETHER/Authors' version: '4.015' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override AUTHOR' version: '0.05' - class: Pod::Weaver::Section::Contributors name: '@Author::ETHER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::ETHER/Legal' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/footer' version: '4.015' name: '@Author::ETHER/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.58' - 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.014' - 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.014' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '0' inherit_version: '0' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '6.014' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: - moose - extension - serial - serialization - class - object - store - storage - types - strings name: '@Author::ETHER/Keywords' version: '0.007' - class: Dist::Zilla::Plugin::UseUnsafeInc config: Dist::Zilla::Plugin::UseUnsafeInc: dot_in_INC: 0 name: '@Author::ETHER/UseUnsafeInc' version: '0.001' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '6.014' - 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::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/MakeMaker' version: '6.014' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.25.0 include_authors: 0 include_releaser: 1 order_by: commits paths: [] name: '@Author::ETHER/Git::Contributors' version: '0.035' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 1 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.012' - 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.000037' version: '0.006' 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\"" version: '0.048' name: '@Author::ETHER/.ackrc' version: '0.048' - 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 version: '0.048' name: '@Author::ETHER/.latest' version: '0.048' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::ETHER/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::EnsureLatestPerl config: Dist::Zilla::Plugin::EnsureLatestPerl: Module::CoreList: '5.20200320' name: '@Author::ETHER/EnsureLatestPerl' version: '0.008' - 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.055' - 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.25.0 repo_root: . name: '@Author::ETHER/initial check' version: '2.046' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.25.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.25.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.1.2 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '6.014' - 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.25.0 repo_root: . name: '@Author::ETHER/after tests' version: '2.046' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.011' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '6.014' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/copy generated files' version: '0.007' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/@Git::VersionManager/pluginbundle version' version: '6.014' - 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/@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Author::ETHER/@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease' version: '0.007' - 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.25.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/release snapshot' version: '2.046' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.53 tag_format: v%V tag_message: v%v%t Dist::Zilla::Role::Git::Repo: git_version: 2.25.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/Git::Tag' version: '2.046' - 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/@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/@Git::VersionManager/NextRelease' version: '6.014' - 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: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.25.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/post-release commit' version: '2.046' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager' version: '6.014' - 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.25.0 repo_root: . name: '@Author::ETHER/Git::Push' version: '2.046' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.47' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED version: '0.048' name: '@Author::ETHER/install release' version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 version: '0.048' name: '@Author::ETHER/release complete' version: '0.048' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '6.014' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/prereqs for @Author::ETHER' version: '6.014' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '6.014' - class: Dist::Zilla::Plugin::Test::CheckBreaks config: Dist::Zilla::Plugin::Test::CheckBreaks: conflicts_module: - Module::Runtime::Conflicts - Moose::Conflicts no_forced_deps: 0 Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: Test::CheckBreaks version: '0.019' - class: Dist::Zilla::Plugin::Prereqs::Soften config: Dist::Zilla::Plugin::Prereqs::Soften: copy_to: - develop.requires modules: - Digest::HMAC_SHA1 - MooseX::Types - MooseX::Types::Moose modules_from_features: '1' to_relationship: suggests name: Prereqs::Soften version: '0.006003' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'Serialize to JSON. You should have at least one serialization format.' name: JSON phase: runtime prereqs: JSON::MaybeXS: '1.001000' prompt: 1 require_develop: 1 type: requires name: JSON-Runtime version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 0 always_suggest: 1 default: '1' description: 'Serialize to JSON. You should have at least one serialization format.' name: JSON phase: runtime prereqs: MooseX::Storage::Format::JSONpm: '0' prompt: 0 require_develop: 1 type: recommends name: JSON-RuntimeRecommends version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'Serialize to JSON. You should have at least one serialization format.' name: JSON phase: test prereqs: Test::Deep::JSON: '0' prompt: 1 require_develop: 1 type: requires name: JSON-Test version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'Serialize to YAML. You should have at least one serialization format.' name: YAML phase: runtime prereqs: YAML::Any: '0' prompt: 1 require_develop: 1 type: requires name: YAML-Runtime version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 default: '1' description: 'Serialize to YAML. You should have at least one serialization format.' name: YAML phase: runtime prereqs: YAML: '0' YAML::Syck: '0' YAML::XS: '0' prompt: 0 require_develop: 1 type: recommends name: YAML-RuntimeRecommends version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'Serialize to YAML. You should have at least one serialization format.' name: YAML phase: test prereqs: Test::Without::Module: '0' prompt: 1 require_develop: 1 type: requires name: YAML-Test version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'Serialize to Storable. You should have at least one serialization format.' name: Storable phase: runtime prereqs: Storable: '0' prompt: 1 require_develop: 1 type: requires name: Storable version: '0.023' - class: Dist::Zilla::Plugin::OptionalFeature config: Dist::Zilla::Plugin::OptionalFeature: always_recommend: 1 always_suggest: 0 check_prereqs: '1' default: '1' description: 'the ability to save the file to disk' name: File phase: runtime prereqs: IO::AtomicFile: '0' IO::File: '0' prompt: 1 require_develop: 1 type: requires name: File version: '0.023' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.014' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.016' - class: Dist::Zilla::Plugin::DynamicPrereqs config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: 'via OptionalFeature' version: '0.037' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.014' x_authority: cpan:STEVAN x_contributors: - 'Karen Etheridge ' - 'Tomas Doran ' - 'Ricardo Signes ' - 'Chris Prather ' - 'Jos Boumans ' - 'Shawn M Moore ' - 'Jonathan Yu ' - 'Dmitry Latin ' - 'Robert Boone ' - 'Dagfinn Ilmari Mannsåker ' - 'Cory Watson ' - 'sillitoe ' - 'Dan Brook ' - 'David Golden ' - 'David Steinbrunner ' - 'Florian Ragwitz ' - 'Graham Knop ' - 'Jason Pope ' - 'Johannes Plunien ' - 'Jonathan Rockway ' - 'Yanick Champoux ' x_generated_by_perl: v5.31.10 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_use_unsafe_inc: 0 MooseX-Storage-0.53/lib/000770 000766 000024 00000000000 13646474070 015306 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/Makefile.PL000644 000766 000024 00000012151 13646474070 016515 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.014. use strict; use warnings; use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "A serialization framework for Moose classes", "AUTHOR" => "Chris Prather , Stevan Little , \x{5d9}\x{5d5}\x{5d1}\x{5dc} \x{5e7}\x{5d5}\x{5d2}'\x{5de}\x{5df} (Yuval Kogman) ", "CONFIGURE_REQUIRES" => { "CPAN::Meta::Requirements" => "2.120620", "ExtUtils::MakeMaker" => 0, "Module::Metadata" => 0 }, "DISTNAME" => "MooseX-Storage", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008", "NAME" => "MooseX::Storage", "PREREQ_PM" => { "Carp" => 0, "Data::Dumper" => 0, "Digest" => 0, "Module::Runtime" => 0, "Moose" => "0.99", "Moose::Meta::Attribute" => 0, "Moose::Role" => 0, "Scalar::Util" => 0, "String::RewritePrefix" => 0, "namespace::autoclean" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "File::Temp" => 0, "JSON::PP" => 0, "Moose::Util::TypeConstraints" => 0, "Test::Deep" => 0, "Test::Deep::Type" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "open" => 0, "overload" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 }, "VERSION" => "0.53", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Data::Dumper" => 0, "Digest" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "File::Temp" => 0, "JSON::PP" => 0, "Module::Runtime" => 0, "Moose" => "0.99", "Moose::Meta::Attribute" => 0, "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "Scalar::Util" => 0, "String::RewritePrefix" => 0, "Test::Deep" => 0, "Test::Deep::Type" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "namespace::autoclean" => 0, "open" => 0, "overload" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 ); # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.037 requires('JSON::MaybeXS', '1.001000') if has_module('JSON::MaybeXS', '1.001000') || prompt('install Serialize to JSON. You should have at least one serialization format.? [Y/n]', 'Y') =~ /^y/i; test_requires('Test::Deep::JSON') if has_module('Test::Deep::JSON') || prompt('install Serialize to JSON. You should have at least one serialization format.? [Y/n]', 'Y') =~ /^y/i; requires('YAML::Any') if has_module('YAML::Any') || prompt('install Serialize to YAML. You should have at least one serialization format.? [Y/n]', 'Y') =~ /^y/i; test_requires('Test::Without::Module') if has_module('Test::Without::Module') || prompt('install Serialize to YAML. You should have at least one serialization format.? [Y/n]', 'Y') =~ /^y/i; requires('Storable') if has_module('Storable') || prompt('install Serialize to Storable. You should have at least one serialization format.? [Y/n]', 'Y') =~ /^y/i; if (has_module('IO::AtomicFile') && has_module('IO::File') || prompt('install the ability to save the file to disk? [Y/n]', 'Y') =~ /^y/i) { requires('IO::AtomicFile'); requires('IO::File'); } unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.037 sub _add_prereq { my ($mm_key, $module, $version_or_range) = @_; $version_or_range ||= 0; warn "$module already exists in $mm_key (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" if exists $WriteMakefileArgs{$mm_key}{$module} and $WriteMakefileArgs{$mm_key}{$module} ne '0' and $WriteMakefileArgs{$mm_key}{$module} ne $version_or_range; warn "$module already exists in FallbackPrereqs (at version $FallbackPrereqs{$mm_key}{$module}) -- need to do a sane metamerge!" if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne '0' and $FallbackPrereqs{$module} ne $version_or_range; $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range; return; } sub has_module { my ($module, $version_or_range) = @_; require Module::Metadata; my $mmd = Module::Metadata->new_from_module($module); return undef if not $mmd; return $mmd->version($module) if not defined $version_or_range; require CPAN::Meta::Requirements; my $req = CPAN::Meta::Requirements->new; $req->add_string_requirement($module => $version_or_range); return 1 if $req->accepts_module($module => $mmd->version($module)); return 0; } sub requires { goto &runtime_requires } sub runtime_requires { my ($module, $version_or_range) = @_; _add_prereq(PREREQ_PM => $module, $version_or_range); } sub test_requires { my ($module, $version_or_range) = @_; _add_prereq(TEST_REQUIRES => $module, $version_or_range); } MooseX-Storage-0.53/META.json000644 000766 000024 00000172061 13646474070 016173 0ustar00etherstaff000000 000000 { "abstract" : "A serialization framework for Moose classes", "author" : [ "Chris Prather ", "Stevan Little ", "\u05d9\u05d5\u05d1\u05dc \u05e7\u05d5\u05d2'\u05de\u05df (Yuval Kogman) " ], "dynamic_config" : 1, "generated_by" : "Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010", "keywords" : [ "moose", "extension", "serial", "serialization", "class", "object", "store", "storage", "types", "strings" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooseX-Storage", "no_index" : { "directory" : [ "t", "xt" ] }, "optional_features" : { "File" : { "description" : "the ability to save the file to disk", "prereqs" : { "runtime" : { "requires" : { "IO::AtomicFile" : "0", "IO::File" : "0" } } }, "x_default" : "1" }, "JSON" : { "description" : "Serialize to JSON. You should have at least one serialization format.", "prereqs" : { "runtime" : { "recommends" : { "MooseX::Storage::Format::JSONpm" : "0" }, "requires" : { "JSON::MaybeXS" : "1.001000" } }, "test" : { "requires" : { "Test::Deep::JSON" : "0" } } }, "x_default" : "1" }, "Storable" : { "description" : "Serialize to Storable. You should have at least one serialization format.", "prereqs" : { "runtime" : { "requires" : { "Storable" : "0" } } }, "x_default" : "1" }, "YAML" : { "description" : "Serialize to YAML. You should have at least one serialization format.", "prereqs" : { "runtime" : { "recommends" : { "YAML" : "0", "YAML::Syck" : "0", "YAML::XS" : "0" }, "requires" : { "YAML::Any" : "0" } }, "test" : { "requires" : { "Test::Without::Module" : "0" } } }, "x_default" : "1" } }, "prereqs" : { "configure" : { "requires" : { "CPAN::Meta::Requirements" : "2.120620", "ExtUtils::MakeMaker" : "0", "Module::Metadata" : "0", "perl" : "5.006" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.154", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "Digest::HMAC_SHA1" : "0", "Encode" : "0", "File::Spec" : "0", "IO::AtomicFile" : "0", "IO::File" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "JSON::MaybeXS" : "1.001000", "MooseX::Storage::Format::JSONpm" : "0", "MooseX::Types" : "0", "MooseX::Types::Moose" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Storable" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::Deep::JSON" : "0", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::No404s" : "0", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Without::Module" : "0", "YAML" : "0", "YAML::Any" : "0", "YAML::Syck" : "0", "YAML::XS" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "runtime" : { "recommends" : { "IO::AtomicFile" : "0", "IO::File" : "0", "JSON::MaybeXS" : "1.001000", "Storable" : "0", "YAML" : "0", "YAML::Any" : "0", "YAML::Syck" : "0", "YAML::XS" : "0" }, "requires" : { "Carp" : "0", "Data::Dumper" : "0", "Digest" : "0", "Module::Runtime" : "0", "Moose" : "0.99", "Moose::Meta::Attribute" : "0", "Moose::Role" : "0", "Scalar::Util" : "0", "String::RewritePrefix" : "0", "namespace::autoclean" : "0", "perl" : "5.008" }, "suggests" : { "IO::AtomicFile" : "0", "IO::File" : "0", "JSON::MaybeXS" : "1.001000", "MooseX::Storage::Format::JSONpm" : "0", "Storable" : "0", "YAML::Any" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900", "Test::Deep::JSON" : "0", "Test::Without::Module" : "0" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "File::Spec::Functions" : "0", "File::Temp" : "0", "JSON::PP" : "0", "Moose::Util::TypeConstraints" : "0", "Test::Deep" : "0", "Test::Deep::Type" : "0", "Test::Fatal" : "0", "Test::More" : "0.88", "Test::Needs" : "0", "open" : "0", "overload" : "0", "perl" : "5.008", "strict" : "0", "utf8" : "0", "warnings" : "0" }, "suggests" : { "Digest::HMAC_SHA1" : "0", "MooseX::Types" : "0", "MooseX::Types::Moose" : "0" } }, "x_Dist_Zilla" : { "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::CheckMetaResources" : "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::EnsureLatestPerl" : "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::OptionalFeature" : "0.006", "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::PodWeaver" : "4.005", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", "Dist::Zilla::Plugin::Prereqs::Soften" : "0.004000", "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::CheckBreaks" : "0.017", "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.000010", "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::Plugin::UseUnsafeInc" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.119", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007", "Software::License::Perl_5" : "0" } } }, "provides" : { "MooseX::Storage" : { "file" : "lib/MooseX/Storage.pm", "version" : "0.53" }, "MooseX::Storage::Base::WithChecksum" : { "file" : "lib/MooseX/Storage/Base/WithChecksum.pm", "version" : "0.53" }, "MooseX::Storage::Basic" : { "file" : "lib/MooseX/Storage/Basic.pm", "version" : "0.53" }, "MooseX::Storage::Deferred" : { "file" : "lib/MooseX/Storage/Deferred.pm", "version" : "0.53" }, "MooseX::Storage::Engine" : { "file" : "lib/MooseX/Storage/Engine.pm", "version" : "0.53" }, "MooseX::Storage::Engine::IO::AtomicFile" : { "file" : "lib/MooseX/Storage/Engine/IO/AtomicFile.pm", "version" : "0.53" }, "MooseX::Storage::Engine::IO::File" : { "file" : "lib/MooseX/Storage/Engine/IO/File.pm", "version" : "0.53" }, "MooseX::Storage::Engine::Trait::DisableCycleDetection" : { "file" : "lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm", "version" : "0.53" }, "MooseX::Storage::Engine::Trait::OnlyWhenBuilt" : { "file" : "lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm", "version" : "0.53" }, "MooseX::Storage::Format::JSON" : { "file" : "lib/MooseX/Storage/Format/JSON.pm", "version" : "0.53" }, "MooseX::Storage::Format::Storable" : { "file" : "lib/MooseX/Storage/Format/Storable.pm", "version" : "0.53" }, "MooseX::Storage::Format::YAML" : { "file" : "lib/MooseX/Storage/Format/YAML.pm", "version" : "0.53" }, "MooseX::Storage::IO::AtomicFile" : { "file" : "lib/MooseX/Storage/IO/AtomicFile.pm", "version" : "0.53" }, "MooseX::Storage::IO::File" : { "file" : "lib/MooseX/Storage/IO/File.pm", "version" : "0.53" }, "MooseX::Storage::IO::StorableFile" : { "file" : "lib/MooseX/Storage/IO/StorableFile.pm", "version" : "0.53" }, "MooseX::Storage::Meta::Attribute::DoNotSerialize" : { "file" : "lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm", "version" : "0.53" }, "MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize" : { "file" : "lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm", "version" : "0.53" }, "MooseX::Storage::Traits::DisableCycleDetection" : { "file" : "lib/MooseX/Storage/Traits/DisableCycleDetection.pm", "version" : "0.53" }, "MooseX::Storage::Traits::OnlyWhenBuilt" : { "file" : "lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm", "version" : "0.53" }, "MooseX::Storage::Util" : { "file" : "lib/MooseX/Storage/Util.pm", "version" : "0.53" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-MooseX-Storage@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage" }, "homepage" : "https://github.com/moose/MooseX-Storage", "repository" : { "type" : "git", "url" : "https://github.com/moose/MooseX-Storage.git", "web" : "https://github.com/moose/MooseX-Storage" }, "x_IRC" : "irc://irc.perl.org/#moose", "x_MailingList" : "http://lists.perl.org/list/moose.html" }, "version" : "0.53", "x_Dist_Zilla" : { "perl" : { "version" : "5.031010" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle version", "version" : "6.014" }, { "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.055" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "6.014" }, { "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.046" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "6.014" }, { "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.009" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/InstallGuide", "version" : "1.200013" }, { "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.058" }, { "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.014" }, { "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::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "xt/author/changes_has_content.t", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "location" : "build", "source_filename" : "changes_has_content.t" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.009" } }, "name" : "@Author::ETHER/generate xt/author/changes_has_content.t", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : "5.008003" } }, "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "examples", "lib", "script", "t", "xt" ], "spell_cmd" : "", "stopwords" : [ "cpan", "irc" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.007005" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.004" }, { "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.027" }, { "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::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@Author::ETHER" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@Author::ETHER/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@Author::ETHER/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::ETHER/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/List", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/Verbatim", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/header", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::ETHER/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::ETHER/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::ETHER/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@Author::ETHER/generate SUPPORT", "version" : "1.06" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override SUPPORT", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::ETHER/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override AUTHOR", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::ETHER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::ETHER/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/footer", "version" : "4.015" } ] } }, "name" : "@Author::ETHER/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.58" }, { "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.014" }, { "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.014" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 0, "inherit_version" : 0, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [ "moose", "extension", "serial", "serialization", "class", "object", "store", "storage", "types", "strings" ] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::UseUnsafeInc", "config" : { "Dist::Zilla::Plugin::UseUnsafeInc" : { "dot_in_INC" : 0 } }, "name" : "@Author::ETHER/UseUnsafeInc", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "6.014" }, { "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::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/MakeMaker", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.25.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.035" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 1, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.012" }, { "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.000037", "version" : "0.006" } }, "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\"" ], "version" : "0.048" } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.048" }, { "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, "version" : "0.048" } }, "name" : "@Author::ETHER/.latest", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::ETHER/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::EnsureLatestPerl", "config" : { "Dist::Zilla::Plugin::EnsureLatestPerl" : { "Module::CoreList" : "5.20200320" } }, "name" : "@Author::ETHER/EnsureLatestPerl", "version" : "0.008" }, { "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.055" }, { "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.25.0", "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.25.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.25.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.1.2" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "6.014" }, { "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.25.0", "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/copy generated files", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/@Git::VersionManager/pluginbundle version", "version" : "6.014" }, { "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/@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Author::ETHER/@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease", "version" : "0.007" }, { "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.25.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/release snapshot", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.53", "tag_format" : "v%V", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.25.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/Git::Tag", "version" : "2.046" }, { "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/@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/@Git::VersionManager/NextRelease", "version" : "6.014" }, { "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" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.25.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/post-release commit", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager", "version" : "6.014" }, { "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.25.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.47" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ], "version" : "0.048" } }, "name" : "@Author::ETHER/install release", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1, "version" : "0.048" } }, "name" : "@Author::ETHER/release complete", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/prereqs for @Author::ETHER", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Test::CheckBreaks", "config" : { "Dist::Zilla::Plugin::Test::CheckBreaks" : { "conflicts_module" : [ "Module::Runtime::Conflicts", "Moose::Conflicts" ], "no_forced_deps" : 0 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "Test::CheckBreaks", "version" : "0.019" }, { "class" : "Dist::Zilla::Plugin::Prereqs::Soften", "config" : { "Dist::Zilla::Plugin::Prereqs::Soften" : { "copy_to" : [ "develop.requires" ], "modules" : [ "Digest::HMAC_SHA1", "MooseX::Types", "MooseX::Types::Moose" ], "modules_from_features" : "1", "to_relationship" : "suggests" } }, "name" : "Prereqs::Soften", "version" : "0.006003" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "Serialize to JSON. You should have at least one serialization format.", "name" : "JSON", "phase" : "runtime", "prereqs" : { "JSON::MaybeXS" : "1.001000" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "JSON-Runtime", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 0, "always_suggest" : 1, "default" : "1", "description" : "Serialize to JSON. You should have at least one serialization format.", "name" : "JSON", "phase" : "runtime", "prereqs" : { "MooseX::Storage::Format::JSONpm" : "0" }, "prompt" : 0, "require_develop" : 1, "type" : "recommends" } }, "name" : "JSON-RuntimeRecommends", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "Serialize to JSON. You should have at least one serialization format.", "name" : "JSON", "phase" : "test", "prereqs" : { "Test::Deep::JSON" : "0" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "JSON-Test", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "Serialize to YAML. You should have at least one serialization format.", "name" : "YAML", "phase" : "runtime", "prereqs" : { "YAML::Any" : "0" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "YAML-Runtime", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "default" : "1", "description" : "Serialize to YAML. You should have at least one serialization format.", "name" : "YAML", "phase" : "runtime", "prereqs" : { "YAML" : "0", "YAML::Syck" : "0", "YAML::XS" : "0" }, "prompt" : 0, "require_develop" : 1, "type" : "recommends" } }, "name" : "YAML-RuntimeRecommends", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "Serialize to YAML. You should have at least one serialization format.", "name" : "YAML", "phase" : "test", "prereqs" : { "Test::Without::Module" : "0" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "YAML-Test", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "Serialize to Storable. You should have at least one serialization format.", "name" : "Storable", "phase" : "runtime", "prereqs" : { "Storable" : "0" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "Storable", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::OptionalFeature", "config" : { "Dist::Zilla::Plugin::OptionalFeature" : { "always_recommend" : 1, "always_suggest" : 0, "check_prereqs" : 1, "default" : "1", "description" : "the ability to save the file to disk", "name" : "File", "phase" : "runtime", "prereqs" : { "IO::AtomicFile" : "0", "IO::File" : "0" }, "prompt" : 1, "require_develop" : 1, "type" : "requires" } }, "name" : "File", "version" : "0.023" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::DynamicPrereqs", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "via OptionalFeature", "version" : "0.037" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.014" } }, "x_authority" : "cpan:STEVAN", "x_contributors" : [ "Karen Etheridge ", "Tomas Doran ", "Ricardo Signes ", "Chris Prather ", "Jos Boumans ", "Shawn M Moore ", "Jonathan Yu ", "Dmitry Latin ", "Robert Boone ", "Dagfinn Ilmari Manns\u00e5ker ", "Cory Watson ", "sillitoe ", "Dan Brook ", "David Golden ", "David Steinbrunner ", "Florian Ragwitz ", "Graham Knop ", "Jason Pope ", "Johannes Plunien ", "Jonathan Rockway ", "Yanick Champoux " ], "x_generated_by_perl" : "v5.31.10", "x_serialization_backend" : "Cpanel::JSON::XS version 4.19", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_use_unsafe_inc" : 0 } MooseX-Storage-0.53/dist.ini000640 000766 000024 00000006335 13646474070 016212 0ustar00etherstaff000000 000000 name = MooseX-Storage author = Chris Prather author = Stevan Little author = יובל קוג'מן (Yuval Kogman) copyright_holder = Infinity Interactive, Inc. copyright_year = 2007 license = Perl_5 :version = 5 [@Author::ETHER] :version = 0.119 installer = MakeMaker ; [OptionalFeatures] adds Makefile.PL content authority = cpan:STEVAN Test::MinimumVersion.max_target_perl = 5.008003 ; these appear in every file, so it's easier to just put it here Test::PodSpelling.stopwords = cpan AutoPrereqs.skip[0] = ^Class(One|Two)$ Test::ReportPrereqs.include[0] = Dist::CheckConflicts Test::ReportPrereqs.include[1] = JSON Test::ReportPrereqs.include[2] = JSON::PP Test::ReportPrereqs.include[3] = JSON::DWIW Test::ReportPrereqs.include[4] = JSON::Syck Test::ReportPrereqs.include[5] = JSON::XS Test::ReportPrereqs.include[6] = Cpanel::JSON::XS Test::ReportPrereqs.include[7] = JSON::MaybeXS Test::ReportPrereqs.include[8] = YAML::XS Test::ReportPrereqs.include[9] = YAML::Syck Test::ReportPrereqs.include[10] = YAML::Old Test::ReportPrereqs.include[11] = YAML Test::ReportPrereqs.include[12] = YAML::Tiny Test::ReportPrereqs.include[13] = YAML::Any Test::ReportPrereqs.include[14] = YAML::XS Test::ReportPrereqs.include[15] = MooseX::Role::Parameterized [MetaResources] x_IRC = irc://irc.perl.org/#moose x_MailingList = http://lists.perl.org/list/moose.html [Test::CheckBreaks] :version = 0.017 conflicts_module = Moose::Conflicts conflicts_module = Module::Runtime::Conflicts [Prereqs::Soften] :version = 0.004000 module = Digest::HMAC_SHA1 module = MooseX::Types module = MooseX::Types::Moose modules_from_features = 1 to_relationship = suggests copy_to = develop.requires [OptionalFeature / JSON-Runtime] :version = 0.006 ; for -default -description = Serialize to JSON. You should have at least one serialization format. -always_recommend = 1 -default = 1 JSON::MaybeXS = 1.001000 [OptionalFeature / JSON-RuntimeRecommends] -description = Serialize to JSON. You should have at least one serialization format. -always_suggest = 1 -default = 1 MooseX::Storage::Format::JSONpm = 0 [OptionalFeature / JSON-Test] -description = Serialize to JSON. You should have at least one serialization format. -always_recommend = 1 -default = 1 Test::Deep::JSON = 0 [OptionalFeature / YAML-Runtime] -description = Serialize to YAML. You should have at least one serialization format. -always_recommend = 1 -default = 1 YAML::Any = 0 [OptionalFeature / YAML-RuntimeRecommends] -description = Serialize to YAML. You should have at least one serialization format. -always_recommend = 1 -default = 1 YAML = 0 YAML::Syck = 0 YAML::XS = 0 [OptionalFeature / YAML-Test] -description = Serialize to YAML. You should have at least one serialization format. -always_recommend = 1 -default = 1 Test::Without::Module = 0 [OptionalFeature / Storable] -description = Serialize to Storable. You should have at least one serialization format. -always_recommend = 1 -default = 1 Storable = 0 [OptionalFeature / File] -description = the ability to save the file to disk -always_recommend = 1 -default = 1 IO::File = 0 IO::AtomicFile = 0 MooseX-Storage-0.53/lib/MooseX/000770 000766 000024 00000000000 13646474070 016520 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/000770 000766 000024 00000000000 13646474070 020124 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage.pm000640 000766 000024 00000030356 13646474070 020470 0ustar00etherstaff000000 000000 package MooseX::Storage; # git description: v0.52-18-g2733271 # ABSTRACT: A serialization framework for Moose classes # KEYWORDS: moose extension serial serialization class object store storage types strings our $VERSION = '0.53'; use Moose 0.99; use MooseX::Storage::Meta::Attribute::DoNotSerialize; use String::RewritePrefix (); use Module::Runtime 'use_module'; use Carp 'confess'; use namespace::autoclean; sub import { my $pkg = caller(); return if $pkg eq 'main'; ($pkg->can('meta')) || confess "This package can only be used in Moose based classes"; $pkg->meta->add_method('Storage' => __PACKAGE__->meta->find_method_by_name('_injected_storage_role_generator')); } my %HORRIBLE_GC_AVOIDANCE_HACK; sub _rewrite_role_name { my ($self, $base, $string) = @_; my $role_name = scalar String::RewritePrefix->rewrite( { '' => "MooseX::Storage::$base\::", '=' => '', }, $string, ); } sub _expand_role { my ($self, $base, $value) = @_; return unless defined $value; if (ref $value) { confess "too many args in arrayref role declaration" if @$value > 2; my ($class, $param) = @$value; $class = $self->_rewrite_role_name($base => $class); use_module($class); my $role = $class->meta->generate_role(parameters => $param); $HORRIBLE_GC_AVOIDANCE_HACK{ $role->name } = $role; return $role->name; } else { my $class = $self->_rewrite_role_name($base, $value); use_module($class); if ($class->meta->isa('MooseX::Role::Parameterized::Meta::Role::Parameterizable') or ($class->meta->meta->can('does_role') && $class->meta->meta->does_role('MooseX::Role::Parameterized::Meta::Trait::Parameterizable')) ) { my $role = $class->meta->generate_role(parameters => undef); $HORRIBLE_GC_AVOIDANCE_HACK{ $role->name } = $role; return $role->name; } return $class; } } sub _injected_storage_role_generator { my %params = @_; $params{base} = '=MooseX::Storage::Basic' unless defined $params{base}; my @roles = __PACKAGE__->_expand_role(Base => $params{base}); # NOTE: # you don't have to have a format # role, this just means you don't # get anything other than pack/unpack push @roles, __PACKAGE__->_expand_role(Format => $params{format}); # NOTE: # many IO roles don't make sense unless # you have also have a format role chosen # too, the exception being StorableFile # # NOTE: # we don't need this code anymore, because # the role composition will catch it for # us. This allows the StorableFile to work #(exists $params{'format'}) # || confess "You must specify a format role in order to use an IO role"; push @roles, __PACKAGE__->_expand_role(IO => $params{io}); # Note: # These traits alter the behaviour of the engine, the user can # specify these per role-usage for my $trait ( @{ $params{'traits'} ||= [] } ) { push @roles, __PACKAGE__->_expand_role(Traits => $trait); } return @roles; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage - A serialization framework for Moose classes =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON', 'io' => 'File'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to pack/unpack an ## object in perl data structures # pack the class into a hash $p->pack(); # { __CLASS__ => 'Point-0.01', x => 10, y => 10 } # unpack the hash into a class my $p2 = Point->unpack({ __CLASS__ => 'Point-0.01', x => 10, y => 10 }); ## methods to freeze/thaw into ## a specified serialization format ## (in this case JSON) # pack the class into a JSON string $p->freeze(); # { "__CLASS__" : "Point-0.01", "x" : 10, "y" : 10 } # unpack the JSON string into a class my $p2 = Point->thaw('{ "__CLASS__" : "Point-0.01", "x" : 10, "y" : 10 }'); ## methods to load/store a class ## on the file system $p->store('my_point.json'); my $p2 = Point->load('my_point.json'); =head1 DESCRIPTION MooseX::Storage is a serialization framework for Moose, it provides a very flexible and highly pluggable way to serialize Moose classes to a number of different formats and styles. =head2 Levels of Serialization There are three levels to the serialization, each of which builds upon the other and each of which can be customized to the specific needs of your class. =over 4 =item B The first (base) level is C and C. In this level the class is serialized into a Perl HASH reference, it is tagged with the class name and each instance attribute is stored. Very simple. This level is not optional, it is the bare minimum that MooseX::Storage provides and all other levels build on top of this. See L for the fundamental implementation and options to C and C =item B The second (format) level is C and C. In this level the output of C is sent to C or the output of C is sent to C. This levels primary role is to convert to and from the specific serialization format and Perl land. This level is optional, if you don't want/need it, you don't have to have it. You can just use C/C instead. =for stopwords io =item B The third (io) level is C and C. In this level we are reading and writing data to file/network/database/etc. This level is also optional, in most cases it does require a C role to also be used, the exception being the C role. =back =head2 Behaviour modifiers The serialization behaviour can be changed by supplying C to either the class or an individual attribute. This can be done as follows: use MooseX::Storage; # adjust behaviour for the entire class with Storage( traits => [Trait1, Trait2,...] ); # adjust behaviour for an attribute has my_attr => ( traits => [Trait1, Trait2, ...], ... ); The following B are currently bundled with L: =over 4 =item OnlyWhenBuilt Only attributes that have been built (i.e., where the predicate returns 'true') will be serialized. This avoids any potentially expensive computations. See L for details. =item DisableCycleDetection =for stopwords serialisable Disables the default checks for circular references, which is necessary if you use such references in your serialisable objects. See L for details. =back The following B are currently bundled with L: =over 4 =item DoNotSerialize Skip serialization entirely for this attribute. See L for details. =back =head2 How we serialize There are always limits to any serialization framework -- there are just some things which are really difficult to serialize properly and some things which cannot be serialized at all. =head2 What can be serialized? Currently only numbers, string, ARRAY refs, HASH refs and other MooseX::Storage-enabled objects are supported. With Array and Hash references the first level down is inspected and any objects found are serialized/deserialized for you. We do not do this recursively by default, however this feature may become an option eventually. =for stopwords subtypes The specific serialize/deserialize routine is determined by the L type constraint a specific attribute has. In most cases subtypes of the supported types are handled correctly, and there is a facility for adding handlers for custom types as well. This will get documented eventually, but it is currently still in development. =head2 What can not be serialized? We do not support CODE references yet, but this support might be added in using L or some other deep magic. Scalar refs are not supported, mostly because there is no way to know if the value being referenced will be there when the object is inflated. I highly doubt will be ever support this in a general sense, but it would be possible to add this yourself for a small specific case. Circular references are specifically disallowed, however if you break the cycles yourself then re-assemble them later you can get around this. The reason we disallow circular refs is because they are not always supported in all formats we use, and they tend to be very tricky to do for all possible cases. It is almost always something you want to have tight control over anyway. =head1 CAVEAT This is B a persistence framework; changes to your object after you load or store it will not be reflected in the stored class. =head1 EXPORTS =over 4 =item B This module will export the C method and can be used to load a specific set of MooseX::Storage roles to implement a specific combination of features. It is meant to make things easier, but it is by no means the only way. You can still compose your roles by hand if you like. By default, options are assumed to be short forms. For example, this: Storage(format => 'JSON'); ...will result in looking for MooseX::Storage::Format::JSON. To use a role that is not under the default namespace prefix, start with an equal sign: Storage(format => '=My::Private::JSONFormat'); =for stopwords parameterized To use a parameterized role (for which, see L) you can pass an arrayref of the role name (in short or long form, as above) and its parameters: Storage(format => [ JSONpm => { json_opts => { pretty => 1 } } ]); =back =head1 METHODS =over 4 =item B =back =head2 Introspection =over 4 =item B =back =for stopwords TODO =head1 TODO This module needs docs and probably a Cookbook of some kind as well. This is an early release, so that is my excuse for now :) For the time being, please read the tests and feel free to email me if you have any questions. This module can also be discussed on IRC in the #moose channel on irc.perl.org. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 CONTRIBUTORS =for stopwords Karen Etheridge Tomas Doran Ricardo Signes Chris Prather Jos Boumans Shawn M Moore Jonathan Yu Dmitry Latin Robert Boone Dagfinn Ilmari Mannsåker Cory Watson sillitoe Dan Brook David Golden Steinbrunner Florian Ragwitz Graham Knop Jason Pope Johannes Plunien Rockway Yanick Champoux =over 4 =item * Karen Etheridge =item * Tomas Doran =item * Ricardo Signes =item * Chris Prather =item * Jos Boumans =item * Shawn M Moore =item * Jonathan Yu =item * Dmitry Latin =item * Robert Boone =item * Dagfinn Ilmari Mannsåker =item * Cory Watson =item * sillitoe =item * Dan Brook =item * David Golden =item * David Steinbrunner =item * Florian Ragwitz =item * Graham Knop =item * Jason Pope =item * Johannes Plunien =item * Jonathan Rockway =item * Yanick Champoux =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Traits/000770 000766 000024 00000000000 13646474070 021372 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Util.pm000640 000766 000024 00000007344 13646474070 021406 0ustar00etherstaff000000 000000 package MooseX::Storage::Util; # ABSTRACT: A MooseX::Storage Swiss Army chainsaw our $VERSION = '0.53'; use Moose; use MooseX::Storage::Engine (); use Scalar::Util 'blessed'; use Carp 'confess'; use JSON::MaybeXS 1.001000; use namespace::autoclean; sub peek { my ($class, $data, %options) = @_; if (exists $options{'format'}) { my $inflater = $class->can('_inflate_' . lc($options{'format'})); (defined $inflater) || confess "No inflater found for " . $options{'format'}; $data = $class->$inflater($data); } (ref($data) && ref($data) eq 'HASH' && !blessed($data)) || confess "The data has to be a HASH reference, but not blessed"; $options{'key'} ||= $MooseX::Storage::Engine::CLASS_MARKER; return $data->{$options{'key'}}; } sub _inflate_json { my ($self, $json) = @_; eval { require JSON::MaybeXS; JSON::MaybeXS->import }; confess "Could not load JSON module because : $@" if $@; # this is actually a bad idea, but for consistency, we'll have to keep # doing it... utf8::encode($json) if utf8::is_utf8($json); my $data = eval { JSON::MaybeXS->new({ utf8 => 1 })->decode($json) }; if ($@) { confess "There was an error when attempting to peek at JSON: $@"; } return $data; } sub _inflate_yaml { my ($self, $yaml) = @_; eval { require YAML::Any; YAML::Any->import }; confess "Could not load YAML module because : $@" if $@; my $data = eval { Load($yaml) }; if ($@) { confess "There was an error when attempting to peek at YAML : $@"; } return $data; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Util - A MooseX::Storage Swiss Army chainsaw =head1 VERSION version 0.53 =head1 DESCRIPTION This module provides a set of tools, some sharp and focused, others more blunt and crude. But no matter what, they are useful bits to have around when dealing with MooseX::Storage code. =head1 METHODS All the methods in this package are class methods and should be called appropriately. =over 4 =item B This method will help you to verify that the serialized class you have gotten is what you expect it to be before you actually unfreeze/unpack it. The C<$data> can be either a perl HASH ref or some kind of serialized data (JSON, YAML, etc.). The C<%options> are as follows: =over 4 =item I If this is left blank, we assume that C<$data> is a plain perl HASH ref otherwise we attempt to inflate C<$data> based on the value of this option. Currently only JSON and YAML are supported here. =item I The default is to try and extract the class name, but if you want to check another key in the data, you can set this option. It will return the value found in the key for you. =back =back =for stopwords TODO =head1 TODO Add more stuff to this module :) =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/IO/000770 000766 000024 00000000000 13646474070 020433 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Meta/000770 000766 000024 00000000000 13646474070 021012 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Deferred.pm000640 000766 000024 00000010230 13646474070 022175 0ustar00etherstaff000000 000000 package MooseX::Storage::Deferred; # ABSTRACT: A role for indecisive programmers our $VERSION = '0.53'; use Moose::Role; with 'MooseX::Storage::Basic'; use Carp 'confess'; use namespace::autoclean; sub __get_method { my ( $self, $basename, $value, $method_name ) = @_; my $role = MooseX::Storage->_expand_role($basename => $value)->meta; my $method = $role->get_method($method_name)->body; } sub thaw { my ( $class, $packed, $type, @args ) = @_; (exists $type->{format}) || confess "You must specify a format type to thaw from"; my $code = $class->__get_method(Format => $type->{format} => 'thaw'); $class->$code($packed, @args); } sub freeze { my ( $self, $type, @args ) = @_; (exists $type->{format}) || confess "You must specify a format type to freeze into"; my $code = $self->__get_method(Format => $type->{format} => 'freeze'); $self->$code(@args); } sub load { my ( $class, $filename, $type, @args ) = @_; (exists $type->{io}) || confess "You must specify an I/O type to load with"; my $code = $class->__get_method(IO => $type->{io} => 'load'); $class->$code($filename, $type, @args); } sub store { my ( $self, $filename, $type, @args ) = @_; (exists $type->{io}) || confess "You must specify an I/O type to store with"; my $code = $self->__get_method(IO => $type->{io} => 'store'); $self->$code($filename, $type, @args); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Deferred - A role for indecisive programmers =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with 'MooseX::Storage::Deferred'; has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to freeze/thaw into ## a specified serialization format ## (in this case JSON) # pack the class into a JSON string $p->freeze({ format => 'JSON' }); # { "__CLASS__" : "Point", "x" : 10, "y" : 10 } # pack the class into a JSON string using parameterized JSONpm role $p->freeze({ format => [ JSONpm => { json_opts => { pretty => 1 } } ] }); # unpack the JSON string into a class my $p2 = Point->thaw( '{ "__CLASS__" : "Point", "x" : 10, "y" : 10 }', { format => 'JSON' } ); =head1 DESCRIPTION This role is designed for those times when you need to serialize into many different formats or I/O options. It basically allows you to choose the format and IO options only when you actually use them (see the SYNOPSIS for more info) =head1 SUPPORTED FORMATS =over 4 =item I =for stopwords JSONpm =item I =item I =item I =back =head1 SUPPORTED I/O =over 4 =item I =item I =back B The B I/O option is not supported, this is because it does not mix well with options who also have a C and C methods like this. It is possible to probably work around this issue, but I don't currently have the need for it. If you need this supported, talk to me and I will see what I can do. =head1 METHODS =over 4 =item B =item B =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Basic.pm000640 000766 000024 00000007366 13646474070 021516 0ustar00etherstaff000000 000000 package MooseX::Storage::Basic; # ABSTRACT: The simplest level of serialization our $VERSION = '0.53'; use Moose::Role; use MooseX::Storage::Engine; use String::RewritePrefix; use namespace::autoclean; sub pack { my ( $self, %args ) = @_; my $e = $self->_storage_get_engine_class(%args)->new( object => $self ); $e->collapse_object(%args); } sub unpack { my ($class, $data, %args) = @_; my $e = $class->_storage_get_engine_class(%args)->new(class => $class); $class->_storage_construct_instance( $e->expand_object($data, %args), \%args ); } sub _storage_get_engine_class { my ($self, %args) = @_; return 'MooseX::Storage::Engine' unless ( exists $args{engine_traits} && ref($args{engine_traits}) eq 'ARRAY' && scalar(@{$args{engine_traits}}) ); my @roles = String::RewritePrefix->rewrite( { '' => 'MooseX::Storage::Engine::Trait::', '+' => '', }, @{$args{engine_traits}} ); Moose::Meta::Class->create_anon_class( superclasses => ['MooseX::Storage::Engine'], roles => [ @roles ], cache => 1, )->name; } sub _storage_construct_instance { my ($class, $args, $opts) = @_; my %i = defined $opts->{'inject'} ? %{ $opts->{'inject'} } : (); $class->new( %$args, %i ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Basic - The simplest level of serialization =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage; has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to pack/unpack an ## object in perl data structures # pack the class into a hash $p->pack(); # { __CLASS__ => 'Point-0.01', x => 10, y => 10 } # unpack the hash into a class my $p2 = Point->unpack({ __CLASS__ => 'Point-0.01', x => 10, y => 10 }); # unpack the hash, with injection of additional paramaters my $p3 = Point->unpack( $p->pack, inject => { x => 11 } ); =head1 DESCRIPTION This is the most basic form of serialization. This is used by default but the exported C function. =head1 METHODS =over 4 =item B 1])> Providing the C argument disables checks for any cyclical references. The current implementation for this check is rather naive, so if you know what you are doing, you can bypass this check. This trait is applied on a perl-case basis. To set this flag for all objects that inherit from this role, see L. =item B { key => val, ... } ] )> Providing the C argument lets you supply additional arguments to the class' C function, or override ones from the serialized data. =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Engine.pm000640 000766 000024 00000036026 13646474070 021675 0ustar00etherstaff000000 000000 package MooseX::Storage::Engine; # ABSTRACT: The meta-engine to handle collapsing and expanding objects our $VERSION = '0.53'; use Moose; use Scalar::Util qw(refaddr blessed); use Carp 'confess'; use namespace::autoclean; # the class marker when # serializing an object. our $CLASS_MARKER = '__CLASS__'; has 'storage' => ( is => 'ro', isa => 'HashRef', default => sub {{}} ); has 'seen' => ( is => 'ro', isa => 'HashRef[Int]', # int is the refaddr default => sub {{}} ); has 'object' => (is => 'rw', isa => 'Object', predicate => '_has_object'); has 'class' => (is => 'rw', isa => 'Str'); ## this is the API used by other modules ... sub collapse_object { my ( $self, %options ) = @_; # NOTE: # mark the root object as seen ... $self->seen->{refaddr $self->object} = undef; $self->map_attributes('collapse_attribute', \%options); $self->storage->{$CLASS_MARKER} = $self->object->meta->identifier; return $self->storage; } sub expand_object { my ($self, $data, %options) = @_; $options{check_version} = 1 unless exists $options{check_version}; $options{check_authority} = 1 unless exists $options{check_authority}; # NOTE: # mark the root object as seen ... $self->seen->{refaddr $data} = undef; $self->map_attributes('expand_attribute', $data, \%options); return $self->storage; } ## this is the internal API ... sub collapse_attribute { my ($self, $attr, $options) = @_; my $value = $self->collapse_attribute_value($attr, $options); return unless $attr->has_value($self->object); $self->storage->{$attr->name} = $value; } sub expand_attribute { my ($self, $attr, $data, $options) = @_; return unless exists $data->{$attr->name}; my $value = $self->expand_attribute_value($attr, $data->{$attr->name}, $options); $self->storage->{$attr->name} = $value; } sub collapse_attribute_value { my ($self, $attr, $options) = @_; # Faster, but breaks attributes without readers, do we care? #my $value = $attr->get_read_method_ref->($self->object); my $value = $attr->get_value($self->object); # NOTE: # this might not be enough, we might # need to make it possible for the # cycle checker to return the value $self->check_for_cycle_in_collapse($attr, $value) if ref $value; if (defined $value && $attr->has_type_constraint) { my $type_converter = $self->find_type_handler($attr->type_constraint, $value); (defined $type_converter) || confess "Cannot convert " . $attr->type_constraint->name; $value = $type_converter->{collapse}->($value, $options); } return $value; } sub expand_attribute_value { my ($self, $attr, $value, $options) = @_; # NOTE: # (see comment in method above ^^) if( ref $value and not( $options->{disable_cycle_check} or $self->class->does('MooseX::Storage::Traits::DisableCycleDetection') )) { $self->check_for_cycle_in_collapse($attr, $value) } if (defined $value && $attr->has_type_constraint) { my $type_converter = $self->find_type_handler($attr->type_constraint, $value); $value = $type_converter->{expand}->($value, $options); } return $value; } # NOTE: possibly these two methods will be used by a cycle supporting engine. # However, I am not sure if I can make a cycle one work anyway. sub check_for_cycle_in_collapse { my ($self, $attr, $value) = @_; (!exists $self->seen->{refaddr $value}) || confess "Basic Engine does not support cycles in class(" . ($attr->associated_class->name) . ").attr(" . ($attr->name) . ") with $value"; $self->seen->{refaddr $value} = undef; } sub check_for_cycle_in_expansion { my ($self, $attr, $value) = @_; (!exists $self->seen->{refaddr $value}) || confess "Basic Engine does not support cycles in class(" . ($attr->associated_class->name) . ").attr(" . ($attr->name) . ") with $value"; $self->seen->{refaddr $value} = undef; } # util methods ... sub map_attributes { my ($self, $method_name, @args) = @_; map { $self->$method_name($_, @args) } grep { # Skip our special skip attribute :) !$_->does('MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize') } ($self->_has_object ? $self->object : $self->class)->meta->get_all_attributes; } ## ------------------------------------------------------------------ ## This is all the type handler stuff, it is in a state of flux ## right now, so this may change, or it may just continue to be ## improved upon. Comments and suggestions are welcomed. ## ------------------------------------------------------------------ # NOTE: # these are needed by the # ArrayRef and HashRef handlers # below, so I need easy access my %OBJECT_HANDLERS = ( expand => sub { my ($data, $options) = @_; (exists $data->{$CLASS_MARKER}) || confess "Serialized item has no class marker"; # check the class more thoroughly here ... my ($class, $version, $authority) = (split '-' => $data->{$CLASS_MARKER}); my $meta = eval { $class->meta }; confess "Class ($class) is not loaded, cannot unpack" if $@; if ($options->{check_version}) { my $meta_version = $meta->version; if (defined $meta_version && $version) { if ($options->{check_version} eq 'allow_less_than') { ($meta_version <= $version) || confess "Class ($class) versions is not less than currently available." . " got=($version) available=($meta_version)"; } elsif ($options->{check_version} eq 'allow_greater_than') { ($meta->version >= $version) || confess "Class ($class) versions is not greater than currently available." . " got=($version) available=($meta_version)"; } else { ($meta->version == $version) || confess "Class ($class) versions don't match." . " got=($version) available=($meta_version)"; } } } if ($options->{check_authority}) { my $meta_authority = $meta->authority; ($meta->authority eq $authority) || confess "Class ($class) authorities don't match." . " got=($authority) available=($meta_authority)" if defined $meta_authority && defined $authority; } # all is well ... $class->unpack($data, %$options); }, collapse => sub { my ( $obj, $options ) = @_; # ($obj->can('does') && $obj->does('MooseX::Storage::Basic')) # || confess "Bad object ($obj) does not do MooseX::Storage::Basic role"; ($obj->can('pack')) || confess "Object ($obj) does not have a &pack method, cannot collapse"; $obj->pack(%$options); }, ); my %TYPES = ( # NOTE: # we need to make sure that we properly numify the numbers # before and after them being futzed with, because some of # the JSON engines are stupid/annoying/frustrating 'Int' => { expand => sub { $_[0] + 0 }, collapse => sub { $_[0] + 0 } }, 'Num' => { expand => sub { $_[0] + 0 }, collapse => sub { $_[0] + 0 } }, # These are boring ones, so they use the identity function ... 'Str' => { expand => sub { shift }, collapse => sub { shift } }, 'Value' => { expand => sub { shift }, collapse => sub { shift } }, 'Bool' => { expand => sub { shift }, collapse => sub { shift } }, # These are the trickier ones, (see notes) # NOTE: Because we are nice guys, we will check your ArrayRef and/or # HashRef one level down and inflate any objects we find. But this is # where it ends, it is too expensive to try and do this any more # recursively, when it is probably not necessary in most of the use cases. # However, if you need more than this, subtype and add a custom handler. 'ArrayRef' => { expand => sub { my ( $array, @args ) = @_; foreach my $i (0 .. $#{$array}) { next unless ref($array->[$i]) eq 'HASH' && exists $array->[$i]->{$CLASS_MARKER}; $array->[$i] = $OBJECT_HANDLERS{expand}->($array->[$i], @args); } $array; }, collapse => sub { my ( $array, @args ) = @_; # NOTE: we need to make a copy because otherwise it will affect # the other real version. [ map { blessed($_) ? $OBJECT_HANDLERS{collapse}->($_, @args) : $_ } @$array ] } }, 'HashRef' => { expand => sub { my ( $hash, @args ) = @_; foreach my $k (keys %$hash) { next unless ref($hash->{$k}) eq 'HASH' && exists $hash->{$k}->{$CLASS_MARKER}; $hash->{$k} = $OBJECT_HANDLERS{expand}->($hash->{$k}, @args); } $hash; }, collapse => sub { my ( $hash, @args ) = @_; # NOTE: we need to make a copy because otherwise it will affect # the other real version. +{ map { blessed($hash->{$_}) ? ($_ => $OBJECT_HANDLERS{collapse}->($hash->{$_}, @args)) : ($_ => $hash->{$_}) } keys %$hash } } }, 'Object' => \%OBJECT_HANDLERS, # NOTE: The sanity of enabling this feature by default is very # questionable. - SL #'CodeRef' => { # expand => sub {}, # use eval ... # collapse => sub {}, # use B::Deparse ... #} ); sub add_custom_type_handler { my ($self, $type_name, %handlers) = @_; (exists $handlers{expand} && exists $handlers{collapse}) || confess "Custom type handlers need an expand *and* a collapse method"; $TYPES{$type_name} = \%handlers; } sub remove_custom_type_handler { my ($self, $type_name) = @_; delete $TYPES{$type_name} if exists $TYPES{$type_name}; } sub find_type_handler { my ($self, $type_constraint, $value) = @_; # this should handle most type usages since they they are usually just the # standard set of built-ins -- but we should also respect any custom type # handlers that the user may have defined return $TYPES{$type_constraint->name} if exists $TYPES{$type_constraint->name}; # check if the type is a Maybe and if its parent is not parameterized. If # both is true recurse this method using ->type_parameter. if (my $parent = $type_constraint->parent) { return $self->find_type_handler($type_constraint->type_parameter, $value) if $parent eq 'Maybe' and not $parent->can('type_parameter'); # also account for the additional level added by MooseX::Types's use of maybe_type if ($parent->isa('Moose::Meta::TypeConstraint::Parameterized')) { my $parameter = $parent->parameterized_from; return $self->find_type_handler($parent->type_parameter, $value) if $parameter eq 'Maybe' and not $parameter->can('type_parameter'); } } # find_type_for is a method of a union type. If we can call that method # then we are dealing with a union and we need to ascertain which of # the union's types we need to use for the value we are serializing. if($type_constraint->can('find_type_for')) { my $tc = $type_constraint->find_type_for($value); return $self->find_type_handler($tc, $value) if defined($tc); } # the next possibility is they are a subtype of the built-in types, in # which case this will DWIM in most cases. It is probably not 100% ideal # though, but until I come up with a decent test case it will do for now. # We need to check more-specific types first. my %seen; my @fallback = grep { !$seen{$_}++ } qw/Int Num Str Value/, keys %TYPES; foreach my $type ( @fallback ) { return $TYPES{$type} if $type_constraint->is_subtype_of($type); } # NOTE: the reason the above will work has to do with the fact that custom # subtypes are mostly used for validation of the guts of a type, and not # for some weird structural thing which would need to be accomodated by # the serializer. Of course, mst or phaylon will probably do something to # throw this assumption totally out the door ;) - SL # NOTE: if this method hasn't returned by now then we have not been able # to find a type constraint handler to match confess "Cannot handle type constraint (" . $type_constraint->name . ")"; } sub find_type_handler_for { my ($self, $type_handler_name) = @_; $TYPES{$type_handler_name} } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Engine - The meta-engine to handle collapsing and expanding objects =head1 VERSION version 0.53 =head1 DESCRIPTION There really aren't any major user serviceable parts here. However the typical use case is adding new non-Moose classes to the type registry for serialization. Here is an example of this for L objects. This assumes a C type has been registered. MooseX::Storage::Engine->add_custom_type_handler( 'DateTime' => ( expand => sub { DateTime::Format::ISO8601->new->parser_datetime(shift) }, collapse => sub { (shift)->iso8601 }, ) ); =head1 METHODS =head2 Accessors =over 4 =item B =item B =item B =item B =back =head2 API =over 4 =item B =item B =back =head2 ... =over 4 =item B =item B =item B =item B =item B =item B =item B =back =head2 Type Constraint Handlers =over 4 =item B =item B =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Format/000770 000766 000024 00000000000 13646474070 021354 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Engine/000770 000766 000024 00000000000 13646474070 021331 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Base/000770 000766 000024 00000000000 13646474070 020776 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Base/WithChecksum.pm000640 000766 000024 00000007043 13646474070 023735 0ustar00etherstaff000000 000000 package MooseX::Storage::Base::WithChecksum; # ABSTRACT: A more secure serialization role our $VERSION = '0.53'; use Moose::Role; with 'MooseX::Storage::Basic'; use Digest (); use Data::Dumper (); use Carp 'confess'; use namespace::autoclean; our $DIGEST_MARKER = '__DIGEST__'; around pack => sub { my $orig = shift; my $self = shift; my @args = @_; my $collapsed = $self->$orig( @args ); $collapsed->{$DIGEST_MARKER} = $self->_digest_packed($collapsed, @args); return $collapsed; }; around unpack => sub { my ($orig, $class, $data, @args) = @_; # check checksum on data my $old_checksum = delete $data->{$DIGEST_MARKER}; my $checksum = $class->_digest_packed($data, @args); ($checksum eq $old_checksum) || confess "Bad Checksum got=($checksum) expected=($old_checksum)"; $class->$orig( $data, @args ); }; sub _digest_packed { my ( $self, $collapsed, @args ) = @_; my $d = $self->_digest_object(@args); { local $Data::Dumper::Indent = 0; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Terse = 1; local $Data::Dumper::Useqq = 0; local $Data::Dumper::Deparse = 0; # FIXME? my $str = Data::Dumper::Dumper($collapsed); # NOTE: # Canonicalize numbers to strings even if it # mangles numbers inside strings. It really # does not matter since its just the checksum # anyway. # - YK/SL $str =~ s/(?add( $str ); } return $d->hexdigest; } sub _digest_object { my ( $self, %options ) = @_; my $digest_opts = $options{digest}; $digest_opts = [ $digest_opts ] if !ref($digest_opts) or ref($digest_opts) ne 'ARRAY'; my ( $d, @args ) = @$digest_opts; if ( ref $d ) { if ( $d->can("clone") ) { return $d->clone; } elsif ( $d->can("reset") ) { $d->reset; return $d; } else { die "Can't clone or reset digest object: $d"; } } else { return Digest->new($d || "SHA-1", @args); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Base::WithChecksum - A more secure serialization role =head1 VERSION version 0.53 =head1 DESCRIPTION This is an early implementation of a more secure Storage role, which does integrity checks on the data. It is still being developed so I recommend using it with caution. Any thoughts, ideas or suggestions on improving our technique are very welcome. =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Engine/IO/000770 000766 000024 00000000000 13646474070 021640 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Engine/Trait/000770 000766 000024 00000000000 13646474070 022414 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm000640 000766 000024 00000005300 13646474070 025512 0ustar00etherstaff000000 000000 package MooseX::Storage::Engine::Trait::OnlyWhenBuilt; # ABSTRACT: An engine trait to bypass serialization our $VERSION = '0.53'; use Moose::Role; use namespace::autoclean; # we should # only serialize the attribute if it's already built. So, go ahead # and check if the attribute has a predicate. If so, check if it's # set and then go ahead and look it up. around 'collapse_attribute' => sub { my ($orig, $self, $attr, @args) = @_; my $pred = $attr->predicate if $attr->has_predicate; if ($pred) { return () unless $self->object->$pred(); } return $self->$orig($attr, @args); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Engine::Trait::OnlyWhenBuilt - An engine trait to bypass serialization =head1 VERSION version 0.53 =head1 SYNOPSIS { package Point; use Moose; use MooseX::Storage; with Storage( traits => [qw|OnlyWhenBuilt|] ); has 'x' => (is => 'rw', lazy_build => 1 ); has 'y' => (is => 'rw', predicate => '_has_y' ); has 'z' => (is => 'rw', builder => '_build_z' ); sub _build_x { 3 } sub _build_y { expensive_computation() } sub _build_z { 3 } } my $p = Point->new( 'x' => 4 ); # the result of ->pack will contain: # { x => 4, z => 3 } $p->pack; =head1 DESCRIPTION Sometimes you don't want a particular attribute to be part of the serialization if it has not been built yet. If you invoke C as outlined in the C, only attributes that have been built (i.e., where the predicate returns 'true') will be serialized. This avoids any potentially expensive computations. This trait is applied to an instance of L, for the user-visible version shown in the SYNOPSIS, see L =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm000640 000766 000024 00000004315 13646474070 027136 0ustar00etherstaff000000 000000 package MooseX::Storage::Engine::Trait::DisableCycleDetection; # ABSTRACT: A custom trait to bypass cycle detection our $VERSION = '0.53'; use Moose::Role; use namespace::autoclean; around 'check_for_cycle_in_collapse' => sub { my ($orig, $self, $attr, $value) = @_; # See NOTE in MX::Storage::Engine return $value; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Engine::Trait::DisableCycleDetection - A custom trait to bypass cycle detection =head1 VERSION version 0.53 =head1 SYNOPSIS package Double; use Moose; use MooseX::Storage; with Storage( traits => ['DisableCycleDetection'] ); has 'x' => ( is => 'rw', isa => 'HashRef' ); has 'y' => ( is => 'rw', isa => 'HashRef' ); my $ref = {}; my $double = Double->new( 'x' => $ref, 'y' => $ref ); $double->pack; =head1 DESCRIPTION C implements a primitive check for circular references. This check also triggers on simple cases as shown in the Synopsis. Providing the C traits disables checks for any cyclical references, so if you know what you are doing, you can bypass this check. This trait is applied to an instance of L, for the user-visible version shown in the SYNOPSIS, see L =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Engine/IO/AtomicFile.pm000640 000766 000024 00000003575 13646474070 024223 0ustar00etherstaff000000 000000 package MooseX::Storage::Engine::IO::AtomicFile; # ABSTRACT: The actual atomic file storage mechanism. our $VERSION = '0.53'; use Moose; use IO::AtomicFile; use Carp 'confess'; use namespace::autoclean; extends 'MooseX::Storage::Engine::IO::File'; sub store { my ($self, $data) = @_; my $fh = IO::AtomicFile->new($self->file, 'w') || confess "Unable to open file (" . $self->file . ") for storing : $!"; # TODO ugh! this is surely wrong and should be fixed. $fh->binmode(':utf8') if utf8::is_utf8($data); print $fh $data; $fh->close() || confess "Could not write atomic file (" . $self->file . ") because: $!"; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Engine::IO::AtomicFile - The actual atomic file storage mechanism. =head1 VERSION version 0.53 =head1 DESCRIPTION This provides the actual means to store data to a file atomically. =head1 METHODS =over 4 =item B =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Engine/IO/File.pm000640 000766 000024 00000003722 13646474070 023060 0ustar00etherstaff000000 000000 package MooseX::Storage::Engine::IO::File; # ABSTRACT: The actual file storage mechanism. our $VERSION = '0.53'; use Moose; use IO::File; use Carp 'confess'; use namespace::autoclean; has 'file' => ( is => 'ro', isa => 'Str', required => 1, ); sub load { my ($self) = @_; my $fh = IO::File->new($self->file, 'r') || confess "Unable to open file (" . $self->file . ") for loading : $!"; return do { local $/; <$fh>; }; } sub store { my ($self, $data) = @_; my $fh = IO::File->new($self->file, 'w') || confess "Unable to open file (" . $self->file . ") for storing : $!"; # TODO ugh! this is surely wrong and should be fixed. $fh->binmode(':utf8') if utf8::is_utf8($data); print $fh $data; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Engine::IO::File - The actual file storage mechanism. =head1 VERSION version 0.53 =head1 DESCRIPTION This provides the actual means to store data to a file. =head1 METHODS =over 4 =item B =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Format/YAML.pm000640 000766 000024 00000004163 13646474070 022457 0ustar00etherstaff000000 000000 package MooseX::Storage::Format::YAML; # ABSTRACT: A YAML serialization role our $VERSION = '0.53'; use Moose::Role; # When I add YAML::LibYAML # Tests break because tye YAML is invalid...? # -dcp use YAML::Any qw(Load Dump); use namespace::autoclean; requires 'pack'; requires 'unpack'; sub thaw { my ( $class, $yaml, @args ) = @_; $class->unpack( Load($yaml), @args ); } sub freeze { my ( $self, @args ) = @_; Dump( $self->pack(@args) ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Format::YAML - A YAML serialization role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'YAML'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to freeze/thaw into ## a specified serialization format ## (in this case YAML) # pack the class into a YAML string $p->freeze(); # ---- # __CLASS__: "Point" # x: 10 # y: 10 # unpack the JSON string into a class my $p2 = Point->thaw(< =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Format/Storable.pm000640 000766 000024 00000005125 13646474070 023467 0ustar00etherstaff000000 000000 package MooseX::Storage::Format::Storable; # ABSTRACT: A Storable serialization role our $VERSION = '0.53'; use Moose::Role; use Storable (); use namespace::autoclean; requires 'pack'; requires 'unpack'; sub thaw { my ( $class, $stored, @args ) = @_; $class->unpack( Storable::thaw($stored), @args ); } sub freeze { my ( $self, @args ) = @_; Storable::nfreeze( $self->pack(@args) ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Format::Storable - A Storable serialization role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'Storable'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to freeze/thaw into ## a specified serialization format # pack the class with Storable my $storable_data = $p->freeze(); # unpack the storable data into the class my $p2 = Point->thaw($storable_data); =head1 DESCRIPTION =for stopwords IPC This module will C and C Moose classes using Storable. It uses C by default so that it can be easily used in IPC scenarios across machines or just locally. =for stopwords Storable's One important thing to note is that this module does not mix well with the IO modules. The structures that C and C deal with are Storable's memory representation, and (as far as I know) that is not easily just written onto a file. If you want file based serialization with Storable, the please look at the L role instead. =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Format/JSON.pm000640 000766 000024 00000004643 13646474070 022471 0ustar00etherstaff000000 000000 package MooseX::Storage::Format::JSON; # ABSTRACT: A JSON serialization role our $VERSION = '0.53'; use Moose::Role; use JSON::MaybeXS 1.001000; use namespace::autoclean; requires 'pack'; requires 'unpack'; sub thaw { my ( $class, $json, @args ) = @_; # TODO ugh! this is surely wrong and should be fixed. utf8::encode($json) if utf8::is_utf8($json); $class->unpack( JSON::MaybeXS->new({ utf8 => 1 })->decode( $json), @args ); } sub freeze { my ( $self, @args ) = @_; my $json = JSON::MaybeXS->new({ utf8 => 1, canonical => 1 })->encode($self->pack(@args)); # if it's valid utf8 mark it as such # TODO ugh! this is surely wrong and should be fixed. utf8::decode($json) if !utf8::is_utf8($json) and utf8::valid($json); return $json; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Format::JSON - A JSON serialization role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to freeze/thaw into ## a specified serialization format ## (in this case JSON) # pack the class into a JSON string $p->freeze(); # { "__CLASS__" : "Point", "x" : 10, "y" : 10 } # unpack the JSON string into a class my $p2 = Point->thaw('{ "__CLASS__" : "Point", "x" : 10, "y" : 10 }'); =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Meta/Attribute/000770 000766 000024 00000000000 13646474070 022755 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm000640 000766 000024 00000004200 13646474070 026201 0ustar00etherstaff000000 000000 package MooseX::Storage::Meta::Attribute::DoNotSerialize; # ABSTRACT: A custom meta-attribute to bypass serialization our $VERSION = '0.53'; use Moose; use namespace::autoclean; extends 'Moose::Meta::Attribute'; with 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize'; # register this alias ... package # hide from PAUSE Moose::Meta::Attribute::Custom::DoNotSerialize; sub register_implementation { 'MooseX::Storage::Meta::Attribute::DoNotSerialize' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Meta::Attribute::DoNotSerialize - A custom meta-attribute to bypass serialization =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON', 'io' => 'File'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); has 'foo' => ( metaclass => 'DoNotSerialize', is => 'rw', isa => 'CodeRef', ); 1; =head1 DESCRIPTION =for stopwords culted Sometimes you don't want a particular attribute to be part of the serialization, in this case, you want to make sure that attribute uses this custom meta-attribute. See the SYNOPSIS for a nice example that can be easily cargo-culted. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Meta/Attribute/Trait/000770 000766 000024 00000000000 13646474070 024040 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm000640 000766 000024 00000004112 13646474070 027266 0ustar00etherstaff000000 000000 package MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize; # ABSTRACT: A custom meta-attribute-trait to bypass serialization our $VERSION = '0.53'; use Moose::Role; use namespace::autoclean; # register this alias ... package # hide from PAUSE Moose::Meta::Attribute::Custom::Trait::DoNotSerialize; sub register_implementation { 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize - A custom meta-attribute-trait to bypass serialization =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON', 'io' => 'File'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); has 'foo' => ( traits => [ 'DoNotSerialize' ], is => 'rw', isa => 'CodeRef', ); 1; =head1 DESCRIPTION =for stopwords culted Sometimes you don't want a particular attribute to be part of the serialization, in this case, you want to make sure that attribute uses this custom meta-attribute-trait. See the SYNOPSIS for a nice example that can be easily cargo-culted. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/IO/AtomicFile.pm000640 000766 000024 00000003602 13646474070 023005 0ustar00etherstaff000000 000000 package MooseX::Storage::IO::AtomicFile; # ABSTRACT: An Atomic File I/O role our $VERSION = '0.53'; use Moose::Role; use MooseX::Storage::Engine::IO::AtomicFile; use namespace::autoclean; with 'MooseX::Storage::IO::File'; sub store { my ( $self, $filename, @args ) = @_; MooseX::Storage::Engine::IO::AtomicFile->new( file => $filename )->store( $self->freeze(@args) ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::IO::AtomicFile - An Atomic File I/O role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON', 'io' => 'AtomicFile'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to load/store a class ## on the file system $p->store('my_point.json'); my $p2 = Point->load('my_point.json'); =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/IO/File.pm000640 000766 000024 00000003772 13646474070 021660 0ustar00etherstaff000000 000000 package MooseX::Storage::IO::File; # ABSTRACT: A basic File I/O role our $VERSION = '0.53'; use Moose::Role; use MooseX::Storage::Engine::IO::File; use namespace::autoclean; requires 'thaw'; requires 'freeze'; sub load { my ( $class, $filename, @args ) = @_; $class->thaw( MooseX::Storage::Engine::IO::File->new( file => $filename )->load(), @args ); } sub store { my ( $self, $filename, @args ) = @_; MooseX::Storage::Engine::IO::File->new( file => $filename )->store( $self->freeze(@args) ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::IO::File - A basic File I/O role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('format' => 'JSON', 'io' => 'File'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to load/store a class ## on the file system $p->store('my_point.json'); my $p2 = Point->load('my_point.json'); =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/IO/StorableFile.pm000640 000766 000024 00000005542 13646474070 023351 0ustar00etherstaff000000 000000 package MooseX::Storage::IO::StorableFile; # ABSTRACT: An Storable File I/O role our $VERSION = '0.53'; use Moose::Role; use Storable (); use namespace::autoclean; requires 'pack'; requires 'unpack'; sub load { my ( $class, $filename, @args ) = @_; # try thawing return $class->thaw( Storable::retrieve($filename), @args ) if $class->can('thaw'); # otherwise just unpack $class->unpack( Storable::retrieve($filename), @args ); } sub store { my ( $self, $filename, @args ) = @_; Storable::nstore( # try freezing, otherwise just pack ($self->can('freeze') ? $self->freeze(@args) : $self->pack(@args)), $filename ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::IO::StorableFile - An Storable File I/O role =head1 VERSION version 0.53 =head1 SYNOPSIS package Point; use Moose; use MooseX::Storage; with Storage('io' => 'StorableFile'); has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); 1; my $p = Point->new(x => 10, y => 10); ## methods to load/store a class ## on the file system $p->store('my_point'); my $p2 = Point->load('my_point'); =head1 DESCRIPTION This module will C and C Moose classes using Storable. It uses C by default so that it can be easily used across machines or just locally. One important thing to note is that this module does not mix well with the other Format modules. Since Storable serialized perl data structures in it's own format, those roles are largely unnecessary. However, there is always the possibility that having a set of C hooks can be useful, so because of that this module will attempt to use C or C if that method is available. Of course, you should be careful when doing this as it could lead to all sorts of hairy issues. But you have been warned. =head1 METHODS =over 4 =item B =item B =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm000640 000766 000024 00000005074 13646474070 024500 0ustar00etherstaff000000 000000 package MooseX::Storage::Traits::OnlyWhenBuilt; # ABSTRACT: A custom trait to bypass serialization our $VERSION = '0.53'; use Moose::Role; use namespace::autoclean; requires 'pack'; requires 'unpack'; around 'pack' => sub { my ($orig, $self, %args) = @_; $args{engine_traits} ||= []; push(@{$args{engine_traits}}, 'OnlyWhenBuilt'); $self->$orig(%args); }; around 'unpack' => sub { my ($orig, $self, $data, %args) = @_; $args{engine_traits} ||= []; push(@{$args{engine_traits}}, 'OnlyWhenBuilt'); $self->$orig($data, %args); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Traits::OnlyWhenBuilt - A custom trait to bypass serialization =head1 VERSION version 0.53 =head1 SYNOPSIS { package Point; use Moose; use MooseX::Storage; with Storage( traits => [qw|OnlyWhenBuilt|] ); has 'x' => (is => 'rw', lazy_build => 1 ); has 'y' => (is => 'rw', predicate => '_has_y' ); has 'z' => (is => 'rw', builder => '_build_z' ); sub _build_x { 3 } sub _build_y { expensive_computation() } sub _build_z { 3 } } my $p = Point->new( 'x' => 4 ); # the result of ->pack will contain: # { x => 4, z => 3 } $p->pack; =head1 DESCRIPTION Sometimes you don't want a particular attribute to be part of the serialization if it has not been built yet. If you invoke C as outlined in the C, only attributes that have been built (i.e., where the predicate returns 'true') will be serialized. This avoids any potentially expensive computations. =for stopwords culted See the SYNOPSIS for a nice example that can be easily cargo-culted. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/lib/MooseX/Storage/Traits/DisableCycleDetection.pm000640 000766 000024 00000005012 13646474070 026107 0ustar00etherstaff000000 000000 package MooseX::Storage::Traits::DisableCycleDetection; # ABSTRACT: A custom trait to bypass cycle detection our $VERSION = '0.53'; use Moose::Role; use namespace::autoclean; requires 'pack'; requires 'unpack'; around 'pack' => sub { my ($orig, $self, %args) = @_; $args{engine_traits} ||= []; push(@{$args{engine_traits}}, 'DisableCycleDetection'); $self->$orig(%args); }; around 'unpack' => sub { my ($orig, $self, $data, %args) = @_; $args{engine_traits} ||= []; push(@{$args{engine_traits}}, 'DisableCycleDetection'); $self->$orig($data, %args); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Storage::Traits::DisableCycleDetection - A custom trait to bypass cycle detection =head1 VERSION version 0.53 =head1 SYNOPSIS package Double; use Moose; use MooseX::Storage; with Storage( traits => ['DisableCycleDetection'] ); has 'x' => ( is => 'rw', isa => 'HashRef' ); has 'y' => ( is => 'rw', isa => 'HashRef' ); my $ref = {}; my $double = Double->new( 'x' => $ref, 'y' => $ref ); $double->pack; =head1 DESCRIPTION C implements a primitive check for circular references. This check also triggers on simple cases as shown in the Synopsis. Providing the C traits disables checks for any cyclical references, so if you know what you are doing, you can bypass this check. This trait is applied to all objects that inherit from it. To use this on a per-case basis, see C in L. =for stopwords culted See the SYNOPSIS for a nice example that can be easily cargo-culted. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHORS =over 4 =item * Chris Prather =item * Stevan Little =item * יובל קוג'מן (Yuval Kogman) =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MooseX-Storage-0.53/xt/author/000770 000766 000024 00000000000 13646474070 016475 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/xt/release/000770 000766 000024 00000000000 13646474070 016613 5ustar00etherstaff000000 000000 MooseX-Storage-0.53/xt/release/changes_has_content.t000644 000766 000024 00000002100 13646474070 022771 0ustar00etherstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.53'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; 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; 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>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } 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; } MooseX-Storage-0.53/xt/release/distmeta.t000644 000766 000024 00000000172 13646474070 020615 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); MooseX-Storage-0.53/xt/release/cpan-changes.t000644 000766 000024 00000000344 13646474070 021333 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'); }; MooseX-Storage-0.53/xt/author/mojibake.t000644 000766 000024 00000000151 13646474070 020443 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); MooseX-Storage-0.53/xt/author/kwalitee.t000644 000766 000024 00000000275 13646474070 020476 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; MooseX-Storage-0.53/xt/author/no-tabs.t000644 000766 000024 00000005167 13646474070 020241 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/MooseX/Storage.pm', 'lib/MooseX/Storage/Base/WithChecksum.pm', 'lib/MooseX/Storage/Basic.pm', 'lib/MooseX/Storage/Deferred.pm', 'lib/MooseX/Storage/Engine.pm', 'lib/MooseX/Storage/Engine/IO/AtomicFile.pm', 'lib/MooseX/Storage/Engine/IO/File.pm', 'lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm', 'lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm', 'lib/MooseX/Storage/Format/JSON.pm', 'lib/MooseX/Storage/Format/Storable.pm', 'lib/MooseX/Storage/Format/YAML.pm', 'lib/MooseX/Storage/IO/AtomicFile.pm', 'lib/MooseX/Storage/IO/File.pm', 'lib/MooseX/Storage/IO/StorableFile.pm', 'lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm', 'lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm', 'lib/MooseX/Storage/Traits/DisableCycleDetection.pm', 'lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm', 'lib/MooseX/Storage/Util.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/000_load.t', 't/001_basic.t', 't/002_basic_io.t', 't/002_basic_w_subtypes.t', 't/003_basic_w_embedded_objects.t', 't/004_w_cycles.t', 't/005_w_versions_and_authority_check.t', 't/006_w_custom_type_handlers.t', 't/007_false.t', 't/008_do_not_serialize.t', 't/009_do_not_serialize_lazy.t', 't/010_basic_json.t', 't/011_basic_json_w_utf8.t', 't/012_param_json.t', 't/020_basic_yaml.t', 't/020_basic_yaml_syck.t', 't/020_basic_yaml_xs.t', 't/030_with_checksum.t', 't/040_basic_utils.t', 't/050_basic_storable.t', 't/060_basic_deferred.t', 't/061_basic_deferred_w_io.t', 't/070_basic_maybe.t', 't/080_basic_json_boolean.t', 't/100_io.t', 't/101_io_atomic.t', 't/102_io_storable_file.t', 't/103_io_storable_file_custom.t', 't/104_io_w_utf8.t', 't/105_io_atomic_w_utf8.t', 't/200_combined_in_roles.t', 't/300_overloaded.t', 't/400_moosex_types.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/changes_has_content.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/minimum-version.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/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t' ); notabs_ok($_) foreach @files; done_testing; MooseX-Storage-0.53/xt/author/changes_has_content.t000644 000766 000024 00000001044 13646474070 022661 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; plan skip_all => 'xt/release/changes_has_content.t is missing' if not -e 'xt/release/changes_has_content.t'; # skip for master branch, only for travis if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') { chomp(my $branch_name = ($ENV{TRAVIS_BRANCH} || `git rev-parse --abbrev-ref HEAD`)); $TODO = 'Changes need not have content for this release yet if this is only the '.$1.' branch' if ($branch_name || '') =~ /^(master|devel)$/; } do './xt/release/changes_has_content.t'; die $@ if $@; MooseX-Storage-0.53/xt/author/minimum-version.t000644 000766 000024 00000000155 13646474070 022024 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_ok( qq{5.008003} ); MooseX-Storage-0.53/xt/author/00-compile.t000644 000766 000024 00000004224 13646474070 020534 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More 0.94; plan tests => 21; my @module_files = ( 'MooseX/Storage.pm', 'MooseX/Storage/Base/WithChecksum.pm', 'MooseX/Storage/Basic.pm', 'MooseX/Storage/Deferred.pm', 'MooseX/Storage/Engine.pm', 'MooseX/Storage/Engine/IO/AtomicFile.pm', 'MooseX/Storage/Engine/IO/File.pm', 'MooseX/Storage/Engine/Trait/DisableCycleDetection.pm', 'MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm', 'MooseX/Storage/Format/JSON.pm', 'MooseX/Storage/Format/Storable.pm', 'MooseX/Storage/Format/YAML.pm', 'MooseX/Storage/IO/AtomicFile.pm', 'MooseX/Storage/IO/File.pm', 'MooseX/Storage/IO/StorableFile.pm', 'MooseX/Storage/Meta/Attribute/DoNotSerialize.pm', 'MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm', 'MooseX/Storage/Traits/DisableCycleDetection.pm', 'MooseX/Storage/Traits/OnlyWhenBuilt.pm', 'MooseX/Storage/Util.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; MooseX-Storage-0.53/xt/author/eol.t000644 000766 000024 00000005221 13646474070 017444 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/MooseX/Storage.pm', 'lib/MooseX/Storage/Base/WithChecksum.pm', 'lib/MooseX/Storage/Basic.pm', 'lib/MooseX/Storage/Deferred.pm', 'lib/MooseX/Storage/Engine.pm', 'lib/MooseX/Storage/Engine/IO/AtomicFile.pm', 'lib/MooseX/Storage/Engine/IO/File.pm', 'lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm', 'lib/MooseX/Storage/Engine/Trait/OnlyWhenBuilt.pm', 'lib/MooseX/Storage/Format/JSON.pm', 'lib/MooseX/Storage/Format/Storable.pm', 'lib/MooseX/Storage/Format/YAML.pm', 'lib/MooseX/Storage/IO/AtomicFile.pm', 'lib/MooseX/Storage/IO/File.pm', 'lib/MooseX/Storage/IO/StorableFile.pm', 'lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm', 'lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm', 'lib/MooseX/Storage/Traits/DisableCycleDetection.pm', 'lib/MooseX/Storage/Traits/OnlyWhenBuilt.pm', 'lib/MooseX/Storage/Util.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/000_load.t', 't/001_basic.t', 't/002_basic_io.t', 't/002_basic_w_subtypes.t', 't/003_basic_w_embedded_objects.t', 't/004_w_cycles.t', 't/005_w_versions_and_authority_check.t', 't/006_w_custom_type_handlers.t', 't/007_false.t', 't/008_do_not_serialize.t', 't/009_do_not_serialize_lazy.t', 't/010_basic_json.t', 't/011_basic_json_w_utf8.t', 't/012_param_json.t', 't/020_basic_yaml.t', 't/020_basic_yaml_syck.t', 't/020_basic_yaml_xs.t', 't/030_with_checksum.t', 't/040_basic_utils.t', 't/050_basic_storable.t', 't/060_basic_deferred.t', 't/061_basic_deferred_w_io.t', 't/070_basic_maybe.t', 't/080_basic_json_boolean.t', 't/100_io.t', 't/101_io_atomic.t', 't/102_io_storable_file.t', 't/103_io_storable_file_custom.t', 't/104_io_w_utf8.t', 't/105_io_atomic_w_utf8.t', 't/200_combined_in_roles.t', 't/300_overloaded.t', 't/400_moosex_types.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/changes_has_content.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/minimum-version.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/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; MooseX-Storage-0.53/xt/author/pod-syntax.t000644 000766 000024 00000000252 13646474070 020772 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(); MooseX-Storage-0.53/xt/author/portability.t000644 000766 000024 00000000267 13646474070 021234 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(); MooseX-Storage-0.53/xt/author/pod-spell.t000644 000766 000024 00000001710 13646474070 020563 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( examples lib script t xt ) ); __DATA__ AtomicFile Attribute Base Basic Boone Boumans Brook Champoux Chris Cory Dagfinn Dan David Deferred DisableCycleDetection Dmitry DoNotSerialize Doran Engine Etheridge File Florian Format Golden Graham IO Ilmari Inc Infinity Interactive JSON Jason Johannes Jonathan Jos Karen Knop Kogman Latin Little Mannsåker Meta Moore MooseX OnlyWhenBuilt Plunien Pope Prather Ragwitz Ricardo Robert Rockway Shawn Signes Steinbrunner Stevan Storable StorableFile Storage Tomas Trait Traits Util Watson WithChecksum YAML Yanick Yu Yuval bobtfish chris cowholio4 cpan dagolden dan dim0xff dsteinbrunner ether frequency gphat haarg ian ilmari irc jon jos lib nothingmuch plu rafl rjbs robo4288 sartak sillitoe stevan yanick יובל קוג MooseX-Storage-0.53/xt/author/pod-no404s.t000644 000766 000024 00000000527 13646474070 020500 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(); } MooseX-Storage-0.53/xt/author/clean-namespaces.t000644 000766 000024 00000000361 13646474070 022064 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; MooseX-Storage-0.53/xt/author/pod-coverage.t000644 000766 000024 00000000334 13646474070 021240 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' }); MooseX-Storage-0.53/t/020_basic_yaml.t000640 000766 000024 00000003074 13646474070 017657 0ustar00etherstaff000000 000000 $|++; use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs qw( YAML::Any YAML Test::Without::Module ); diag 'using YAML backend: ', YAML::Any->implementation; BEGIN { Test::Without::Module->import(YAML::Any->order); Test::Without::Module->unimport('YAML'); plan tests => 9; } { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'YAML' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $yaml = $foo->freeze; my $bar = Foo->thaw( $yaml ); isa_ok( $bar, 'Foo' ); is( $bar->number, 10, '... got the right number' ); is( $bar->string, 'foo', '... got the right string' ); is( $bar->float, 10.5, '... got the right float' ); cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $bar->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $bar->object, 'Foo' ); is( $bar->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/010_basic_json.t000640 000766 000024 00000004135 13646474070 017664 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs qw( JSON::MaybeXS Test::Deep::JSON ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 10; { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'JSON' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $json = $foo->freeze; cmp_deeply( $json, Test::Deep::JSON::json({ number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, __CLASS__ => 'Foo', object => { number => 2, __CLASS__ => 'Foo' }, }), 'is valid JSON and content matches', ); } { my $foo = Foo->thaw( '{"array":[1,2,3,4,5,6,7,8,9,10],"hash":{"6":null,"3":null,"7":null,"9":null,"2":null,"8":null,"1":null,"4":null,"10":null,"5":null},"float":10.5,"object":{"number":2,"__CLASS__":"Foo"},"number":10,"__CLASS__":"Foo","string":"foo"}' ); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/007_false.t000644 000766 000024 00000002166 13646474070 016660 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 7; use Test::Deep; { package Foo; use Moose; use MooseX::Storage; with Storage; has 'number' => ( is => 'ro', isa => 'Int', default => 42 ); has 'string' => ( is => 'ro', isa => 'Str', default => "true" ); has 'boolean' => ( is => 'ro', isa => 'Bool', default => 1 ); } { my $foo = Foo->new( number => 0, string => '', boolean => 0, ); isa_ok( $foo, 'Foo' ); is($foo->boolean, 0, '... got the right boolean value'); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', number => 0, string => '', boolean => 0, }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo', number => 0, string => '', boolean => 0, } ); isa_ok( $foo, 'Foo' ); is( $foo->number, 0, '... got the right number' ); is( $foo->string, '', '... got the right string' ); ok( !$foo->boolean, '... got the right boolean' ); } MooseX-Storage-0.53/t/300_overloaded.t000640 000766 000024 00000001034 13646474070 017673 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal; use Test::Needs 'JSON::MaybeXS'; diag 'using JSON backend: ', JSON::MaybeXS->JSON; { package Thing; use Moose; use MooseX::Storage; use overload q{""} => 'as_string', fallback => 1; with Storage('format' => 'JSON'); has foo => ( is => 'ro' ); sub as_string { shift->freeze } no Moose; } my $i = Thing->new(foo => "bar"); is( exception { $i . ""; }, undef, 'Can stringify without deep recursion'); done_testing; MooseX-Storage-0.53/t/020_basic_yaml_xs.t000640 000766 000024 00000003104 13646474070 020363 0ustar00etherstaff000000 000000 $|++; use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs qw( YAML::Any YAML::XS Test::Without::Module ); diag 'using YAML backend: ', YAML::Any->implementation; BEGIN { Test::Without::Module->import(YAML::Any->order); Test::Without::Module->unimport('YAML::XS'); plan tests => 9; } { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'YAML' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $yaml = $foo->freeze; my $bar = Foo->thaw( $yaml ); isa_ok( $bar, 'Foo' ); is( $bar->number, 10, '... got the right number' ); is( $bar->string, 'foo', '... got the right string' ); is( $bar->float, 10.5, '... got the right float' ); cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $bar->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $bar->object, 'Foo' ); is( $bar->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/002_basic_io.t000640 000766 000024 00000002743 13646474070 017326 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir; use Test::Needs 'JSON::MaybeXS'; diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 9; { package Foo; use Moose; use MooseX::Storage; with Storage( format => 'JSON', io => 'File', ); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'ro', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); } my $file = catfile($dir, 'temp.json'); { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/103_io_storable_file_custom.t000644 000766 000024 00000005427 13646474070 022461 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 14; use Test::Deep; use Storable (); use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir( CLEANUP => 1 ); { package Foo; use Moose; use MooseX::Storage; with Storage(io => 'StorableFile'); has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'rw', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); ## add some custom freeze/thaw hooks here ... sub thaw { my ( $class, $data ) = @_; my $self = $class->unpack( $data ); $self->string("Hello World"); $self; } sub freeze { my ( $self, @args ) = @_; my $data = $self->pack(@args); $data->{string} = "HELLO WORLD"; $data; } } my $file = catfile($dir,'temp.storable'); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file); # check our custom freeze hook fired ... my $data = Storable::retrieve($file); cmp_deeply( $data, { '__CLASS__' => 'Foo', 'undef' => undef, 'float' => 10.5, 'number' => 10, 'string' => 'HELLO WORLD', 'array' => [ 1 .. 10], 'hash' => { map { $_ => undef } 1 .. 10 }, 'object' => { '__CLASS__' => 'Foo', 'number' => 2 }, }, '... got the data struct we expected' ); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); ## check our custom thaw hook fired is($foo->string, 'Hello World', '... got the right string'); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is($foo->number, 10, '... got the right number'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/001_basic.t000644 000766 000024 00000005451 13646474070 016641 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 13; use Test::Deep; { package Foo; use Moose; use MooseX::Storage; with Storage; has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'boolean' => ( is => 'ro', isa => 'Bool' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Foo' ); has 'union' => ( is => 'ro', isa => 'ArrayRef|Str' ); has 'union2' => ( is => 'ro', isa => 'ArrayRef|Str' ); } { my $foo = Foo->new( number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), union => [ 1, 2, 3 ], union2 => 'A String' ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, union => [ 1, 2, 3 ], union2 => 'A String' }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo', number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, union => [ 1, 2, 3 ], union2 => 'A String' } ); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); ok( $foo->boolean, '... got the right boolean' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); cmp_deeply( $foo->union, [ 1 .. 3 ], '... got the right array (in the union)' ); is( $foo->union2, 'A String', '... got the right string (in the union)' ); } MooseX-Storage-0.53/t/012_param_json.t000640 000766 000024 00000002517 13646474070 017707 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs qw(MooseX::Storage::Format::JSONpm JSON::MaybeXS); JSON::MaybeXS->import; plan tests => 5; { package Foo; use Moose; use MooseX::Storage; with Storage(format => [ JSONpm => { json_opts => { pretty => 1 } } ] ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); } { my $foo = Foo->new( string => 'foo', float => 10.5, ); isa_ok( $foo, 'Foo' ); my $json = $foo->freeze; isnt( index($json, "\n"), -1, "there are newlines in our JSON, because it is pretty", ) or diag $json; } { package Bar; use Moose; use MooseX::Storage; our $VERSION = '0.01'; with 'MooseX::Storage::Deferred'; has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); } for my $jsonpm ( [ string => 'JSONpm' ], [ aref0p => [ JSONpm => ] ], [ aref1p => [ JSONpm => { json_opts => { pretty => 1 } } ] ], ) { my ($name, $p) = @$jsonpm; my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) }; cmp_deeply( decode_json($json), { '__CLASS__' => 'Bar-0.01', x => 10, y => 20, }, "correct deferred freeze from $name", ); } MooseX-Storage-0.53/t/080_basic_json_boolean.t000640 000766 000024 00000004233 13646474070 021371 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Deep; use Test::Deep::Type; use Test::Fatal; use Moose::Util::TypeConstraints; use JSON::PP; use MooseX::Storage::Engine; MooseX::Storage::Engine->add_custom_type_handler( 'JSON::PP::Boolean' => ( expand => sub { $_[0] ? JSON::PP::true : JSON::PP::false }, collapse => sub { "$_[0]" }, ) ); # support for this was tentatively added in v0.49, but there were unwanted # side effects, and the tests in this file do not pass even with those changes. local $TODO = 'ability to pack/unpack nested objects is not quite functional'; { package Foo; use Moose; use MooseX::Storage; with Storage; has 'one_bool' => ( is => 'ro', isa => 'JSON::PP::Boolean', ); has 'many_bools' => ( is => 'ro', isa => 'ArrayRef[JSON::PP::Boolean]' ); } { my $foo = Foo->new( one_bool => JSON::PP::true, many_bools => [ JSON::PP::false, JSON::PP::true ], ); isa_ok($foo, 'Foo'); my $pack_result; is( exception { $pack_result = $foo->pack }, undef, 'packing completed successfully', ); cmp_deeply( $pack_result, { __CLASS__ => 'Foo', one_bool => 1, many_bools => [ 0, 1 ], }, '... got the right frozen structure' ); } { my $foo; is( exception { $foo = Foo->unpack( { __CLASS__ => 'Foo', one_bool => 1, many_bools => [ 0, 1 ], }, ) }, undef, 'unpacking completed successfully', ); isa_ok($foo, 'Foo') && do { cmp_deeply( $foo->one_bool, all(is_type(class_type('JSON::PP::Boolean')), JSON::PP::true), 'one_bool attr is correct', ); cmp_deeply( $foo->many_bools, [ all(type('JSON::PP::Boolean'), JSON::PP::false), all(type('JSON::PP::Boolean'), JSON::PP::true), ], 'many_bools attr is correct', ); }; } done_testing; MooseX-Storage-0.53/t/008_do_not_serialize.t000644 000766 000024 00000004040 13646474070 021111 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 12; use Test::Deep; { package Foo; use Moose; use MooseX::Storage; with Storage; has 'bar' => ( metaclass => 'DoNotSerialize', is => 'rw', default => sub { 'BAR' } ); has 'baz' => ( traits => [ 'DoNotSerialize' ], is => 'rw', default => sub { 'BAZ' } ); has 'gorch' => ( is => 'rw', default => sub { 'GORCH' } ); 1; } { my $foo = Foo->new; isa_ok($foo, 'Foo'); is($foo->bar, 'BAR', '... got the value we expected'); is($foo->baz, 'BAZ', '... got the value we expected'); is($foo->gorch, 'GORCH', '... got the value we expected'); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', gorch => 'GORCH' }, '... got the right packed class data' ); } ### more involved test; required attribute that's not serialized { package Bar; use Moose; use MooseX::Storage; with Storage; has foo => ( metaclass => 'DoNotSerialize', required => 1, is => 'rw', isa => 'Object', # type constraint is important ); has zot => ( default => sub { $$ }, is => 'rw', ); } { my $obj = bless {}; my $bar = Bar->new( foo => $obj ); ok( $bar, "New object created" ); is( $bar->foo, $obj, " ->foo => $obj" ); is( $bar->zot, $$, " ->zot => $$" ); my $bpack = $bar->pack; cmp_deeply( $bpack, { __CLASS__ => 'Bar', zot => $$, }, " Packed correctly" ); eval { Bar->unpack( $bpack ) }; ok( $@, " Unpack without required attribute fails" ); like( $@, qr/foo/, " Proper error recorded" ); my $bar2 = Bar->unpack( $bpack, inject => { foo => bless {} } ); ok( $bar2, " Unpacked correctly with foo => Object"); } MooseX-Storage-0.53/t/005_w_versions_and_authority_check.t000644 000766 000024 00000004060 13646474070 024044 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 7; use Test::Deep; use Test::Fatal; =pod This tests that the version and authority checks are performed upon object expansion. =cut { package Bar; use Moose; use MooseX::Storage; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JRANDOM'; with Storage; has 'number' => (is => 'ro', isa => 'Int'); package Foo; use Moose; use MooseX::Storage; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JRANDOM'; with Storage; has 'bar' => ( is => 'ro', isa => 'Bar' ); } { my $foo = Foo->new( bar => Bar->new(number => 1) ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, } }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, } }, ); isa_ok( $foo, 'Foo' ); isa_ok( $foo->bar, 'Bar' ); is( $foo->bar->number, 1 , '... got the right number too' ); } Moose::Meta::Class->create('Bar', version => '0.02', authority => 'cpan:JRANDOM', ); ok(exception { Foo->unpack( { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, } } ); }, '... could not unpack, versions are different ' . $@); Moose::Meta::Class->create('Bar', version => '0.01', authority => 'cpan:DSTATIC', ); ok(exception { Foo->unpack( { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, } } ); }, '... could not unpack, authorities are different'); MooseX-Storage-0.53/t/004_w_cycles.t000644 000766 000024 00000010104 13646474070 017362 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 17; use Test::Deep; use Test::Fatal; # This test demonstrates two things: # # - cycles will not work in the default engine # - you can use a special metaclass to tell MooseX::Storage to skip an attribute { package Circular; use Moose; use MooseX::Storage; with Storage; has 'cycle' => (is => 'rw', isa => 'Circular'); } { my $circular = Circular->new; isa_ok($circular, 'Circular'); $circular->cycle($circular); like(exception { $circular->pack; }, qr/^Basic Engine does not support cycles/, '... cannot collapse a cycle with the basic engine'); } { my $packed_circular = { __CLASS__ => 'Circular' }; $packed_circular->{cycle} = $packed_circular; like( exception { Circular->unpack($packed_circular); }, qr/^Basic Engine does not support cycles/, '... cannot expand a cycle with the basic engine'); } { package Tree; use Moose; use MooseX::Storage; with Storage; has 'node' => (is => 'rw'); has 'children' => ( is => 'ro', isa => 'ArrayRef', default => sub {[]} ); has 'parent' => ( metaclass => 'DoNotSerialize', is => 'rw', isa => 'Tree', ); sub add_child { my ($self, $child) = @_; $child->parent($self); push @{$self->children} => $child; } } { my $t = Tree->new(node => 100); isa_ok($t, 'Tree'); cmp_deeply( $t->pack, { __CLASS__ => 'Tree', node => 100, children => [], }, '... got the right packed version'); my $t2 = Tree->new(node => 200); isa_ok($t2, 'Tree'); $t->add_child($t2); cmp_deeply($t->children, [ $t2 ], '... got the right children in $t'); is($t2->parent, $t, '... created the cycle correctly'); isa_ok($t2->parent, 'Tree'); cmp_deeply( $t->pack, { __CLASS__ => 'Tree', node => 100, children => [ { __CLASS__ => 'Tree', node => 200, children => [], } ], }, '... got the right packed version (with parent attribute skipped in child)'); cmp_deeply( $t2->pack, { __CLASS__ => 'Tree', node => 200, children => [], }, '... got the right packed version (with parent attribute skipped)'); } ### this fails with cycle detection on { package Double; use Moose; use MooseX::Storage; with Storage; has 'x' => ( is => 'rw', isa => 'HashRef' ); has 'y' => ( is => 'rw', isa => 'HashRef' ); } { my $ref = {}; my $double = Double->new( 'x' => $ref, 'y' => $ref ); ### currently, the cycle checker's too naive to figure out this is not ### a problem, pass an empty hashref to the 2nd test to make sure it ### doesn't warn/die TODO: { local $TODO = "Cycle check is too naive"; my $pack = eval { $double->pack; }; ok( $pack, "Object with 2 references packed" ); ok( Double->unpack( $pack || {} ), " And unpacked again" ); } my $pack = $double->pack( engine_traits => [qw/DisableCycleDetection/] ); ok( $pack, " Object packs when cycle check is disabled"); ok( Double->unpack( $pack ), " And unpacked again" ); } ### the same as above, but now done with a trait ### this fails with cycle detection on { package DoubleNoCycle; use Moose; use MooseX::Storage; with Storage( traits => ['DisableCycleDetection'] ); has 'x' => ( is => 'rw', isa => 'HashRef' ); has 'y' => ( is => 'rw', isa => 'HashRef' ); } { my $ref = {}; my $double = DoubleNoCycle->new( 'x' => $ref, 'y' => $ref ); my $pack = $double->pack; ok( $pack, "Object packs with DisableCycleDetection trait"); ok( DoubleNoCycle->unpack( $pack ), " Unpacked again" ); } MooseX-Storage-0.53/t/020_basic_yaml_syck.t000640 000766 000024 00000003110 13646474070 020677 0ustar00etherstaff000000 000000 $|++; use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs qw( YAML::Any YAML::Syck Test::Without::Module ); diag 'using YAML backend: ', YAML::Any->implementation; BEGIN { Test::Without::Module->import(YAML::Any->order); Test::Without::Module->unimport('YAML::Syck'); plan tests => 9; } { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'YAML' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $yaml = $foo->freeze; my $bar = Foo->thaw( $yaml ); isa_ok( $bar, 'Foo' ); is( $bar->number, 10, '... got the right number' ); is( $bar->string, 'foo', '... got the right string' ); is( $bar->float, 10.5, '... got the right float' ); cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $bar->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $bar->object, 'Foo' ); is( $bar->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/104_io_w_utf8.t000640 000766 000024 00000002430 13646474070 017455 0ustar00etherstaff000000 000000 use strict; use warnings; use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8 use Test::More; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir( CLEANUP => 1 ); use Test::Needs qw( JSON::MaybeXS IO::AtomicFile ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 7; use utf8; { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'JSON', 'io' => 'File' ); has 'utf8_string' => ( is => 'rw', isa => 'Str', default => sub { "ネットスーパー (Internet Shopping)" } ); } my $file = catfile($dir,'temp.json'); { my $foo = Foo->new; isa_ok( $foo, 'Foo' ); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is($foo->utf8_string, "ネットスーパー (Internet Shopping)", '... got the string we expected'); } no utf8; unlink $file; { my $foo = Foo->new( utf8_string => 'Escritório' ); isa_ok( $foo, 'Foo' ); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8'); is($foo->utf8_string, "Escritório", '... got the string we expected'); } MooseX-Storage-0.53/t/000_load.t000644 000766 000024 00000000140 13646474070 016464 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('MooseX::Storage'); } MooseX-Storage-0.53/t/101_io_atomic.t000640 000766 000024 00000003651 13646474070 017520 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir( CLEANUP => 1 ); use Test::Needs qw( JSON::MaybeXS IO::AtomicFile ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 13; { package Foo; use Moose; use MooseX::Storage; with Storage(format => 'JSON', io => 'AtomicFile'); has 'unset' => (is => 'ro', isa => 'Any'); has 'undef' => (is => 'ro', isa => 'Any'); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'ro', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); } my $file = catfile($dir,'temp.json'); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/006_w_custom_type_handlers.t000644 000766 000024 00000002775 13646474070 022354 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 7; use Test::Deep; =pod This is just a simple example of defining a custom type handler to take care of custom inflate and deflate needs. =cut { package Bar; use Moose; has 'baz' => (is => 'rw', isa => 'Str'); has 'boo' => (is => 'rw', isa => 'Str'); sub encode { my $self = shift; $self->baz . '|' . $self->boo; } sub decode { my ($class, $packed) = @_; my ($baz, $boo) = split /\|/ => $packed; $class->new( baz => $baz, boo => $boo, ); } use MooseX::Storage::Engine; MooseX::Storage::Engine->add_custom_type_handler( 'Bar' => ( expand => sub { Bar->decode(shift) }, collapse => sub { (shift)->encode }, ) ); package Foo; use Moose; use MooseX::Storage; with Storage; has 'bar' => ( is => 'ro', isa => 'Bar', default => sub { Bar->new(baz => 'BAZ', boo => 'BOO') } ); } my $foo = Foo->new; isa_ok($foo, 'Foo'); isa_ok($foo->bar, 'Bar'); cmp_deeply( $foo->pack, { __CLASS__ => "Foo", bar => "BAZ|BOO", }, '... got correct packed structure'); { my $foo = Foo->unpack({ __CLASS__ => "Foo", bar => "BAZ|BOO", }); isa_ok($foo, 'Foo'); isa_ok($foo->bar, 'Bar'); is($foo->bar->baz, 'BAZ', '... got the right stuff'); is($foo->bar->boo, 'BOO', '... got the right stuff'); } MooseX-Storage-0.53/t/009_do_not_serialize_lazy.t000600 000766 000024 00000001610 13646474070 022141 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 'no_plan';#tests => 6; use Test::Deep; { package Point; use Moose; use MooseX::Storage; with Storage( traits => [qw|OnlyWhenBuilt|] ); has 'x' => (is => 'rw', lazy_build => 1 ); has 'y' => (is => 'rw', predicate => '_has_y' ); has 'z' => (is => 'rw', builder => '_build_z' ); sub _build_x { 'x' } sub _build_y { 'y' } sub _build_z { 'z' } } my $p = Point->new( 'x' => $$ ); ok( $p, "New object created" ); my $href = $p->pack; ok( $href, " Object packed" ); is( $href->{'x'}, $$, " x => $$" ); is( $href->{'z'}, 'z', " z => z" ); ok( not(exists($href->{'y'})), " y does not exist" ); cmp_deeply( $href, { '__CLASS__' => 'Point', 'x' => $$, 'z' => 'z' }, " Deep check passed" ); MooseX-Storage-0.53/t/070_basic_maybe.t000644 000766 000024 00000013732 13646474070 020025 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 29; use Test::Deep; { package Foo; use Moose; use MooseX::Storage; with Storage; has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => ( is => 'ro', isa => 'Maybe[Int]' ); has 'string' => ( is => 'ro', isa => 'Maybe[Str]' ); has 'boolean' => ( is => 'ro', isa => 'Maybe[Bool]' ); has 'float' => ( is => 'ro', isa => 'Maybe[Num]' ); has 'array' => ( is => 'ro', isa => 'Maybe[ArrayRef]' ); has 'hash' => ( is => 'ro', isa => 'Maybe[HashRef]' ); has 'object' => ( is => 'ro', isa => 'Maybe[Foo]' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', undef => undef, number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo', undef => undef, number => 10, string => 'foo', boolean => 1, float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, } ); isa_ok( $foo, 'Foo' ); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); ok( $foo->boolean, '... got the right boolean' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } { package Foo; use Moose; use Moose::Util::TypeConstraints; use MooseX::Storage; use Scalar::Util 'looks_like_number'; with Storage; subtype 'Natural' => as 'Int' => where { $_ > 0 }; subtype 'HalfNum' => as 'Num' => where { "$_" =~ /\.5$/ }; subtype 'FooString' => as 'Str' => where { lc($_) eq 'foo' }; subtype 'IntArray' => as 'ArrayRef' => where { scalar grep { looks_like_number($_) } @{$_} }; subtype 'UndefHash' => as 'HashRef' => where { scalar grep { !defined($_) } values %{$_} }; has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => ( is => 'ro', isa => 'Maybe[Natural]' ); has 'string' => ( is => 'ro', isa => 'Maybe[FooString]' ); has 'float' => ( is => 'ro', isa => 'Maybe[HalfNum]' ); has 'array' => ( is => 'ro', isa => 'Maybe[IntArray]' ); has 'hash' => ( is => 'ro', isa => 'Maybe[UndefHash]' ); has 'object' => ( is => 'ro', isa => 'Maybe[Foo]' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo', undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, } ); isa_ok( $foo, 'Foo' ); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/030_with_checksum.t000640 000766 000024 00000010642 13646474070 020411 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Fatal; use Test::Deep; use Test::Needs qw( Digest::HMAC_SHA1 JSON::MaybeXS ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 25; { package Foo; use Moose; use MooseX::Storage; with Storage(base => 'WithChecksum', format => "JSON"); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Foo' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $packed = $foo->pack; cmp_deeply( $packed, { __CLASS__ => 'Foo', __DIGEST__ => re('[0-9a-f]+'), number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', __DIGEST__ => re('[0-9a-f]+'), number => 2 }, }, '... got the right frozen class' ); my $foo2; is( exception { $foo2 = Foo->unpack($packed); }, undef, '... unpacked okay'); isa_ok($foo2, 'Foo'); cmp_deeply( $foo2->pack, { __CLASS__ => 'Foo', __DIGEST__ => re('[0-9a-f]+'), number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', __DIGEST__ => re('[0-9a-f]+'), number => 2 }, }, '... got the right frozen class' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $frozen = $foo->freeze; ok( length($frozen), "got frozen data" ); $frozen =~ s/foo/bar/; my $foo2 = eval { Foo->thaw( $frozen ) }; my $e = $@; ok( !$foo2, "not thawed" ); ok( $e, "has error" ); like( $e, qr/bad checksum/i, "bad checksum error" ); } SKIP: { eval { require Digest::HMAC_SHA1 }; if ($@) { my $message = join( " ", "no Digest::HMAC", ( $@ =~ /\@INC/ ? () : do { chomp(my $e = $@); "($e)" } ) ); die $message if $ENV{AUTHOR_TESTING}; skip $message, 15; } local $::DEBUG = 1; my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $frozen1 = $foo->freeze( digest => [ "HMAC_SHA1", "secret" ] ); ok( length($frozen1), "got frozen data" ); $::DEBUG = 0; my $d2 = Digest::HMAC_SHA1->new("s3cr3t"); my $frozen2 = $foo->freeze( digest => $d2 ); ok( length($frozen2), "got frozen data" ); cmp_ok( $frozen1, "ne", $frozen2, "versions are different" ); is( $frozen1, $foo->freeze( digest => [ HMAC_SHA1 => "secret" ] ), "refreeze" ); $::DEBUG = 1; my $foo1 = eval { Foo->thaw( $frozen1, digest => [ "HMAC_SHA1", "secret" ] ) }; my $e = $@; ok( $foo1, "thawed" ); ok( !$e, "no error" ) || diag $e; my $foo2 = eval { Foo->thaw( $frozen2, digest => $d2 ) }; $e = $@; ok( $foo2, "thawed" ); ok( !$e, "no error" ) || diag $e; $foo1 = eval { Foo->thaw( $frozen1, digest => $d2 ) }; $e = $@; ok( !$foo1, "not thawed" ); ok( $e, "has error" ); like( $e, qr/bad checksum/i, "bad checksum error" ); $frozen1 =~ s/foo/bar/; $foo1 = eval { Foo->thaw( $frozen1, digest => [ "HMAC_SHA1", "secret" ] ) }; $e = $@; ok( !$foo1, "not thawed" ); ok( $e, "has error" ); like( $e, qr/bad checksum/i, "bad checksum error" ); } MooseX-Storage-0.53/t/102_io_storable_file.t000644 000766 000024 00000003453 13646474070 021063 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 13; use Test::Deep; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir( CLEANUP => 1 ); { package Foo; use Moose; use MooseX::Storage; with Storage(io => 'StorableFile'); has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'ro', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); } my $file = catfile($dir,'temp.storable'); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/00-report-prereqs.t000644 000766 000024 00000014123 13646474070 020403 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 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( Encode File::Temp JSON::PP Module::Runtime Pod::Coverage Sub::Name YAML autodie Dist::CheckConflicts YAML::Old YAML YAML::Tiny YAML::Any YAML::XS MooseX::Role::Parameterized JSON JSON::PP JSON::DWIW JSON::Syck JSON::XS Cpanel::JSON::XS JSON::MaybeXS YAML::XS YAML::Syck ); 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'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $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 ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: MooseX-Storage-0.53/t/400_moosex_types.t000640 000766 000024 00000002125 13646474070 020310 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use Test::Needs 'MooseX::Types'; { package MyTypes; use strict; use warnings; use MooseX::Types -declare => [ qw(MyNum MaybeMyNum) ]; use MooseX::Types::Moose 'Num'; subtype MyNum, as Num; subtype MaybeMyNum, as maybe_type(MyNum); } { package MyClass; use Moose; use MooseX::Storage; with Storage; has 'mynum' => ( is => 'ro', isa => MyTypes::MyNum ); has 'maybe_mynum' => ( is => 'ro', isa => MyTypes::MaybeMyNum ); } my $obj = MyClass->new( mynum => 10, maybe_mynum => 20, ); my $packed = $obj->pack; cmp_deeply( $packed, { __CLASS__ => 'MyClass', mynum => 10, maybe_mynum => 20, }, 'correctly serialized a MooseX::Type attribute using Maybe', ); my $unpacked = MyClass->unpack($packed); cmp_deeply( $unpacked, all( isa('MyClass'), noclass({ mynum => 10, maybe_mynum => 20, }), ), 'correctly deserialized data from a MooseX::Type attribute using Maybe', ); done_testing; MooseX-Storage-0.53/t/100_io.t000640 000766 000024 00000003570 13646474070 016163 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir; use Test::Needs 'JSON::MaybeXS'; diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 13; { package Foo; use Moose; use MooseX::Storage; with Storage(format => 'JSON', io => 'File'); has 'unset' => (is => 'ro', isa => 'Any'); has 'undef' => (is => 'ro', isa => 'Any'); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'ro', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); } my $file = catfile( $dir, 'temp.json' ); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is($foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is($foo->undef, undef, '... got the right undef value'); ok($foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/002_basic_w_subtypes.t000644 000766 000024 00000005372 13646474070 021130 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 10; use Test::Deep; =pod This extends the 001_basic test to show that subtypes will DWIM in most cases. =cut { package Foo; use Moose; use Moose::Util::TypeConstraints; use MooseX::Storage; use Scalar::Util 'looks_like_number'; with Storage; subtype 'Natural' => as 'Int' => where { $_ > 0 }; subtype 'HalfNum' => as 'Num' => where { "$_" =~ /\.5$/ }; subtype 'FooString' => as 'Str' => where { lc($_) eq 'foo' }; subtype 'IntArray' => as 'ArrayRef' => where { scalar grep { looks_like_number($_) } @{$_} }; subtype 'UndefHash' => as 'HashRef' => where { scalar grep { !defined($_) } values %{$_} }; has 'number' => ( is => 'ro', isa => 'Natural' ); has 'string' => ( is => 'ro', isa => 'FooString' ); has 'float' => ( is => 'ro', isa => 'HalfNum' ); has 'array' => ( is => 'ro', isa => 'IntArray' ); has 'hash' => ( is => 'ro', isa => 'UndefHash' ); has 'object' => ( is => 'ro', isa => 'Foo' ); } { my $foo = Foo->new( number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, }, '... got the right frozen class' ); } { my $foo = Foo->unpack( { __CLASS__ => 'Foo', number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, } ); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/003_basic_w_embedded_objects.t000640 000766 000024 00000005127 13646474070 022507 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 5; use Test::Deep; =pod This test checks the single level expansion and collapsing of the ArrayRef and HashRef type handlers. =cut { package Bar; use Moose; use MooseX::Storage; with Storage; has 'number' => (is => 'ro', isa => 'Int'); package Foo; use Moose; use MooseX::Storage; with Storage; has 'bars' => ( is => 'ro', isa => 'ArrayRef[Bar]' ); package Baz; use Moose; use MooseX::Storage; with Storage; has 'bars' => ( is => 'ro', isa => 'HashRef[Bar]' ); } { my $foo = Foo->new( bars => [ map { Bar->new(number => $_) } (1 .. 10) ] ); isa_ok( $foo, 'Foo' ); cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', bars => [ map { { __CLASS__ => 'Bar', number => $_, } } (1 .. 10) ], }, '... got the right frozen class' ); } subtest 'Foo' => sub { my $foo = Foo->unpack( { __CLASS__ => 'Foo', bars => [ map { { __CLASS__ => 'Bar', number => $_, } } (1 .. 10) ], } ); isa_ok( $foo, 'Foo' ); subtest 'bars', \&test_bars, @{ $foo->bars }; }; subtest 'Baz', sub { my $baz = Baz->new( bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) } ); isa_ok( $baz, 'Baz' ); cmp_deeply( $baz->pack, { __CLASS__ => 'Baz', bars => { map { ($_ => { __CLASS__ => 'Bar', number => $_, }) } (1 .. 10) }, }, '... got the right frozen class' ); }; subtest 'Baz unpack', sub { my $baz = Baz->unpack( { __CLASS__ => 'Baz', bars => { map { ($_ => { __CLASS__ => 'Bar', number => $_, }) } (1 .. 10) }, } ); isa_ok( $baz, 'Baz' ); subtest 'bars' => \&test_bars, map { $baz->bars->{$_ } } 1..10; }; sub test_bars { my @bars = @_; is scalar @bars => 10, 'we have 10 bars'; my $i = 0; subtest "bar.".$i, sub { is $_->number => ++$i, 'right value'; } for @bars; } MooseX-Storage-0.53/t/061_basic_deferred_w_io.t000640 000766 000024 00000005630 13646474070 021517 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::Deep; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir; use Test::Needs qw( IO::AtomicFile JSON::MaybeXS ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 23; { package Foo; use Moose; use MooseX::Storage; with 'MooseX::Storage::Deferred'; has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => (is => 'ro', isa => 'Int'); has 'string' => (is => 'ro', isa => 'Str'); has 'float' => (is => 'ro', isa => 'Num'); has 'array' => (is => 'ro', isa => 'ArrayRef'); has 'hash' => (is => 'ro', isa => 'HashRef'); has 'object' => (is => 'ro', isa => 'Object'); } my $file = catfile($dir, 'temp.json'); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file, { format => 'JSON', io => 'File' }); } { my $foo = Foo->load($file, { format => 'JSON', io => 'File' }); isa_ok($foo, 'Foo'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } unlink $file; ok(!(-e $file), '... the file has been deleted'); { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } (1 .. 10) }, object => Foo->new( number => 2 ), ); isa_ok($foo, 'Foo'); $foo->store($file, { format => 'JSON', io => 'AtomicFile' }); } { my $foo = Foo->load($file, { format => 'JSON', io => 'AtomicFile' }); isa_ok($foo, 'Foo'); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is($foo->number, 10, '... got the right number'); is($foo->string, 'foo', '... got the right string'); is($foo->float, 10.5, '... got the right float'); cmp_deeply($foo->array, [ 1 .. 10], '... got the right array'); cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash'); isa_ok($foo->object, 'Foo'); is($foo->object->number, 2, '... got the right number (in the embedded object)'); } MooseX-Storage-0.53/t/00-report-prereqs.dd000644 000766 000024 00000032667 13646474070 020544 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'CPAN::Meta::Requirements' => '2.120620', 'ExtUtils::MakeMaker' => '0', 'Module::Metadata' => '0', 'perl' => '5.006' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.154', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { 'Digest::HMAC_SHA1' => '0', 'Encode' => '0', 'File::Spec' => '0', 'IO::AtomicFile' => '0', 'IO::File' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'JSON::MaybeXS' => '1.001000', 'MooseX::Storage::Format::JSONpm' => '0', 'MooseX::Types' => '0', 'MooseX::Types::Moose' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Storable' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CleanNamespaces' => '0.15', 'Test::Deep::JSON' => '0', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::No404s' => '0', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Without::Module' => '0', 'YAML' => '0', 'YAML::Any' => '0', 'YAML::Syck' => '0', 'YAML::XS' => '0', 'perl' => '5.006', 'strict' => '0', 'warnings' => '0' } }, 'runtime' => { 'recommends' => { 'IO::AtomicFile' => '0', 'IO::File' => '0', 'JSON::MaybeXS' => '1.001000', 'Storable' => '0', 'YAML' => '0', 'YAML::Any' => '0', 'YAML::Syck' => '0', 'YAML::XS' => '0' }, 'requires' => { 'Carp' => '0', 'Data::Dumper' => '0', 'Digest' => '0', 'Module::Runtime' => '0', 'Moose' => '0.99', 'Moose::Meta::Attribute' => '0', 'Moose::Role' => '0', 'Scalar::Util' => '0', 'String::RewritePrefix' => '0', 'namespace::autoclean' => '0', 'perl' => '5.008' }, 'suggests' => { 'IO::AtomicFile' => '0', 'IO::File' => '0', 'JSON::MaybeXS' => '1.001000', 'MooseX::Storage::Format::JSONpm' => '0', 'Storable' => '0', 'YAML::Any' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900', 'Test::Deep::JSON' => '0', 'Test::Without::Module' => '0' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'File::Spec::Functions' => '0', 'File::Temp' => '0', 'JSON::PP' => '0', 'Moose::Util::TypeConstraints' => '0', 'Test::Deep' => '0', 'Test::Deep::Type' => '0', 'Test::Fatal' => '0', 'Test::More' => '0.88', 'Test::Needs' => '0', 'open' => '0', 'overload' => '0', 'perl' => '5.008', 'strict' => '0', 'utf8' => '0', 'warnings' => '0' }, 'suggests' => { 'Digest::HMAC_SHA1' => '0', 'MooseX::Types' => '0', 'MooseX::Types::Moose' => '0' } }, 'x_Dist_Zilla' => { '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::CheckMetaResources' => '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::EnsureLatestPerl' => '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::OptionalFeature' => '0.006', 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', 'Dist::Zilla::Plugin::PodWeaver' => '4.005', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0.006', 'Dist::Zilla::Plugin::Prereqs::Soften' => '0.004000', '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::CheckBreaks' => '0.017', '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.000010', '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::Plugin::UseUnsafeInc' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.119', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007', 'Software::License::Perl_5' => '0' } } }; $x; }MooseX-Storage-0.53/t/011_basic_json_w_utf8.t000640 000766 000024 00000003744 13646474070 021166 0ustar00etherstaff000000 000000 use strict; use warnings; use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8 use Test::More; use Test::Needs qw( Encode JSON::MaybeXS ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 15; { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'JSON' ); has 'utf8_string' => ( is => 'rw', isa => 'Str', default => sub { "ネットスーパー (Internet Shopping)" } ); } { my $foo = Foo->new; isa_ok( $foo, 'Foo' ); my $json = $foo->freeze; is($json, '{"__CLASS__":"Foo","utf8_string":"ネットスーパー (Internet Shopping)"}', '... got the right JSON'); my $foo2 = Foo->thaw($json); isa_ok( $foo, 'Foo' ); is($foo2->utf8_string, "ネットスーパー (Internet Shopping)", '... got the string we expected'); is($foo2->freeze, '{"__CLASS__":"Foo","utf8_string":"ネットスーパー (Internet Shopping)"}', '... got the right JSON'); } { my $test_string; { use utf8; $test_string = "ネットスーパー (Internet Shopping)"; no utf8; } ok(utf8::is_utf8($test_string), '... got a utf8 string'); ok(utf8::valid($test_string), '... got a valid utf8 string'); Encode::_utf8_off($test_string); ok(!utf8::is_utf8($test_string), '... no longer is utf8 string'); ok(utf8::valid($test_string), '... got a valid utf8 string'); my $foo = Foo->new( utf8_string => $test_string ); isa_ok( $foo, 'Foo' ); ok(!utf8::is_utf8($foo->utf8_string), '... not a utf8 string'); ok(utf8::valid($foo->utf8_string), '... but is a valid utf8 string'); my $json = $foo->freeze; ok(utf8::is_utf8($json), '... is a utf8 string now'); ok(utf8::valid($json), '... got a valid utf8 string'); is($json, '{"__CLASS__":"Foo","utf8_string":"ネットスーパー (Internet Shopping)"}', '... got the right JSON'); } MooseX-Storage-0.53/t/040_basic_utils.t000644 000766 000024 00000003211 13646474070 020054 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 3; use MooseX::Storage::Util; my $packed = { __CLASS__ => 'Foo', number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => { __CLASS__ => 'Foo', number => 2 }, }; my $json = '{"array":[1,2,3,4,5,6,7,8,9,10],"hash":{"6":null,"3":null,"7":null,"9":null,"2":null,"8":null,"1":null,"4":null,"10":null,"5":null},"float":10.5,"object":{"number":2,"__CLASS__":"Foo"},"number":10,"__CLASS__":"Foo","string":"foo"}'; my $yaml = q{--- __CLASS__: Foo array: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 float: 10.5 hash: 1: ~ 10: ~ 2: ~ 3: ~ 4: ~ 5: ~ 6: ~ 7: ~ 8: ~ 9: ~ number: 10 object: __CLASS__: Foo number: 2 string: foo }; is('Foo', MooseX::Storage::Util->peek($packed), '... got the right class name from the packed item'); SKIP: { my $classname = eval { MooseX::Storage::Util->peek($json => ('format' => 'JSON')) }; if ($@ =~ /^Could not load JSON module because/) { die 'No JSON module found' if $ENV{AUTHOR_TESTING}; skip "No JSON module found", 1; } is('Foo', $classname, '... got the right class name from the json item'); } SKIP: { my $classname = eval { MooseX::Storage::Util->peek($yaml => ('format' => 'YAML')) }; if ($@ =~ /^Could not load YAML module because/) { die 'No YAML module found' if $ENV{AUTHOR_TESTING}; skip "No YAML module found", 1; } is('Foo', $classname, '... got the right class name from the yaml item'); } MooseX-Storage-0.53/t/050_basic_storable.t000644 000766 000024 00000005235 13646474070 020540 0ustar00etherstaff000000 000000 $|++; use strict; use warnings; use Test::More tests => 14; use Test::Deep; use Storable; { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'Storable' ); has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $stored = $foo->freeze; my $struct = Storable::thaw($stored); cmp_deeply( $struct, { '__CLASS__' => 'Foo', 'undef' => undef, 'number' => 10, 'string' => 'foo', 'float' => 10.5, 'array' => [ 1 .. 10], 'hash' => { map { $_ => undef } 1 .. 10 }, 'object' => { '__CLASS__' => 'Foo', 'number' => 2 }, }, '... got the data struct we expected' ); } { my $stored = Storable::nfreeze({ '__CLASS__' => 'Foo', 'undef' => undef, 'number' => 10, 'string' => 'foo', 'float' => 10.5, 'array' => [ 1 .. 10], 'hash' => { map { $_ => undef } 1 .. 10 }, 'object' => { '__CLASS__' => 'Foo', 'number' => 2 }, }); my $foo = Foo->thaw($stored); isa_ok( $foo, 'Foo' ); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } MooseX-Storage-0.53/t/zzz-check-breaks.t000644 000766 000024 00000001267 13646474070 020356 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.019 use Test::More tests => 3; SKIP: { eval { +require Module::Runtime::Conflicts; Module::Runtime::Conflicts->check_conflicts }; skip('no Module::Runtime::Conflicts module found', 1) if not $INC{'Module/Runtime/Conflicts.pm'}; diag $@ if $@; pass 'conflicts checked via Module::Runtime::Conflicts'; } SKIP: { eval { +require Moose::Conflicts; Moose::Conflicts->check_conflicts }; skip('no Moose::Conflicts module found', 1) if not $INC{'Moose/Conflicts.pm'}; diag $@ if $@; pass 'conflicts checked via Moose::Conflicts'; } pass 'no x_breaks data to check'; MooseX-Storage-0.53/t/105_io_atomic_w_utf8.t000640 000766 000024 00000002417 13646474070 021017 0ustar00etherstaff000000 000000 use strict; use warnings; use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8 use Test::More; use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir; use Test::Needs qw( JSON::MaybeXS IO::AtomicFile ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; plan tests => 7; use utf8; { package Foo; use Moose; use MooseX::Storage; with Storage( 'format' => 'JSON', 'io' => 'AtomicFile' ); has 'utf8_string' => ( is => 'rw', isa => 'Str', default => sub { "ネットスーパー (Internet Shopping)" } ); } my $file = catfile($dir, 'temp.json'); { my $foo = Foo->new; isa_ok( $foo, 'Foo' ); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); is($foo->utf8_string, "ネットスーパー (Internet Shopping)", '... got the string we expected'); } no utf8; unlink $file; { my $foo = Foo->new( utf8_string => 'Escritório' ); isa_ok( $foo, 'Foo' ); $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8'); is($foo->utf8_string, "Escritório", '... got the string we expected'); } MooseX-Storage-0.53/t/200_combined_in_roles.t000644 000766 000024 00000000566 13646474070 021235 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 1; use Test::Fatal; { package ClassOne; use Moose::Role; use MooseX::Storage; } { package ClassTwo; use Moose::Role; use MooseX::Storage; } is( exception { package CombineClasses; use Moose; with qw/ClassOne ClassTwo/; }, undef, 'Can include two roles which both use MooseX::Storage'); MooseX-Storage-0.53/t/060_basic_deferred.t000640 000766 000024 00000012621 13646474070 020477 0ustar00etherstaff000000 000000 $|++; use strict; use warnings; use Test::More; use Test::Deep; use Storable; use Test::Needs qw( Test::Deep::JSON JSON::MaybeXS YAML::Any ); diag 'using JSON backend: ', JSON::MaybeXS->JSON; diag 'using YAML backend: ', YAML::Any->implementation; plan tests => 33; { package Foo; use Moose; use MooseX::Storage; with 'MooseX::Storage::Deferred'; has 'unset' => ( is => 'ro', isa => 'Any' ); has 'undef' => ( is => 'ro', isa => 'Any' ); has 'number' => ( is => 'ro', isa => 'Int' ); has 'string' => ( is => 'ro', isa => 'Str' ); has 'float' => ( is => 'ro', isa => 'Num' ); has 'array' => ( is => 'ro', isa => 'ArrayRef' ); has 'hash' => ( is => 'ro', isa => 'HashRef' ); has 'object' => ( is => 'ro', isa => 'Object' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $json = $foo->freeze({ 'format' => 'JSON' }); cmp_deeply( $json, Test::Deep::JSON::json({ undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, __CLASS__ => 'Foo', object => { number => 2, __CLASS__ => 'Foo' }, }), '... got the right JSON' ); } { my $foo = Foo->thaw( '{"array":[1,2,3,4,5,6,7,8,9,10],"hash":{"6":null,"3":null,"7":null,"9":null,"2":null,"8":null,"1":null,"4":null,"10":null,"5":null},"float":10.5,"object":{"number":2,"__CLASS__":"Foo"},"number":10,"__CLASS__":"Foo","string":"foo"}', { 'format' => 'JSON' } ); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $stored = $foo->freeze({ 'format' => 'Storable' }); my $struct = Storable::thaw($stored); cmp_deeply( $struct, { '__CLASS__' => 'Foo', 'undef' => undef, 'number' => 10, 'float' => 10.5, 'string' => 'foo', 'array' => [ 1 .. 10], 'hash' => { map { $_ => undef } 1 .. 10 }, 'object' => { '__CLASS__' => 'Foo', 'number' => 2 }, }, '... got the data struct we expected' ); } { my $stored = Storable::nfreeze({ '__CLASS__' => 'Foo', 'undef' => undef, 'number' => 10, 'string' => 'foo', 'float' => 10.5, 'array' => [ 1 .. 10], 'hash' => { map { $_ => undef } 1 .. 10 }, 'object' => { '__CLASS__' => 'Foo', 'number' => 2 }, }); my $foo = Foo->thaw($stored, { 'format' => 'Storable' }); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' ); is( $foo->string, 'foo', '... got the right string' ); is( $foo->float, 10.5, '... got the right float' ); cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $foo->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $foo->object, 'Foo' ); is( $foo->object->number, 2, '... got the right number (in the embedded object)' ); } { my $foo = Foo->new( undef => undef, number => 10, string => 'foo', float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); my $yaml = $foo->freeze({ 'format' => 'YAML' }); my $bar = Foo->thaw( $yaml, { 'format' => 'YAML' } ); isa_ok( $bar, 'Foo' ); is( $foo->unset, undef, '... got the right unset value'); ok(!$foo->meta->get_attribute('unset')->has_value($foo), 'unset attribute has no value'); is( $foo->undef, undef, '... got the right undef value'); ok( $foo->meta->get_attribute('undef')->has_value($foo), 'undef attribute has a value'); is( $bar->number, 10, '... got the right number' ); is( $bar->string, 'foo', '... got the right string' ); is( $bar->float, 10.5, '... got the right float' ); cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' ); cmp_deeply( $bar->hash, { map { $_ => undef } ( 1 .. 10 ) }, '... got the right hash' ); isa_ok( $bar->object, 'Foo' ); is( $bar->object->number, 2, '... got the right number (in the embedded object)' ); }