MooseX-Types-0.46/000700 000766 000024 00000000000 12563756310 014230 5ustar00etherstaff000000 000000 MooseX-Types-0.46/Build.PL000644 000766 000024 00000007630 12563756310 015544 0ustar00etherstaff000000 000000 # This Build.PL for MooseX-Types was generated by # Dist::Zilla::Plugin::ModuleBuildTiny::Fallback 0.018 use strict; use warnings; my %configure_requires = ( 'Module::Build::Tiny' => '0.007', ); my @missing = grep { ! eval "require $_; $_->VERSION($configure_requires{$_}); 1" } keys %configure_requires; if (not @missing) { # This section for MooseX-Types was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.013. use strict; use warnings; use 5.008; # use Module::Build::Tiny 0.007; Module::Build::Tiny::Build_PL(); } else { if ($ENV{PERL_MB_FALLBACK_SILENCE_WARNING}) { warn <<'EOW'; *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *** If you're seeing this warning, your toolchain is really, really old* and you'll almost certainly have problems installing CPAN modules from this century. But never fear, dear user, for we have the technology to fix this! If you're using CPAN.pm to install things, then you can upgrade it using: cpan CPAN If you're using CPANPLUS to install things, then you can upgrade it using: cpanp CPANPLUS If you're using cpanminus, you shouldn't be seeing this message in the first place, so please file an issue on github. This public service announcement was brought to you by the Perl Toolchain Gang, the irc.perl.org #toolchain IRC channel, and the number 42. ---- * Alternatively, you are running this file manually, in which case you need to learn to first fulfill all configure requires prerequisites listed in META.yml or META.json -- or use a cpan client to install this distribution. You can also silence this warning for future installations by setting the PERL_MB_FALLBACK_SILENCE_WARNING environment variable, but please don't do that until you fix your toolchain as described above. EOW sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); } # This section was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.039. use strict; use warnings; require Module::Build; Module::Build->VERSION(0.28); my %module_build_args = ( "configure_requires" => { "Module::Build::Tiny" => "0.007", "perl" => "5.008" }, "dist_abstract" => "Organise your Moose types in libraries", "dist_author" => [ "Robert \"phaylon\" Sedlacek " ], "dist_name" => "MooseX-Types", "dist_version" => "0.46", "license" => "perl", "module_name" => "MooseX::Types", "recursive_test_files" => 1, "requires" => { "Carp" => 0, "Carp::Clan" => "6.00", "Exporter" => 0, "Module::Runtime" => 0, "Moose" => "1.06", "Moose::Exporter" => 0, "Moose::Meta::TypeConstraint::Union" => 0, "Moose::Util::TypeConstraints" => 0, "Scalar::Util" => "1.19", "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => "0.100052", "Sub::Name" => 0, "base" => 0, "namespace::autoclean" => "0.16", "overload" => 0, "perl" => "5.008", "strict" => 0, "warnings" => 0 }, "test_requires" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Moose::Role" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Requires" => 0, "if" => 0, "lib" => 0, "perl" => "5.008" } ); my %fallback_build_requires = ( "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Moose::Role" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Requires" => 0, "if" => 0, "lib" => 0, "perl" => "5.008" ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; } MooseX-Types-0.46/Changes000600 000766 000024 00000017433 12563756310 015535 0ustar00etherstaff000000 000000 Revision history for MooseX-Types 0.46 2015-08-16 00:43:46Z - make use of Sub::Exporter::ForMethods's new rebless option 0.45 2014-09-02 01:17:50Z - increase the required versions of some prerequisites 0.44 2014-03-09 04:16:20Z - full respect for namespaces: declared types are now properly installed into the proper package, so they survive namespace::autoclean; however, types imported from the declaration class are still properly cleaned by namespace::autoclean (as implemented in trial versions 0.40-0.43) 0.43 2014-01-17 01:25:55Z (TRIAL RELEASE) - line numbers in shipped code are now almost the same (within 3) as the repository source, for easier debugging - skipped new namespacing tests that fail with older Moose versions, due to an inability to install blessed subs 0.42 2014-01-04 23:31:58Z (TRIAL RELEASE) - declared (not imported) types are now properly installed into the proper package, so they survive namespace::autoclean (fixed this time) 0.41 2013-12-21 17:21:41Z - reversed changes in 0.40, until compatibility issues with older Moose versions are figured out 0.40 2013-12-20 06:38:15Z - types are now properly installed into the proper package, so they survive namespace::autoclean 0.39 2013-11-30 18:31:32Z - more strict warnings checking in tests - re-release to fix compile test 0.38 2013-09-17 00:44:16Z - removed use of deprecated enum syntax 0.37 2013-09-08 21:58:26Z - removed use of deprecated Class::MOP::load_class - repository has moved to the GitHub Moose organization 0.36 2013-06-22 20:51:54Z - fixed failing tests on 5.8.5 due to incorrect == overload (RT#77100, Graham Knop) 0.35 2012-05-19 - The new delegation code could fail when a type had no parent. Attempting to subtype Any was one way to trigger the bug. (Dave Rolsky) - The new delegation code broke calling ->can or ->isa on MooseX::Types::TypeDecorator as a class method. (Dave Rolsky) 0.34 2012-05-18 - Special case new to avoid unexpected exceptions on unloaded classes 0.33 2012-05-18 - Switch delegation order to prioritise type over class except for new 0.32 2012-05-18 - Support delegation of methods to the class for class types - Factor out _try_delegate method 0.31 2011-12-22 - Add support for qw( :all ) on MooseX::Types::Combine libraries. (kentnl) 0.30 2011-09-17 - Fix a bug in the tests that caused failures with Moose HEAD. (doy) 0.29 2011-08-20 - Require namespace::clean 0.19. Tests fail with 0.18. Reported by Ruslan Zakirov. RT #67923. 0.28 2011-08-02 - Fixed git and bug tracking info in META.{yml,json}. Reported by Petter Rabbitson. (Dave Rolsky) 0.27 2011-06-06 - A better fix for type constraint changes in Moose 2.0100. (doy) 0.26 2011-06-05 - Small changes for forward compatibility with Moose 2.0100, when it is released. (Dave Rolsky) - Some small doc cleanup and improvements. (Dave Rolsky) 0.25 2010-11-30 - The test suite now uses Test::Fatal instead of Test::Exception (Karen Etheridge). - Modernized tests to use Test::Requires and done_testing. (Dave Rolsky) - MooseX::Types::Combine is a little more efficient, and only tries to load the libraries it's combining when that list is set. It also checks that each lib in the list actually provides types. (Dave Rolsky). - The MooseX::Types docs now contain a pointer to MooseX::Types::Combine. (Dave Rolsky) 0.24 2010-09-11 - Avoid more warnings from Moose 1.09 in tests (Dave Rolsky). 0.23 2010-07-19 - Avoid warnings from Moose 1.09 in tests (Dave Rolsky). 0.22 2010-06-01 - Update docs to mention MRO::Compat rather than Class::C3. - Added '0+' overloading to solve the type constraint equality regression introduced when Moose 1.05 tightened the rules determing type constraint equality. Added tests for the regression. 0.21 2009-12-23 - Attempting to import a non-existent type from a combined type library gave a very confusing error message from the MooseX::Types::Combined internals. Now it gives you a much more useful message. (Dave Rolsky) - bump up Moose dep (RT#53016) 0.20 2009-09-10 - fix "empty export" warning (doy). 0.19 2009-08-23 - un-fix coercions on parameterized types, since it broke MooseX::Method::Signatures, as well as any other code that relied on new type constraint objects being generated each time a type was parameterized (hdp). 0.18 2009-08-22 - fix coercions on parameterized types (Hans Dieter Pearcey). 0.17 2009-08-18 - Documentation typo fix (Dave Rolsky). - Stop blowing up in has_available_type_export if the introspected code symbol exists but is not a type export (Florian Ragwitz). - Reorganize author/copyright sections at the request of Debian packagers (Rafael Kitover). 0.16 2009-06-29 - Ship with Module::Install 0.91 0.15 2009-06-27 - Change all uses of croak in TypeDecorator to use the Moose throw_exception method. - More test cases for the union mixed string type issue, and better handling of this in the | overload in TypeDecorator 0.14 2009-06-26 - Fix union with string type 0.13 2009-06-23 - Add Test::Moose to build_requires for Fedora 0.12 2009-06-14 - fix mixing of typelibs with regular Moose classes 0.11 2009-05-23 - warning on string types and unregistered class/role types - better error for missing comma - MooseX::Types::Combine for combining type libs 0.10 2009-03-06 - Removed unneeded debugging code from one of the tests, which was causing installation errors for people that didn't already have Data::Dump installed. (jjnapiork) 0.09 2009-03-03 - Added MooseX::Types::Util::has_available_type_export($p, $n) to allow introspection of available types for other libraries wanting to use type export names for type specifications. 0.08 2008-12-09 - Added experimental support for recursive type constraints. Pod and tests for this feature. Let the madness begin. - Documentation updates. - Workaround test case for the SUb::Exporter compatibility issue. Also documented in Pod. 0.07 2008-10-07 - Bumped minimum allowed Moose version to fix problem with overloading on some versions of Perl - Tiny documentation updates. 0.06 2008-10-24 - Added support for parameterized types and type unions, tests for all that and documentation updates. 0.05 2008-02-19 - moved export mechanism to Sub::Exporter. ::Base contains a bunch of wrapping logic to allow the export-along functionality for the helper symbols - removed vestigial load of Sub::UpLevel since it breaks the argument display in confess() 0.04 2007-08-09 - Automatically set strict and warnings like Moose does 0.03 2007-08-09 - Minor POD typo correction - Added some error messages for wrong type names - Coercion handler not exported without type object - Moved from Class::Inspector to Class::MOP::load_class 0.02 2007-08-08 - Changed declaration to croak when it sees '::' in a typename 0.01 2007-08-08 - Initial release MooseX-Types-0.46/CONTRIBUTING000644 000766 000024 00000007242 12563756310 016101 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficent for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/MooseX-Types. If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends MooseX::Types 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::Types 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-Types You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types or via bug-MooseX-Types@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::ShareDir 0.006 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.102. MooseX-Types-0.46/dist.ini000600 000766 000024 00000002532 12563756310 015700 0ustar00etherstaff000000 000000 name = MooseX-Types author = Robert "phaylon" Sedlacek license = Perl_5 copyright_holder = Robert "phaylon" Sedlacek copyright_year = 2007 [@Author::ETHER] :version = 0.094 surgical_podweaver = 1 -remove = PodCoverageTests ; we have our own custom one -remove = Test::UnusedVars ; we like our $class! Authority.authority = cpan:PHAYLON Test::MinimumVersion.max_target_perl = 5.008003 Test::PodSpelling.stopwords[0] = SUBTYPES Test::PodSpelling.stopwords[1] = coercions Test::PodSpelling.stopwords[2] = subtypes Test::PodSpelling.stopwords[3] = subtyping Test::PodSpelling.stopwords[4] = instantiation Test::PodSpelling.stopwords[5] = TODO Test::PodSpelling.stopwords[6] = Organise Test::PodSpelling.stopwords[7] = parameterized Test::PodSpelling.stopwords[8] = parameterize Test::PodSpelling.stopwords[9] = subtype Test::ReportPrereqs.include = Dist::CheckConflicts StaticInstall.dry_run = 0 ; we can safely set this here ; specific version requirements [Prereqs / RuntimeRequires] Carp::Clan = 6.00 Moose = 1.06 Scalar::Util = 1.19 namespace::autoclean = 0.08 [Prereqs / DevelopRequires] Test::Warnings = 0 Test::Pod::Coverage = 1.04 Pod::Coverage::Moose = 0.02 [MetaResources] x_IRC = irc://irc.perl.org/#moose x_MailingList = http://lists.perl.org/list/moose.html [Test::CheckBreaks] conflicts_module = Moose::Conflicts MooseX-Types-0.46/INSTALL000644 000766 000024 00000001702 12563756310 015273 0ustar00etherstaff000000 000000 This is the Perl distribution MooseX-Types. Installing MooseX-Types is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::Types If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S MooseX::Types ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan MooseX::Types ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Build.PL % ./Build && ./Build test Then install it: % ./Build install If you are installing into a system-wide directory, you may need to run: % sudo ./Build install ## Documentation MooseX-Types documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc MooseX::Types MooseX-Types-0.46/lib/000700 000766 000024 00000000000 12563756310 014776 5ustar00etherstaff000000 000000 MooseX-Types-0.46/LICENSE000644 000766 000024 00000043724 12563756310 015261 0ustar00etherstaff000000 000000 This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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 Robert "phaylon" Sedlacek. 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 Robert "phaylon" Sedlacek. 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-Types-0.46/Makefile.PL000644 000766 000024 00000007767 12563756310 016235 0ustar00etherstaff000000 000000 # This Makefile.PL for MooseX-Types was generated by # Dist::Zilla::Plugin::MakeMaker::Fallback 0.019 # and Dist::Zilla::Plugin::MakeMaker::Awesome 0.34. # Don't edit it but the dist.ini and plugins used to construct it. use strict; use warnings; BEGIN { my %configure_requires = ( 'Module::Build::Tiny' => '0.007', ); my @missing = grep { ! eval "require $_; $_->VERSION($configure_requires{$_}); 1" } keys %configure_requires; if (not @missing) { print "Congratulations, your toolchain understands 'configure_requires'!\n\n"; } else { if (not $ENV{PERL_MM_FALLBACK_SILENCE_WARNING}) { warn <<'EOW'; *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *** If you're seeing this warning, your toolchain is really, really old* and you'll almost certainly have problems installing CPAN modules from this century. But never fear, dear user, for we have the technology to fix this! If you're using CPAN.pm to install things, then you can upgrade it using: cpan CPAN If you're using CPANPLUS to install things, then you can upgrade it using: cpanp CPANPLUS If you're using cpanminus, you shouldn't be seeing this message in the first place, so please file an issue on github. If you're installing manually, please retrain your fingers to run Build.PL when present instead. This public service announcement was brought to you by the Perl Toolchain Gang, the irc.perl.org #toolchain IRC channel, and the number 42. ---- * Alternatively, you are doing something overly clever, in which case you should consider setting the 'prefer_installer' config option in CPAN.pm, or 'prefer_makefile' in CPANPLUS, to 'mb" and '0' respectively. You can also silence this warning for future installations by setting the PERL_MM_FALLBACK_SILENCE_WARNING environment variable. EOW sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); } } } # end BEGIN use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Organise your Moose types in libraries", "AUTHOR" => "Robert \"phaylon\" Sedlacek ", "CONFIGURE_REQUIRES" => { "Module::Build::Tiny" => "0.007" }, "DISTNAME" => "MooseX-Types", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008", "NAME" => "MooseX::Types", "PL_FILES" => {}, "PREREQ_PM" => { "Carp" => 0, "Carp::Clan" => "6.00", "Exporter" => 0, "Module::Runtime" => 0, "Moose" => "1.06", "Moose::Exporter" => 0, "Moose::Meta::TypeConstraint::Union" => 0, "Moose::Util::TypeConstraints" => 0, "Scalar::Util" => "1.19", "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => "0.100052", "Sub::Name" => 0, "base" => 0, "namespace::autoclean" => "0.16", "overload" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Moose::Role" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Requires" => 0, "if" => 0, "lib" => 0 }, "VERSION" => "0.46", "test" => { "TESTS" => "t/*.t t/regressions/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Carp::Clan" => "6.00", "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Module::Runtime" => 0, "Moose" => "1.06", "Moose::Exporter" => 0, "Moose::Meta::TypeConstraint::Union" => 0, "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "Scalar::Util" => "1.19", "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => "0.100052", "Sub::Name" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Requires" => 0, "base" => 0, "if" => 0, "lib" => 0, "namespace::autoclean" => "0.16", "overload" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); MooseX-Types-0.46/MANIFEST000644 000766 000024 00000002664 12563756310 015403 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.039. Build.PL CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/MooseX/Types.pm lib/MooseX/Types/Base.pm lib/MooseX/Types/CheckedUtilExports.pm lib/MooseX/Types/Combine.pm lib/MooseX/Types/Moose.pm lib/MooseX/Types/TypeDecorator.pm lib/MooseX/Types/UndefinedType.pm lib/MooseX/Types/Util.pm lib/MooseX/Types/Wrapper.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/10_moose-types.t t/11_library-definition.t t/12_wrapper-definition.t t/13_typedecorator.t t/14_compatibility-sub-exporter.t t/15_recursion.t t/16_introspection.t t/17_syntax_errors.t t/18_combined_libs.t t/19_typelib_with_role.t t/20_union_with_string_type.t t/21_coerce_parameterized_types.t t/22_class_type.t t/23_any_subtype.t t/24_class_can_isa.t t/25-fully-qualified.t t/lib/Combined.pm t/lib/DecoratorLibrary.pm t/lib/Empty.pm t/lib/SubExporterCompatibility.pm t/lib/TestLibrary.pm t/lib/TestLibrary2.pm t/lib/TestNamespaceSep.pm t/lib/TestWrapper.pm t/regressions/01-is_subtype_of.t t/zzz-check-breaks.t xt/author/00-compile.t xt/author/clean-namespaces.t xt/author/eol.t xt/author/kwalitee.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/release/changes_has_content.t xt/release/cpan-changes.t xt/release/distmeta.t xt/release/minimum-version.t xt/release/pod-no404s.t xt/release/pod-syntax.t xt/release/portability.t MooseX-Types-0.46/META.json000644 000766 000024 00000130375 12563756310 015674 0ustar00etherstaff000000 000000 { "abstract" : "Organise your Moose types in libraries", "author" : [ "Robert \"phaylon\" Sedlacek " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.039, CPAN::Meta::Converter version 2.150005", "keywords" : [ "moose", "types", "classes", "objects", "constraints", "declare", "libraries" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooseX-Types", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "Module::Build::Tiny" : "0.007", "perl" : "5.008" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.102" }, "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AuthorityFromModule" : "0.002", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "0", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::GenerateFile::ShareDir" : "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.004", "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" : "0", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker::Fallback" : "0.012", "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::ModuleBuildTiny::Fallback" : "0.018", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::PodSyntaxTests" : "0", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.004", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.038", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::SurgicalPodWeaver" : "0", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.008", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::CheckBreaks" : "0", "Dist::Zilla::Plugin::Test::CleanNamespaces" : "0.006", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::EOL" : "0.17", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.06", "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000003", "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.002", "Dist::Zilla::Plugin::Test::PodSpelling" : "2.006001", "Dist::Zilla::Plugin::Test::Portability" : "0", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.019", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.094", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::Moose" : "0.02", "Pod::Wordlist" : "0", "Software::License::Perl_5" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.04", "Test::Pod::No404s" : "0", "Test::Requires" : "0", "Test::Spelling" : "0.12", "Test::Warnings" : "0", "blib" : "1.01" } }, "runtime" : { "requires" : { "Carp" : "0", "Carp::Clan" : "6.00", "Exporter" : "0", "Module::Runtime" : "0", "Moose" : "1.06", "Moose::Exporter" : "0", "Moose::Meta::TypeConstraint::Union" : "0", "Moose::Util::TypeConstraints" : "0", "Scalar::Util" : "1.19", "Sub::Exporter" : "0", "Sub::Exporter::ForMethods" : "0.100052", "Sub::Name" : "0", "base" : "0", "namespace::autoclean" : "0.16", "overload" : "0", "perl" : "5.008", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Moose::Role" : "0", "Test::Fatal" : "0", "Test::More" : "0.88", "Test::Requires" : "0", "if" : "0", "lib" : "0", "perl" : "5.008" } } }, "provides" : { "MooseX::Types" : { "file" : "lib/MooseX/Types.pm", "version" : "0.46" }, "MooseX::Types::Base" : { "file" : "lib/MooseX/Types/Base.pm", "version" : "0.46" }, "MooseX::Types::CheckedUtilExports" : { "file" : "lib/MooseX/Types/CheckedUtilExports.pm", "version" : "0.46" }, "MooseX::Types::Combine" : { "file" : "lib/MooseX/Types/Combine.pm", "version" : "0.46" }, "MooseX::Types::Moose" : { "file" : "lib/MooseX/Types/Moose.pm", "version" : "0.46" }, "MooseX::Types::TypeDecorator" : { "file" : "lib/MooseX/Types/TypeDecorator.pm", "version" : "0.46" }, "MooseX::Types::UndefinedType" : { "file" : "lib/MooseX/Types/UndefinedType.pm", "version" : "0.46" }, "MooseX::Types::Util" : { "file" : "lib/MooseX/Types/Util.pm", "version" : "0.46" }, "MooseX::Types::Wrapper" : { "file" : "lib/MooseX/Types/Wrapper.pm", "version" : "0.46" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-MooseX-Types@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types" }, "homepage" : "https://github.com/moose/MooseX-Types", "repository" : { "type" : "git", "url" : "https://github.com/moose/MooseX-Types.git", "web" : "https://github.com/moose/MooseX-Types" }, "x_IRC" : "irc://irc.perl.org/#moose", "x_MailingList" : "http://lists.perl.org/list/moose.html" }, "version" : "0.46", "x_Dist_Zilla" : { "perl" : { "version" : "5.023001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/bundle_plugins", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/RewriteVersion::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.045" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : "1", "check_all_prereqs" : "1", "modules" : [], "phase" : "release", "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.045" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/ExtraTestFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "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.036" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::ShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::ShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@Author::ETHER/InstallGuide", "version" : "1.200006" }, { "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" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.054" }, { "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", "@Author::ETHER/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" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", "@Author::ETHER/ExtraTestFiles" ], "trailing_whitespace" : "1" } }, "name" : "@Author::ETHER/Test::EOL", "version" : "0.18" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.006009" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.002" }, { "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.11" }, { "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.021" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "name" : "@Author::ETHER/Test::Portability", "version" : "2.000006" }, { "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.006" }, { "class" : "Dist::Zilla::Plugin::SurgicalPodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@Author::ETHER" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::ETHER/SingleEncoding", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/List", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/Verbatim", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/header", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::ETHER/Name", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::ETHER/Version", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/prelude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::ETHER/Leftovers", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/postlude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::ETHER/Authors", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::ETHER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::ETHER/Legal", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/footer", "version" : "4.012" } ] } }, "name" : "@Author::ETHER/SurgicalPodWeaver", "version" : "0.0023" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.150250" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::AuthorityFromModule", "config" : { "Dist::Zilla::Plugin::AuthorityFromModule" : { "module" : "MooseX::Types" }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000027", "version" : "0.003" } }, "name" : "@Author::ETHER/AuthorityFromModule", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.039" } ] }, "Dist::Zilla::Role::MetaProvider::Provider" : { "inherit_missing" : "0", "inherit_version" : "0", "meta_noindex" : "1" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.003001" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [ "moose", "types", "classes", "objects", "constraints", "declare", "libraries" ] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [ "." ] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle_version", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/pod_weaving", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::MakeMaker::Fallback", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/MakeMaker::Fallback", "version" : "0.019" }, { "class" : "Dist::Zilla::Plugin::ModuleBuildTiny::Fallback", "config" : { "Dist::Zilla::Plugin::ModuleBuildTiny::Fallback" : { "mb_version" : "0.28", "plugins" : [ { "class" : "Dist::Zilla::Plugin::ModuleBuild", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "ModuleBuild, via ModuleBuildTiny::Fallback", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::ModuleBuildTiny", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "ModuleBuildTiny, via ModuleBuildTiny::Fallback", "version" : "0.013" } ] }, "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/ModuleBuildTiny::Fallback", "version" : "0.018" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000027", "version" : "0.003" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ] } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.042" }, { "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" : 1, "quiet" : 1 } }, "name" : "@Author::ETHER/.latest", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.2.0" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "5.039" }, { "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" : { "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::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", "LICENSE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/release snapshot", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.46", "tag_format" : "v%v", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/Git::Tag", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.41" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/BumpVersionAfterRelease::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/NextRelease", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/post-release commit", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ] } }, "name" : "@Author::ETHER/install release", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1 } }, "name" : "@Author::ETHER/release complete", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "RuntimeRequires", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::Test::CheckBreaks", "config" : { "Dist::Zilla::Plugin::Test::CheckBreaks" : { "conflicts_module" : "Moose::Conflicts" }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000027", "version" : "0.003" } }, "name" : "Test::CheckBreaks", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.039" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.013" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.039" } }, "x_authority" : "cpan:PHAYLON", "x_authority_from_module" : "MooseX::Types", "x_contributors" : [ "Karen Etheridge ", "Dave Rolsky ", "John Napiorkowski ", "Robert 'phaylon' Sedlacek ", "Rafael Kitover ", "Florian Ragwitz ", "Matt S Trout ", "Tomas Doran (t0m) ", "Jesse Luehrs ", "Hans Dieter Pearcey ", "Graham Knop ", "Paul Fenwick ", "Kent Fredric ", "Justin Hunter " ], "x_permissions_from_module" : "MooseX::Types", "x_static_install" : 1 } MooseX-Types-0.46/META.yml000644 000766 000024 00000063450 12563756310 015523 0ustar00etherstaff000000 000000 --- abstract: 'Organise your Moose types in libraries' author: - 'Robert "phaylon" Sedlacek ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Moose::Role: '0' Test::Fatal: '0' Test::More: '0.88' Test::Requires: '0' if: '0' lib: '0' perl: '5.008' configure_requires: Module::Build::Tiny: '0.007' perl: '5.008' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.039, CPAN::Meta::Converter version 2.150005' keywords: - moose - types - classes - objects - constraints - declare - libraries license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooseX-Types no_index: directory: - t - xt provides: MooseX::Types: file: lib/MooseX/Types.pm version: '0.46' MooseX::Types::Base: file: lib/MooseX/Types/Base.pm version: '0.46' MooseX::Types::CheckedUtilExports: file: lib/MooseX/Types/CheckedUtilExports.pm version: '0.46' MooseX::Types::Combine: file: lib/MooseX/Types/Combine.pm version: '0.46' MooseX::Types::Moose: file: lib/MooseX/Types/Moose.pm version: '0.46' MooseX::Types::TypeDecorator: file: lib/MooseX/Types/TypeDecorator.pm version: '0.46' MooseX::Types::UndefinedType: file: lib/MooseX/Types/UndefinedType.pm version: '0.46' MooseX::Types::Util: file: lib/MooseX/Types/Util.pm version: '0.46' MooseX::Types::Wrapper: file: lib/MooseX/Types/Wrapper.pm version: '0.46' requires: Carp: '0' Carp::Clan: '6.00' Exporter: '0' Module::Runtime: '0' Moose: '1.06' Moose::Exporter: '0' Moose::Meta::TypeConstraint::Union: '0' Moose::Util::TypeConstraints: '0' Scalar::Util: '1.19' Sub::Exporter: '0' Sub::Exporter::ForMethods: '0.100052' Sub::Name: '0' base: '0' namespace::autoclean: '0.16' overload: '0' perl: '5.008' strict: '0' warnings: '0' 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-Types homepage: https://github.com/moose/MooseX-Types repository: https://github.com/moose/MooseX-Types.git version: '0.46' x_Dist_Zilla: perl: version: '5.023001' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/bundle_plugins' version: '5.039' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/RewriteVersion::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build skip: [] name: '@Author::ETHER/stale modules, build' version: '0.045' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: '1' check_all_prereqs: '1' modules: [] phase: release skip: [] name: '@Author::ETHER/stale modules, release' version: '0.045' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '5.039' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/ExtraTestFiles' version: '5.039' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - 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.036' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '5.039' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '5.039' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '5.039' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '5.039' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '5.039' - class: Dist::Zilla::Plugin::GenerateFile::ShareDir config: Dist::Zilla::Plugin::GenerateFile::ShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING name: '@Author::ETHER/generate CONTRIBUTING' version: '0.006' - class: Dist::Zilla::Plugin::InstallGuide name: '@Author::ETHER/InstallGuide' version: '1.200006' - 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: [] name: '@Author::ETHER/Test::Compile' version: '2.054' - 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' - '@Author::ETHER/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: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - '@Author::ETHER/ExtraTestFiles' trailing_whitespace: '1' name: '@Author::ETHER/Test::EOL' version: '0.18' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '5.039' - class: Dist::Zilla::Plugin::Test::CPAN::Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.009' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.008' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@Author::ETHER/Test::MinimumVersion' version: '2.000006' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '5.039' - class: Dist::Zilla::Plugin::Test::PodSpelling name: '@Author::ETHER/Test::PodSpelling' version: '2.006009' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.002' - 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.11' - 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.021' - class: Dist::Zilla::Plugin::Test::Portability name: '@Author::ETHER/Test::Portability' version: '2.000006' - 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.006' - class: Dist::Zilla::Plugin::SurgicalPodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@Author::ETHER' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.012' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.012' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::ETHER/SingleEncoding' version: '4.012' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/List' version: '4.012' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/Verbatim' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/header' version: '4.012' - class: Pod::Weaver::Section::Name name: '@Author::ETHER/Name' version: '4.012' - class: Pod::Weaver::Section::Version name: '@Author::ETHER/Version' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/prelude' version: '4.012' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.012' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.012' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.012' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.012' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.012' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.012' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.012' - class: Pod::Weaver::Section::Leftovers name: '@Author::ETHER/Leftovers' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/postlude' version: '4.012' - class: Pod::Weaver::Section::Authors name: '@Author::ETHER/Authors' version: '4.012' - class: Pod::Weaver::Section::Contributors name: '@Author::ETHER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::ETHER/Legal' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/footer' version: '4.012' name: '@Author::ETHER/SurgicalPodWeaver' version: '0.0023' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.150250' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.54' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::AuthorityFromModule config: Dist::Zilla::Plugin::AuthorityFromModule: module: MooseX::Types Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000027' version: '0.003' name: '@Author::ETHER/AuthorityFromModule' version: '0.006' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '5.039' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.039' Dist::Zilla::Role::MetaProvider::Provider: inherit_missing: '0' inherit_version: '0' meta_noindex: '1' name: '@Author::ETHER/MetaProvides::Package' version: '2.003001' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '5.039' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: - moose - types - classes - objects - constraints - declare - libraries name: '@Author::ETHER/Keywords' version: '0.006' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: include_authors: 0 include_releaser: 1 order_by: commits paths: - . name: '@Author::ETHER/Git::Contributors' version: '0.014' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '5.039' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.005' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle_version' version: '5.039' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/pod_weaving' version: '5.039' - class: Dist::Zilla::Plugin::MakeMaker::Fallback config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/MakeMaker::Fallback' version: '0.019' - class: Dist::Zilla::Plugin::ModuleBuildTiny::Fallback config: Dist::Zilla::Plugin::ModuleBuildTiny::Fallback: mb_version: '0.28' plugins: - class: Dist::Zilla::Plugin::ModuleBuild config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: 'ModuleBuild, via ModuleBuildTiny::Fallback' version: '5.039' - class: Dist::Zilla::Plugin::ModuleBuildTiny config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: 'ModuleBuildTiny, via ModuleBuildTiny::Fallback' version: '0.013' Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/ModuleBuildTiny::Fallback' version: '0.018' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.008' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.028' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000027' version: '0.003' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" name: '@Author::ETHER/.ackrc' version: '0.042' - 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: 1 quiet: 1 name: '@Author::ETHER/.latest' version: '0.042' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/initial check' version: '2.036' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.013' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.013' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.2.0 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.016' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '5.039' - 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: repo_root: . name: '@Author::ETHER/after tests' version: '2.036' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.008' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '5.039' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - Changes - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::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 - LICENSE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/release snapshot' version: '2.036' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.46 tag_format: v%v tag_message: v%v%t Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/Git::Tag' version: '2.036' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.41' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/BumpVersionAfterRelease::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/NextRelease' version: '5.039' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/post-release commit' version: '2.036' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::Push' version: '2.036' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED name: '@Author::ETHER/install release' version: '0.042' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 name: '@Author::ETHER/release complete' version: '0.042' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '5.039' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: RuntimeRequires version: '5.039' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '5.039' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '5.039' - class: Dist::Zilla::Plugin::Test::CheckBreaks config: Dist::Zilla::Plugin::Test::CheckBreaks: conflicts_module: Moose::Conflicts Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000027' version: '0.003' name: Test::CheckBreaks version: '0.012' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '5.039' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '5.039' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.013' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '5.039' x_authority: cpan:PHAYLON x_authority_from_module: MooseX::Types x_contributors: - 'Karen Etheridge ' - 'Dave Rolsky ' - 'John Napiorkowski ' - "Robert 'phaylon' Sedlacek " - 'Rafael Kitover ' - 'Florian Ragwitz ' - 'Matt S Trout ' - 'Tomas Doran (t0m) ' - 'Jesse Luehrs ' - 'Hans Dieter Pearcey ' - 'Graham Knop ' - 'Paul Fenwick ' - 'Kent Fredric ' - 'Justin Hunter ' x_permissions_from_module: MooseX::Types x_static_install: 1 MooseX-Types-0.46/README000644 000766 000024 00000000603 12563756310 015121 0ustar00etherstaff000000 000000 This archive contains the distribution MooseX-Types, version 0.46: Organise your Moose types in libraries This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v5.039. MooseX-Types-0.46/t/000700 000766 000024 00000000000 12563756310 014473 5ustar00etherstaff000000 000000 MooseX-Types-0.46/xt/000700 000766 000024 00000000000 12563756310 014663 5ustar00etherstaff000000 000000 MooseX-Types-0.46/xt/author/000700 000766 000024 00000000000 12563756310 016165 5ustar00etherstaff000000 000000 MooseX-Types-0.46/xt/release/000700 000766 000024 00000000000 12563756310 016303 5ustar00etherstaff000000 000000 MooseX-Types-0.46/xt/release/changes_has_content.t000644 000766 000024 00000002010 12563756310 022470 0ustar00etherstaff000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.46'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } MooseX-Types-0.46/xt/release/cpan-changes.t000644 000766 000024 00000000263 12563756310 021032 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); MooseX-Types-0.46/xt/release/distmeta.t000644 000766 000024 00000000172 12563756310 020314 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); MooseX-Types-0.46/xt/release/minimum-version.t000644 000766 000024 00000000271 12563756310 021640 0ustar00etherstaff000000 000000 #!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.008003} ); MooseX-Types-0.46/xt/release/pod-no404s.t000644 000766 000024 00000000527 12563756310 020315 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-Types-0.46/xt/release/pod-syntax.t000644 000766 000024 00000000220 12563756310 020602 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); MooseX-Types-0.46/xt/release/portability.t000644 000766 000024 00000000277 12563756310 021052 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); MooseX-Types-0.46/xt/author/00-compile.t000644 000766 000024 00000002651 12563756310 020235 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More 0.94; plan tests => 10; my @module_files = ( 'MooseX/Types.pm', 'MooseX/Types/Base.pm', 'MooseX/Types/CheckedUtilExports.pm', 'MooseX/Types/Combine.pm', 'MooseX/Types/Moose.pm', 'MooseX/Types/TypeDecorator.pm', 'MooseX/Types/UndefinedType.pm', 'MooseX/Types/Util.pm', 'MooseX/Types/Wrapper.pm' ); # no fake home requested my $inc_switch = -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; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-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-Types-0.46/xt/author/clean-namespaces.t000644 000766 000024 00000000361 12563756310 021563 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-Types-0.46/xt/author/eol.t000644 000766 000024 00000003512 12563756310 017144 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/MooseX/Types.pm', 'lib/MooseX/Types/Base.pm', 'lib/MooseX/Types/CheckedUtilExports.pm', 'lib/MooseX/Types/Combine.pm', 'lib/MooseX/Types/Moose.pm', 'lib/MooseX/Types/TypeDecorator.pm', 'lib/MooseX/Types/UndefinedType.pm', 'lib/MooseX/Types/Util.pm', 'lib/MooseX/Types/Wrapper.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/10_moose-types.t', 't/11_library-definition.t', 't/12_wrapper-definition.t', 't/13_typedecorator.t', 't/14_compatibility-sub-exporter.t', 't/15_recursion.t', 't/16_introspection.t', 't/17_syntax_errors.t', 't/18_combined_libs.t', 't/19_typelib_with_role.t', 't/20_union_with_string_type.t', 't/21_coerce_parameterized_types.t', 't/22_class_type.t', 't/23_any_subtype.t', 't/24_class_can_isa.t', 't/25-fully-qualified.t', 't/lib/Combined.pm', 't/lib/DecoratorLibrary.pm', 't/lib/Empty.pm', 't/lib/SubExporterCompatibility.pm', 't/lib/TestLibrary.pm', 't/lib/TestLibrary2.pm', 't/lib/TestNamespaceSep.pm', 't/lib/TestWrapper.pm', 't/regressions/01-is_subtype_of.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-spell.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/minimum-version.t', 'xt/release/pod-no404s.t', 'xt/release/pod-syntax.t', 'xt/release/portability.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; MooseX-Types-0.46/xt/author/kwalitee.t000644 000766 000024 00000000275 12563756310 020175 0ustar00etherstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.11 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; MooseX-Types-0.46/xt/author/mojibake.t000644 000766 000024 00000000151 12563756310 020142 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); MooseX-Types-0.46/xt/author/no-tabs.t000644 000766 000024 00000003460 12563756310 017732 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/Types.pm', 'lib/MooseX/Types/Base.pm', 'lib/MooseX/Types/CheckedUtilExports.pm', 'lib/MooseX/Types/Combine.pm', 'lib/MooseX/Types/Moose.pm', 'lib/MooseX/Types/TypeDecorator.pm', 'lib/MooseX/Types/UndefinedType.pm', 'lib/MooseX/Types/Util.pm', 'lib/MooseX/Types/Wrapper.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/10_moose-types.t', 't/11_library-definition.t', 't/12_wrapper-definition.t', 't/13_typedecorator.t', 't/14_compatibility-sub-exporter.t', 't/15_recursion.t', 't/16_introspection.t', 't/17_syntax_errors.t', 't/18_combined_libs.t', 't/19_typelib_with_role.t', 't/20_union_with_string_type.t', 't/21_coerce_parameterized_types.t', 't/22_class_type.t', 't/23_any_subtype.t', 't/24_class_can_isa.t', 't/25-fully-qualified.t', 't/lib/Combined.pm', 't/lib/DecoratorLibrary.pm', 't/lib/Empty.pm', 't/lib/SubExporterCompatibility.pm', 't/lib/TestLibrary.pm', 't/lib/TestLibrary2.pm', 't/lib/TestNamespaceSep.pm', 't/lib/TestWrapper.pm', 't/regressions/01-is_subtype_of.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-spell.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/minimum-version.t', 'xt/release/pod-no404s.t', 'xt/release/pod-syntax.t', 'xt/release/portability.t' ); notabs_ok($_) foreach @files; done_testing; MooseX-Types-0.46/xt/author/pod-coverage.t000600 000766 000024 00000001545 12563756310 020734 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More; use Test::Requires { 'Test::Pod::Coverage' => '1.04', 'Pod::Coverage::Moose' => '0.02', }; my %skip = map { $_ => 1 } qw( MooseX::Types::CheckedUtilExports ); my @modules = grep { !$skip{$_} } all_modules(); my %trustme; for my $module ( sort @modules ) { my $trustme = []; if ( $trustme{$module} ) { if ( ref $trustme{$module} eq 'ARRAY' ) { my $methods = join '|', @{ $trustme{$module} }; $trustme = [qr/^(?:$methods)$/]; } else { $trustme = [ $trustme{$module} ]; } } push @{$trustme}, qr/^BUILD$/; pod_coverage_ok( $module, { coverage_class => 'Pod::Coverage::Moose', trustme => $trustme, }, "Pod coverage for $module" ); } done_testing(); MooseX-Types-0.46/xt/author/pod-spell.t000644 000766 000024 00000001332 12563756310 020262 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006009 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ SUBTYPES coercions subtypes subtyping instantiation TODO Organise parameterized parameterize subtype Robert phaylon Sedlacek rs Karen Etheridge ether Dave Rolsky autarch John Napiorkowski jjnapiork Rafael Kitover rkitover Florian Ragwitz rafl Matt Trout mst Tomas Doran t0m bobtfish Jesse Luehrs doy Hans Dieter Pearcey hdp Graham Knop haarg Paul Fenwick pjf Kent Fredric kentfredric Justin Hunter justin lib MooseX Types Base CheckedUtilExports Combine Moose TypeDecorator UndefinedType Util Wrapper MooseX-Types-0.46/t/00-report-prereqs.dd000644 000766 000024 00000023451 12563756310 020232 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'Module::Build::Tiny' => '0.007', 'perl' => '5.008' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.102' }, 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '1.009', 'Dist::Zilla::Plugin::AuthorityFromModule' => '0.002', 'Dist::Zilla::Plugin::AutoMetaResources' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '0', 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', 'Dist::Zilla::Plugin::CheckIssues' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0', 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', 'Dist::Zilla::Plugin::GenerateFile::ShareDir' => '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.004', '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' => '0', 'Dist::Zilla::Plugin::Keywords' => '0.004', 'Dist::Zilla::Plugin::License' => '5.038', 'Dist::Zilla::Plugin::MakeMaker::Fallback' => '0.012', '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::ModuleBuildTiny::Fallback' => '0.018', 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', 'Dist::Zilla::Plugin::NextRelease' => '5.033', 'Dist::Zilla::Plugin::PodSyntaxTests' => '0', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::Readme' => '0', 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.004', 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.038', 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', 'Dist::Zilla::Plugin::StaticInstall' => '0.005', 'Dist::Zilla::Plugin::SurgicalPodWeaver' => '0', 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.008', 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', 'Dist::Zilla::Plugin::Test::CheckBreaks' => '0', 'Dist::Zilla::Plugin::Test::CleanNamespaces' => '0.006', 'Dist::Zilla::Plugin::Test::Compile' => '2.039', 'Dist::Zilla::Plugin::Test::EOL' => '0.17', 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.06', 'Dist::Zilla::Plugin::Test::MinimumVersion' => '2.000003', 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.002', 'Dist::Zilla::Plugin::Test::PodSpelling' => '2.006001', 'Dist::Zilla::Plugin::Test::Portability' => '0', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.019', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.094', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::Moose' => '0.02', 'Pod::Wordlist' => '0', 'Software::License::Perl_5' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CleanNamespaces' => '0.15', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.04', 'Test::Pod::No404s' => '0', 'Test::Requires' => '0', 'Test::Spelling' => '0.12', 'Test::Warnings' => '0', 'blib' => '1.01' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Carp::Clan' => '6.00', 'Exporter' => '0', 'Module::Runtime' => '0', 'Moose' => '1.06', 'Moose::Exporter' => '0', 'Moose::Meta::TypeConstraint::Union' => '0', 'Moose::Util::TypeConstraints' => '0', 'Scalar::Util' => '1.19', 'Sub::Exporter' => '0', 'Sub::Exporter::ForMethods' => '0.100052', 'Sub::Name' => '0', 'base' => '0', 'namespace::autoclean' => '0.16', 'overload' => '0', 'perl' => '5.008', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Moose::Role' => '0', 'Test::Fatal' => '0', 'Test::More' => '0.88', 'Test::Requires' => '0', 'if' => '0', 'lib' => '0', 'perl' => '5.008' } } }; $x; }MooseX-Types-0.46/t/00-report-prereqs.t000644 000766 000024 00000012757 12563756310 020115 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021 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( Dist::CheckConflicts ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do 't/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; if ( $source && $HAS_CPAN_META ) { if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } } else { $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: MooseX-Types-0.46/t/10_moose-types.t000600 000766 000024 00000000720 12563756310 017445 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use MooseX::Types::Moose ':all', 'Bool'; my @types = MooseX::Types::Moose->type_names; for my $t (@types) { ok my $code = __PACKAGE__->can($t), "$t() was exported"; if ($code) { is $code->(), $t, "$t() returns '$t'"; } else { diag "Skipping $t() call test"; } ok __PACKAGE__->can("is_$t"), "is_$t() was exported"; } done_testing; MooseX-Types-0.46/t/11_library-definition.t000600 000766 000024 00000003464 12563756310 020764 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use lib 't/lib'; use TestLibrary qw( NonEmptyStr IntArrayRef ), Foo2Alias => { -as => 'Foo' }; my @tests = ( [ 'NonEmptyStr', 12, "12", [], "foobar", "" ], [ 'IntArrayRef', 12, [12], {}, [17, 23], {} ], ); # new array ref so we can safely shift from it for my $data (map { [@$_] } @tests) { my $type = shift @$data; # Type name export { ok my $code = __PACKAGE__->can($type), "$type() was exported"; is $code->(), "TestLibrary::$type", "$type() returned correct type name"; } # coercion handler export { my ($coerce, $coercion_result, $cannot_coerce) = map { shift @$data } 1 .. 3; ok my $code = __PACKAGE__->can("to_$type"), "to_$type() coercion was exported"; is_deeply scalar $code->($coerce), $coercion_result, "to_$type() coercion works"; ok ! $code->($cannot_coerce), "to_$type() returns false on invalid value"; } # type test handler { my ($valid, $invalid) = map { shift @$data } 1 .. 2; ok my $code = __PACKAGE__->can("is_$type"), "is_$type() check was exported"; ok $code->($valid), "is_$type() check true on valid value"; ok ! $code->($invalid), "is_$type() check false on invalid value"; } } # aliasing test ok my $code = __PACKAGE__->can('Foo'), 'aliased type exported under correct symbol'; is $code->(), 'TestLibrary::Foo2Alias', 'aliased type returns unaliased type name'; # coercion not available ok ! __PACKAGE__->can('to_TwentyThree'), "type without coercion doesn't have to_* helper"; eval { require TestNamespaceSep }; ok $@, q(trying to declare a type with '::' in it croaks); like $@, qr/Foo::Bar/, q(error message contains type name); done_testing; MooseX-Types-0.46/t/12_wrapper-definition.t000600 000766 000024 00000003332 12563756310 020773 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use lib 't/lib'; use Moose::Util::TypeConstraints qw( coerce from via ); BEGIN { coerce 'Str', from 'Int', via { "$_" } } use TestWrapper TestLibrary => [qw( NonEmptyStr IntArrayRef )], Moose => [qw( Str Int )]; my @tests = ( [ 'NonEmptyStr', 'TestLibrary::NonEmptyStr', 12, "12", [], "foobar", "" ], [ 'IntArrayRef', 'TestLibrary::IntArrayRef', 12, [12], {}, [17, 23], {} ], [ 'Str', 'Str', 12, "12", [], "foo", [777] ], ); # new array ref so we can safely shift from it for my $data (map { [@$_] } @tests) { my $type = shift @$data; my $full = shift @$data; # Type name export { ok my $code = __PACKAGE__->can($type), "$type() was exported"; is $code->(), $full, "$type() returned correct type name"; } # coercion handler export { my ($coerce, $coercion_result, $cannot_coerce) = map { shift @$data } 1 .. 3; ok my $code = __PACKAGE__->can("to_$type"), "to_$type() coercion was exported"; is_deeply scalar $code->($coerce), $coercion_result, "to_$type() coercion works"; eval { $code->($cannot_coerce) }; is $@, "coercion returned undef\n", "to_$type() died on invalid value"; } # type test handler { my ($valid, $invalid) = map { shift @$data } 1 .. 2; ok my $code = __PACKAGE__->can("is_$type"), "is_$type() check was exported"; ok $code->($valid), "is_$type() check true on valid value"; ok ! $code->($invalid), "is_$type() check false on invalid value"; is ref($code->()), 'CODE', "is_$type() returns test closure without args"; } } done_testing; MooseX-Types-0.46/t/13_typedecorator.t000600 000766 000024 00000021147 12563756310 020056 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; use lib 't/lib'; { package Test::MooseX::TypeLibrary::TypeDecorator; use Moose; use MooseX::Types::Moose qw( Int Str ArrayRef HashRef Object ); use DecoratorLibrary qw( MyArrayRefBase MyArrayRefInt01 MyArrayRefInt02 StrOrArrayRef AtLeastOneInt Jobs SubOfMyArrayRefInt01 WierdIntegersArrayRef1 WierdIntegersArrayRef2 ); has 'arrayrefbase' => (is=>'rw', isa=>MyArrayRefBase, coerce=>1); has 'arrayrefint01' => (is=>'rw', isa=>MyArrayRefInt01, coerce=>1); has 'arrayrefint02' => (is=>'rw', isa=>MyArrayRefInt02, coerce=>1); has 'arrayrefint03' => (is=>'rw', isa=>MyArrayRefBase[Int]); has 'StrOrArrayRef_attr' => (is=>'rw', isa=>StrOrArrayRef); has 'AtLeastOneInt_attr' => (is=>'rw', isa=>AtLeastOneInt); has 'pipeoverloading' => (is=>'rw', isa=>Int|Str); has 'deep' => (is=>'rw', isa=>ArrayRef[ArrayRef[HashRef[Int]]] ); has 'deep2' => (is=>'rw', isa=>ArrayRef[Int|ArrayRef[HashRef[Int|Object]]] ); has 'enum' => (is=>'rw', isa=>Jobs); has 'SubOfMyArrayRefInt01_attr' => (is=>'rw', isa=>SubOfMyArrayRefInt01); has 'WierdIntegersArrayRef1_attr' => (is=>'rw', isa=>WierdIntegersArrayRef1); has 'WierdIntegersArrayRef2_attr' => (is=>'rw', isa=>WierdIntegersArrayRef2); } ## Make sure we have a 'create object sanity check' ok my $type = Test::MooseX::TypeLibrary::TypeDecorator->new(), => 'Created some sort of object'; isa_ok $type, 'Test::MooseX::TypeLibrary::TypeDecorator' => "Yes, it's the correct kind of object"; ## test arrayrefbase normal and coercion ok $type->arrayrefbase([qw(a b c d e)]) => 'Assigned arrayrefbase qw(a b c d e)'; is_deeply $type->arrayrefbase, [qw(a b c d e)], => 'Assignment is correct'; ok $type->arrayrefbase('d,e,f') => 'Assignment arrayrefbase d,e,f to test coercion'; is_deeply $type->arrayrefbase, [qw(d e f)], => 'Assignment and coercion is correct'; ## test arrayrefint01 normal and coercion ok $type->arrayrefint01([qw(1 2 3)]) => 'Assignment arrayrefint01 qw(1 2 3)'; is_deeply $type->arrayrefint01, [qw(1 2 3)], => 'Assignment is correct'; ok $type->arrayrefint01('4.5.6') => 'Assigned arrayrefint01 4.5.6 to test coercion from Str'; is_deeply $type->arrayrefint01, [qw(4 5 6)], => 'Assignment and coercion is correct'; ok $type->arrayrefint01({a=>7,b=>8}) => 'Assigned arrayrefint01 {a=>7,b=>8} to test coercion from HashRef'; is_deeply $type->arrayrefint01, [qw(7 8)], => 'Assignment and coercion is correct'; like exception { $type->arrayrefint01([qw(a b c)]) }, qr/Attribute \(arrayrefint01\) does not pass the type constraint/ => 'Dies when values are strings'; ## test arrayrefint02 normal and coercion ok $type->arrayrefint02([qw(1 2 3)]) => 'Assigned arrayrefint02 qw(1 2 3)'; is_deeply $type->arrayrefint02, [qw(1 2 3)], => 'Assignment is correct'; ok $type->arrayrefint02('4:5:6') => 'Assigned arrayrefint02 4:5:6 to test coercion from Str'; is_deeply $type->arrayrefint02, [qw(4 5 6)], => 'Assignment and coercion is correct'; ok $type->arrayrefint02({a=>7,b=>8}) => 'Assigned arrayrefint02 {a=>7,b=>8} to test coercion from HashRef'; is_deeply $type->arrayrefint02, [qw(7 8)], => 'Assignment and coercion is correct'; ok $type->arrayrefint02({a=>'AA',b=>'BBB', c=>'CCCCCCC'}) => "Assigned arrayrefint02 {a=>'AA',b=>'BBB', c=>'CCCCCCC'} to test coercion from HashRef"; is_deeply $type->arrayrefint02, [qw(2 3 7)], => 'Assignment and coercion is correct'; ok $type->arrayrefint02({a=>[1,2],b=>[3,4]}) => "Assigned arrayrefint02 {a=>[1,2],b=>[3,4]} to test coercion from HashRef"; is_deeply $type->arrayrefint02, [qw(1 2 3 4)], => 'Assignment and coercion is correct'; # test arrayrefint03 ok $type->arrayrefint03([qw(11 12 13)]) => 'Assigned arrayrefint01 qw(11 12 13)'; is_deeply $type->arrayrefint03, [qw(11 12 13)], => 'Assignment is correct'; like exception { $type->arrayrefint03([qw(a b c)]) }, qr/Attribute \(arrayrefint03\) does not pass the type constraint/ => 'Dies when values are strings'; # TEST StrOrArrayRef ok $type->StrOrArrayRef_attr('string') => 'String part of union is good'; ok $type->StrOrArrayRef_attr([1,2,3]) => 'arrayref part of union is good'; like exception { $type->StrOrArrayRef_attr({a=>111}); }, qr/Attribute \(StrOrArrayRef_attr\) does not pass the type constraint/ => 'Correctly failed to use a hashref'; # Test AtLeastOneInt ok $type->AtLeastOneInt_attr([1,2]), => 'Good assignment'; is_deeply $type->AtLeastOneInt_attr, [1,2] => "Got expected values."; like exception { $type->AtLeastOneInt_attr([]); }, qr/Attribute \(AtLeastOneInt_attr\) does not pass the type constraint/ => 'properly fails to assign as []'; like exception { $type->AtLeastOneInt_attr(['a','b']); }, qr/Attribute \(AtLeastOneInt_attr\) does not pass the type constraint/ => 'properly fails arrayref of strings'; ## Test pipeoverloading ok $type->pipeoverloading(1) => 'Integer for union test accepted'; ok $type->pipeoverloading('a') => 'String for union test accepted'; like exception { $type->pipeoverloading({a=>1,b=>2}); }, qr/Validation failed for 'Int|Str'/ => 'Union test corrected fails a HashRef'; ## test deep (ArrayRef[ArrayRef[HashRef[Int]]]) ok $type->deep([[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]]) => 'Assigned deep to [[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]]'; is_deeply $type->deep, [[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]], => 'Assignment is correct'; like exception { $type->deep({a=>1,b=>2}); }, qr/Attribute \(deep\) does not pass the type constraint/ => 'Deep Constraints properly fail'; # test deep2 (ArrayRef[Int|ArrayRef[HashRef[Int|Object]]]) ok $type->deep2([[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]]) => 'Assigned deep2 to [[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]]'; is_deeply $type->deep2, [[{a=>1,b=>2},{c=>3,d=>4}],[{e=>5}]], => 'Assignment is correct'; like exception { $type->deep2({a=>1,b=>2}); }, qr/Attribute \(deep2\) does not pass the type constraint/ => 'Deep Constraints properly fail'; like exception { $type->deep2([[{a=>1,b=>2},{c=>3,d=>'noway'}],[{e=>5}]]); }, qr/Attribute \(deep2\) does not pass the type constraint/ => 'Deep Constraints properly fail'; ok $type->deep2([[{a=>1,b=>2},{c=>3,d=>$type}],[{e=>5}]]) => 'Assigned deep2 to [[{a=>1,b=>2},{c=>3,d=>$type}],[{e=>5}]]'; is_deeply $type->deep2, [[{a=>1,b=>2},{c=>3,d=>$type}],[{e=>5}]], => 'Assignment is correct'; ok $type->deep2([1,2,3]) => 'Assigned deep2 to [1,2,3]'; is_deeply $type->deep2, [1,2,3], => 'Assignment is correct'; ## Test jobs ok $type->enum('Programming') => 'Good Assignment of Programming to Enum'; like exception { $type->enum('ddddd'); }, qr/Attribute \(enum\) does not pass the type constraint/ => 'Enum properly fails'; ## Test SubOfMyArrayRefInt01_attr ok $type->SubOfMyArrayRefInt01_attr([15,20,25]) => 'Assigned SubOfMyArrayRefInt01_attr to [15,20,25]'; is_deeply $type->SubOfMyArrayRefInt01_attr, [15,20,25], => 'Assignment is correct'; like exception { $type->SubOfMyArrayRefInt01_attr([15,5,20]); }, qr/Attribute \(SubOfMyArrayRefInt01_attr\) does not pass the type constraint/ => 'SubOfMyArrayRefInt01 Constraints properly fail'; ## test WierdIntegersArrayRef1 ok $type->WierdIntegersArrayRef1_attr([5,10,1000]) => 'Assigned deep2 to [5,10,1000]'; is_deeply $type->WierdIntegersArrayRef1_attr, [5,10,1000], => 'Assignment is correct'; like exception { $type->WierdIntegersArrayRef1_attr({a=>1,b=>2}); }, qr/Attribute \(WierdIntegersArrayRef1_attr\) does not pass the type constraint/ => 'Constraints properly fail'; like exception { $type->WierdIntegersArrayRef1_attr([5,10,1]); }, qr/Attribute \(WierdIntegersArrayRef1_attr\) does not pass the type constraint/ => 'Constraints properly fail'; like exception { $type->WierdIntegersArrayRef1_attr([1]); }, qr/Attribute \(WierdIntegersArrayRef1_attr\) does not pass the type constraint/ => 'Constraints properly fail'; ## test WierdIntegersArrayRef2 ok $type->WierdIntegersArrayRef2_attr([5,10,$type]) => 'Assigned deep2 to [5,10,$type]'; is_deeply $type->WierdIntegersArrayRef2_attr, [5,10,$type], => 'Assignment is correct'; like exception { $type->WierdIntegersArrayRef2_attr({a=>1,b=>2}); }, qr/Attribute \(WierdIntegersArrayRef2_attr\) does not pass the type constraint/ => 'Constraints properly fail'; like exception { $type->WierdIntegersArrayRef2_attr([5,10,1]); }, qr/Attribute \(WierdIntegersArrayRef2_attr\) does not pass the type constraint/ => 'Constraints properly fail'; like exception { $type->WierdIntegersArrayRef2_attr([1]); }, qr/Attribute \(WierdIntegersArrayRef2_attr\) does not pass the type constraint/ => 'Constraints properly fail'; done_testing(); MooseX-Types-0.46/t/14_compatibility-sub-exporter.t000600 000766 000024 00000000542 12563756310 022475 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Requires { 'Sub::Exporter' => '0' }; use lib 't/lib'; use SubExporterCompatibility qw(MyStr something); ok MyStr->check('aaa'), "Correctly passed"; ok !MyStr->check([1]), "Correctly fails"; ok something(), "Found the something method"; done_testing; MooseX-Types-0.46/t/15_recursion.t000600 000766 000024 00000002536 12563756310 017206 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; ## Test case inspired by Stevan Little BEGIN { package MooseX::Types::Test::Recursion; use Moose; use MooseX::Types::Moose qw(Str HashRef); use MooseX::Types -declare => [qw( RecursiveHashRef )]; ## Define a recursive subtype and Cthulhu save us. subtype RecursiveHashRef() => as HashRef[Str() | RecursiveHashRef()]; } { package MooseX::Types::Test::Recursion::TestRunner; BEGIN { use Test::More; ## Grab the newly created test type constraint MooseX::Types::Test::Recursion->import(':all'); }; ok RecursiveHashRef->check({key=>"value"}) => 'properly validated {key=>"value"}'; ok RecursiveHashRef->check({key=>{subkey=>"value"}}) => 'properly validated {key=>{subkey=>"value"}}'; ok RecursiveHashRef->check({ key=>{ subkey=>"value", subkey2=>{ ssubkey1=>"value3", ssubkey2=>"value4" } } }) => 'properly validated deeper recursive values'; ok ! RecursiveHashRef->check({key=>[1,2,3]}) => 'Properly invalidates bad value'; ok ! RecursiveHashRef->check({key=>{subkey=>"value",subkey2=>{ssubkey=>[1,2,3]}}}) => 'Properly invalidates bad value deeply'; } done_testing; MooseX-Types-0.46/t/16_introspection.t000600 000766 000024 00000003743 12563756310 020077 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use MooseX::Types::Util qw( has_available_type_export ); BEGIN { my @Memory; sub store_memory { my ($package, @types) = @_; for my $type (@types) { my $tc = has_available_type_export($package, $type); push @Memory, [$package, $type, $tc ? $tc->name : undef]; } } sub get_memory { \@Memory } } use lib 't/lib'; { package IntrospectionTest; BEGIN { main::store_memory(__PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr )) } use TestLibrary qw( TwentyThree ); BEGIN { main::store_memory(__PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr )) } use TestLibrary NonEmptyStr => { -as => 'MyNonEmptyStr' }; BEGIN { main::store_memory(__PACKAGE__, qw( TwentyThree NonEmptyStr MyNonEmptyStr )) } sub NotAType () { 'just a string' } BEGIN { eval { main::store_memory(__PACKAGE__, qw( NotAType )); }; ::ok(!$@, "introspecting something that's not not a type doesn't blow up"); } BEGIN { no strict 'refs'; delete ${'IntrospectionTest::'}{TwentyThree}; } } BEGIN { main::store_memory( IntrospectionTest => qw( TwentyThree NonEmptyStr MyNonEmptyStr )) } my $P = 'IntrospectionTest'; is_deeply(get_memory, [ [$P, TwentyThree => undef], [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => undef], [$P, TwentyThree => 'TestLibrary::TwentyThree'], [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => undef], [$P, TwentyThree => 'TestLibrary::TwentyThree'], [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'], [$P, NotAType => undef], [$P, TwentyThree => undef], [$P, NonEmptyStr => undef], [$P, MyNonEmptyStr => 'TestLibrary::NonEmptyStr'], ], 'all calls to has_available_type_export returned correct results'); done_testing(); MooseX-Types-0.46/t/17_syntax_errors.t000600 000766 000024 00000003434 12563756310 020117 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; # remove this when CheckedUtilExports croaks instead of carps $SIG{__WARN__} = sub { die @_ }; my $missing_comma_test = q{ package TypeLib1; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Str'; subtype Foo #, as Str, where { /foo/ }, message { 'not a Foo' }; 1; }; eval $missing_comma_test; like $@, qr/forget a comma/, 'missing comma error'; my $string_as_type_test = q{ package TypeLib2; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Str'; subtype Foo => # should be , as Str, where { /foo/ }, message { 'not a Foo' }; 1; }; eval $string_as_type_test; like $@, qr/String found where Type expected/, 'string instead of Type error'; my $fully_qualified_type = q{ package TypeLib3; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Str'; subtype TypeLib3::Foo => as Str, where { /foo/ }, message { 'not a Foo' }; 1; }; eval $fully_qualified_type; is $@, '', "fully qualified type doesn't throw error"; my $class_type = q{ package TypeLib4; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Str'; class_type 'mtfnpy'; coerce mtfnpy => from Str, via { bless \$_, 'mtfnpy' }; 1; }; eval $class_type; is $@, '', "declared class_types don't throw error"; my $role_type = q{ package TypeLib5; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Str'; role_type 'ypnftm'; coerce ypnftm => from Str, via { bless \$_, 'ypnftm' }; 1; }; eval $role_type; is $@, '', "declared role_types don't throw error"; done_testing(); MooseX-Types-0.46/t/18_combined_libs.t000600 000766 000024 00000002363 12563756310 017767 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; use lib 't/lib'; BEGIN { use_ok 'Combined', qw/Foo2Alias MTFNPY NonEmptyStr/ } # test that a type from TestLibrary was exported ok Foo2Alias; # test that a type from TestLibrary2 was exported ok MTFNPY; is NonEmptyStr->name, 'TestLibrary2::NonEmptyStr', 'precedence for conflicting types is correct'; like exception { Combined->import('NonExistentType') }, qr/\Qmain asked for a type (NonExistentType) which is not found in any of the type libraries (TestLibrary TestLibrary2) combined by Combined/, 'asking for a non-existent type from a combined type library gives a useful error'; { package BadCombined; use base 'MooseX::Types::Combine'; ::like ::exception { __PACKAGE__->provide_types_from('Empty') }, qr/Cannot use Empty in a combined type library, it does not provide any types/, 'cannot combine types from a package which is not a type library'; ::like ::exception { __PACKAGE__->provide_types_from('DoesNotExist') }, qr/Can't locate DoesNotExist\.pm/, 'cannot combine types from a package which does not exist'; } is exception { 'Combined'->import(':all') }, undef, ':all syntax works'; done_testing(); MooseX-Types-0.46/t/19_typelib_with_role.t000600 000766 000024 00000000660 12563756310 020721 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package MyRole; use Moose::Role; requires 'foo'; } eval q{ package MyClass; use Moose; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose 'Int'; with 'MyRole'; subtype Foo, as Int; sub foo {} }; ok !$@, 'type export not picked up as a method on role application'; done_testing(); MooseX-Types-0.46/t/20_union_with_string_type.t000600 000766 000024 00000003026 12563756310 021776 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; my $exception; { package TypeLib; use MooseX::Types -declare => [qw( MyUnionType Test1 Test2 Test3 MyStr )]; use MooseX::Types::Moose qw(Str Int Item Object); subtype MyUnionType, as Str|'Int'; subtype MyStr, as Str; eval { coerce MyStr, from Item, via {"$_"} }; my $exception = $@; Test::More::ok !$@, 'types are not mutated by union with a string type'; subtype Test1, as Int | 'ArrayRef[Int]'; Test::More::ok Test1->check(1), '1 is an Int'; Test::More::ok !Test1->check('a'), 'a is not an Int'; Test::More::ok Test1->check([1, 2, 3]), 'Passes ArrayRef'; Test::More::ok !Test1->check([1, 'a', 3]), 'Fails ArrayRef with a letter'; Test::More::ok !Test1->check({a=>1}), 'fails wrong ref type'; eval { subtype Test2, as Int | 'IDONTEXIST'; }; my $check = $@; Test::More::ok $@, 'Got an error for bad Type'; Test::More::like $check, qr/IDONTEXIST is not a type constraint/, 'correct error'; my $obj = subtype Test3, as Int | 'ArrayRef[Int]' | Object; Test::More::ok Test3->check(1), '1 is an Int'; Test::More::ok !Test3->check('a'), 'a is not an Int'; Test::More::ok Test3->check([1, 2, 3]), 'Passes ArrayRef'; Test::More::ok !Test3->check([1, 'a', 3]), 'Fails ArrayRef with a letter'; Test::More::ok !Test3->check({a=>1}), 'fails wrong ref type'; Test::More::ok Test3->check($obj), 'Union allows Object'; } done_testing(); MooseX-Types-0.46/t/21_coerce_parameterized_types.t000600 000766 000024 00000002133 12563756310 022563 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { package TypeLib; use MooseX::Types -declare => [qw/ MyChar MyDigit ArrayRefOfMyCharOrDigit /]; use MooseX::Types::Moose qw/ArrayRef Str Int/; subtype MyChar, as Str, where { length == 1 }; subtype MyDigit, as Int, where { length == 1 }; coerce ArrayRef[MyChar|MyDigit], from Str, via { [split //] }; # same thing with an explicit subtype subtype ArrayRefOfMyCharOrDigit, as ArrayRef[MyChar|MyDigit]; coerce ArrayRefOfMyCharOrDigit, from Str, via { [split //] }; } { BEGIN { TypeLib->import(qw/ MyChar MyDigit ArrayRefOfMyCharOrDigit/ ) }; use MooseX::Types::Moose 'ArrayRef'; my $parameterized = ArrayRef[MyChar|MyDigit]; { local $::TODO = "see comments in MooseX::Types->create_arged_..."; ::ok( $parameterized->has_coercion, 'coercion applied to parameterized type' ); } my $subtype = ArrayRefOfMyCharOrDigit; ::ok( $subtype->has_coercion, 'coercion applied to subtype' ); } done_testing(); MooseX-Types-0.46/t/22_class_type.t000600 000766 000024 00000002160 12563756310 017332 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { package MyTypes; use MooseX::Types::Moose qw( Item ); use MooseX::Types -declare => [ 'ClassyType', 'NoClass' ]; class_type 'ClassyClass'; subtype ClassyType, as 'ClassyClass'; subtype NoClass, as Item, where { 1 }; } BEGIN { ok(!eval { MyTypes::ClassyType->new }, 'new without class loaded explodes'); like($@, qr/does not provide/, 'right exception'); ok(!eval { MyTypes::NoClass->new }, 'new on non-class type'); like($@, qr/non-class-type/, 'right exception'); } BEGIN { package ClassyClass; use Moose; sub check { die "FAIL" } package ClassyClassConsumer; BEGIN { MyTypes->import('ClassyType') } use Moose; has om_nom => ( is => 'ro', isa => ClassyType, default => sub { ClassyType->new } ); } ok(my $o = ClassyClassConsumer->new, "Constructor happy"); is(ref($o->om_nom), 'ClassyClass', 'Attribute happy'); ok(ClassyClassConsumer->new(om_nom => ClassyClass->new), 'Constructor happy'); ok(!eval { ClassyClassConsumer->new(om_nom => 3) }, 'Type checked'); done_testing; MooseX-Types-0.46/t/23_any_subtype.t000600 000766 000024 00000000455 12563756310 017534 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; use MooseX::Types -declare => ['Foo']; use MooseX::Types::Moose qw( Any ); is( exception { subtype Foo, as Any }, undef, 'no exception when subtyping Any type' ); done_testing(); MooseX-Types-0.46/t/24_class_can_isa.t000600 000766 000024 00000000733 12563756310 017754 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; use MooseX::Types::TypeDecorator; is( exception { MooseX::Types::TypeDecorator->isa('X') }, undef, 'no exception calling ->isa on MooseX::Types::TypeDecorator as class method' ); is( exception { MooseX::Types::TypeDecorator->can('X') }, undef, 'no exception calling ->can on MooseX::Types::TypeDecorator as class method' ); done_testing(); MooseX-Types-0.46/t/25-fully-qualified.t000600 000766 000024 00000004175 12563756310 020211 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; # this test demonstrates: # - it is safe to use namespace::autoclean in a MooseX::Types exporter (types # are still available on the exporting module afterwards) # - namespace::autoclean can be used to clean imported types in the consuming # class { package MyTypeLibrary; use MooseX::Types::Moose 'Str'; use MooseX::Types -declare => [ 'NonEmptyStr' ]; use namespace::autoclean; subtype NonEmptyStr, as Str, where { length $_ }, message { 'Str must not be empty' }; } { package MyApp; BEGIN { MyTypeLibrary->import('NonEmptyStr') } ::ok(is_NonEmptyStr('a string'), 'is_NonEmptyStr'); ::ok(NonEmptyStr->isa('Moose::Meta::TypeConstraint'), 'type is available as an import'); ::ok(MyApp->can('NonEmptyStr'), 'type is still available as a method on the importing class'); for my $phase ('before', 'after') { ::note "$phase calling namespace::autoclean"; SKIP: { ::skip('Moose before 2.1005 could not install blessed subs as methods', 1) if Moose->VERSION < 2.1005; ::ok(MyTypeLibrary->can('NonEmptyStr'), "$phase calling namespace::autoclean: type is available as a method on the declaring class"); } ::ok(eval '\&MyTypeLibrary::NonEmptyStr', "$phase calling namespace::autoclean: type is available as a fully-qualified name on the declaring class"); SKIP: { ::skip('Moose before 2.1005 could not install blessed subs as methods', 1) if Moose->VERSION < 2.1005; ::ok(MyTypeLibrary::NonEmptyStr->isa('Moose::Meta::TypeConstraint'), "$phase calling namespace::autoclean: type is the right type") or ::diag('MyTypeLibrary is type: ' .join(', ', @MyTypeLibrary::ISA)); } last if $phase eq 'after'; } continue { ::note 'calling namespace::autoclean'; eval q{use namespace::autoclean}; } ::ok(!MyApp->can('NonEmptyStr'), 'type is no longer available as a method on the importing class'); } done_testing; MooseX-Types-0.46/t/lib/000700 000766 000024 00000000000 12563756310 015241 5ustar00etherstaff000000 000000 MooseX-Types-0.46/t/regressions/000700 000766 000024 00000000000 12563756310 017036 5ustar00etherstaff000000 000000 MooseX-Types-0.46/t/zzz-check-breaks.t000644 000766 000024 00000000634 12563756310 020052 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.012 use Test::More 0.88; 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'; done_testing; MooseX-Types-0.46/t/regressions/01-is_subtype_of.t000644 000766 000024 00000000610 12563756310 022322 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use MooseX::Types; use MooseX::Types::Moose qw(Any Item ); my $item = subtype as Item; ok Item->equals('Item'); ok Item->equals(Item); ok ( $item->is_subtype_of('Any'), q[$item is subtype of 'Any']); ok ( Item->is_subtype_of('Any'), q[Item is subtype of 'Any']); ok ( Item->is_subtype_of(Any), q[Item is subtype of Any]); done_testing; MooseX-Types-0.46/t/lib/Combined.pm000644 000766 000024 00000000225 12563756310 017330 0ustar00etherstaff000000 000000 package Combined; use strict; use warnings; use base 'MooseX::Types::Combine'; __PACKAGE__->provide_types_from(qw/TestLibrary TestLibrary2/); 1; MooseX-Types-0.46/t/lib/DecoratorLibrary.pm000644 000766 000024 00000003572 12563756310 021067 0ustar00etherstaff000000 000000 package DecoratorLibrary; use MooseX::Types::Moose qw( Str ArrayRef HashRef Int Object); use MooseX::Types -declare => [qw( MyArrayRefBase MyArrayRefInt01 MyArrayRefInt02 MyHashRefOfInts MyHashRefOfStr StrOrArrayRef AtLeastOneInt Jobs SubOfMyArrayRefInt01 BiggerInt isFive isTen isFifteen TwoEqualArrayRefs VeryBigInt FiveOrTenOrFifteen WierdIntegersArrayRef1 WierdIntegersArrayRef2 )]; subtype MyArrayRefBase, as ArrayRef; coerce MyArrayRefBase, from Str, via {[split(',', $_)]}; subtype MyArrayRefInt01, as ArrayRef[Int]; subtype BiggerInt, as Int, where {$_>10}; subtype SubOfMyArrayRefInt01, as MyArrayRefInt01[BiggerInt]; coerce MyArrayRefInt01, from Str, via {[split('\.',$_)]}, from HashRef, via {[sort values(%$_)]}; subtype MyArrayRefInt02, as MyArrayRefBase[Int]; subtype MyHashRefOfInts, as HashRef[Int]; subtype MyHashRefOfStr, as HashRef[Str]; coerce MyArrayRefInt02, from Str, via {[split(':',$_)]}, from MyHashRefOfInts, via {[sort values(%$_)]}, from MyHashRefOfStr, via {[ sort map { length $_ } values(%$_) ]}, from HashRef[ArrayRef], via {[ sort map { @$_ } values(%$_) ]}; subtype StrOrArrayRef, as Str|ArrayRef; subtype AtLeastOneInt, as ArrayRef[Int], where { @$_ > 0 }; enum Jobs, [qw/Programming Teaching Banking/]; subtype isFive, as Int, where { $_ == 5}; subtype isTen, as Int, where { $_ == 10}; subtype isFifteen, as Int, where { $_ == 15}; subtype VeryBigInt, as BiggerInt, where {$_>100}; subtype FiveOrTenOrFifteen, as isFive|isTen|isFifteen; subtype WierdIntegersArrayRef1, as ArrayRef[FiveOrTenOrFifteen|VeryBigInt]; subtype WierdIntegersArrayRef2, as ArrayRef[FiveOrTenOrFifteen|Object]; 1; MooseX-Types-0.46/t/lib/Empty.pm000644 000766 000024 00000000023 12563756310 016702 0ustar00etherstaff000000 000000 package Empty; 1; MooseX-Types-0.46/t/lib/SubExporterCompatibility.pm000644 000766 000024 00000000426 12563756310 022627 0ustar00etherstaff000000 000000 package SubExporterCompatibility; { use MooseX::Types::Moose qw(Str); use MooseX::Types -declare => [qw(MyStr)]; use Sub::Exporter -setup => { exports => [ qw(something MyStr) ] }; subtype MyStr, as Str; sub something { return 1; } } 1; MooseX-Types-0.46/t/lib/TestLibrary.pm000644 000766 000024 00000001250 12563756310 020053 0ustar00etherstaff000000 000000 package TestLibrary; use warnings; use strict; use MooseX::Types::Moose qw( Str ArrayRef Int ); use MooseX::Types -declare => [qw( NonEmptyStr IntArrayRef TwentyThree Foo2Alias )]; subtype NonEmptyStr, as Str, where { length $_ }, message { 'Str must not be empty' }; coerce NonEmptyStr, from Int, via { "$_" }; subtype IntArrayRef, as ArrayRef, where { not grep { $_ !~ /^\d+$/ } @$_ }, message { 'ArrayRef contains non-Int value' }; coerce IntArrayRef, from Int, via { [$_] }; subtype TwentyThree, as Int, where { $_ == 23 }, message { 'Int is not 23' }; subtype Foo2Alias, as Str, where { 1 }; 1; MooseX-Types-0.46/t/lib/TestLibrary2.pm000644 000766 000024 00000000477 12563756310 020147 0ustar00etherstaff000000 000000 package TestLibrary2; use MooseX::Types -declare => [qw( MTFNPY NonEmptyStr )]; use MooseX::Types::Moose 'Str'; subtype MTFNPY, as Str, where { length $_ }, message { 'MTFNPY must not be empty' }; subtype NonEmptyStr, as Str, where { length $_ }, message { 'Str must not be empty' }; 1; MooseX-Types-0.46/t/lib/TestNamespaceSep.pm000644 000766 000024 00000000151 12563756310 021012 0ustar00etherstaff000000 000000 package TestNamespaceSep; use warnings; use strict; use MooseX::Types -declare => [qw( Foo::Bar )]; 1; MooseX-Types-0.46/t/lib/TestWrapper.pm000644 000766 000024 00000002363 12563756310 020075 0ustar00etherstaff000000 000000 package TestWrapper; use Moose; extends 'MooseX::Types::Wrapper'; #use Class::C3; #use base 'MooseX::Types::Wrapper'; override type_export_generator => sub { my $code = super(); return sub { $code->(@_) }; }; #sub type_export_generator { # my $class = shift; # my ($type, $full) = @_; # my $code = $class->next::method(@_); # return sub { $code->(@_) }; #} override check_export_generator => sub { my $code = super(); return sub { return $code unless @_; return $code->(@_); }; }; #sub check_export_generator { # my $class = shift; # my ($type, $full, $undef_msg) = @_; # my $code = $class->next::method(@_); # return sub { # return $code unless @_; # return $code->(@_); # }; #} override coercion_export_generator => sub { my $code = super(); return sub { my $value = $code->(@_); die "coercion returned undef\n" unless defined $value; return $value; }; }; #sub coercion_export_generator { # my $class = shift; # my ($type, $full, $undef_msg) = @_; # my $code = $class->next::method(@_); # return sub { # my $val = $code->(@_); # die "coercion returned undef\n" unless defined $val; # return $val; # }; #} 1; MooseX-Types-0.46/lib/MooseX/000700 000766 000024 00000000000 12563756310 016210 5ustar00etherstaff000000 000000 MooseX-Types-0.46/lib/MooseX/Types/000700 000766 000024 00000000000 12563756310 017314 5ustar00etherstaff000000 000000 MooseX-Types-0.46/lib/MooseX/Types.pm000600 000766 000024 00000072053 12563756310 017663 0ustar00etherstaff000000 000000 package MooseX::Types; # git description: v0.45-12-g72441cd use Moose; # ABSTRACT: Organise your Moose types in libraries # KEYWORDS: moose types classes objects constraints declare libraries our $VERSION = '0.46'; use Moose::Util::TypeConstraints qw( find_type_constraint ); use MooseX::Types::TypeDecorator; use MooseX::Types::Base (); use MooseX::Types::Util qw( filter_tags ); use MooseX::Types::UndefinedType; use MooseX::Types::CheckedUtilExports (); use Carp::Clan qw( ^MooseX::Types ); use Sub::Name; use Scalar::Util qw( blessed reftype ); use Sub::Exporter::ForMethods 0.100052 'method_installer'; # for 'rebless' use namespace::autoclean; use 5.008; my $UndefMsg = q{Action for type '%s' not yet defined in library '%s'}; #pod =pod #pod #pod =head1 SYNOPSIS #pod #pod =head2 Library Definition #pod #pod package MyLibrary; #pod #pod # predeclare our own types #pod use MooseX::Types -declare => [ #pod qw( #pod PositiveInt #pod NegativeInt #pod ArrayRefOfPositiveInt #pod ArrayRefOfAtLeastThreeNegativeInts #pod LotsOfInnerConstraints #pod StrOrArrayRef #pod MyDateTime #pod ) #pod ]; #pod #pod # import builtin types #pod use MooseX::Types::Moose qw/Int HashRef/; #pod #pod # type definition. #pod subtype PositiveInt, #pod as Int, #pod where { $_ > 0 }, #pod message { "Int is not larger than 0" }; #pod #pod subtype NegativeInt, #pod as Int, #pod where { $_ < 0 }, #pod message { "Int is not smaller than 0" }; #pod #pod # type coercion #pod coerce PositiveInt, #pod from Int, #pod via { 1 }; #pod #pod # with parameterized constraints. #pod #pod subtype ArrayRefOfPositiveInt, #pod as ArrayRef[PositiveInt]; #pod #pod subtype ArrayRefOfAtLeastThreeNegativeInts, #pod as ArrayRef[NegativeInt], #pod where { scalar(@$_) > 2 }; #pod #pod subtype LotsOfInnerConstraints, #pod as ArrayRef[ArrayRef[HashRef[Int]]]; #pod #pod # with TypeConstraint Unions #pod #pod subtype StrOrArrayRef, #pod as Str|ArrayRef; #pod #pod # class types #pod #pod class_type 'DateTime'; #pod #pod # or better #pod #pod class_type MyDateTime, { class => 'DateTime' }; #pod #pod coerce MyDateTime, #pod from HashRef, #pod via { DateTime->new(%$_) }; #pod #pod 1; #pod #pod =head2 Usage #pod #pod package Foo; #pod use Moose; #pod use MyLibrary qw( PositiveInt NegativeInt ); #pod #pod # use the exported constants as type names #pod has 'bar', #pod isa => PositiveInt, #pod is => 'rw'; #pod has 'baz', #pod isa => NegativeInt, #pod is => 'rw'; #pod #pod sub quux { #pod my ($self, $value); #pod #pod # test the value #pod print "positive\n" if is_PositiveInt($value); #pod print "negative\n" if is_NegativeInt($value); #pod #pod # coerce the value, NegativeInt doesn't have a coercion #pod # helper, since it didn't define any coercions. #pod $value = to_PositiveInt($value) or die "Cannot coerce"; #pod } #pod #pod 1; #pod #pod =head1 DESCRIPTION #pod #pod The type system provided by Moose effectively makes all of its builtin type #pod global, as are any types you declare with Moose. This means that every module #pod that declares a type named C is sharing the same type object. This #pod can be a problem when different parts of the code base want to use the same #pod name for different things. #pod #pod This package lets you declare types using short names, but behind the scenes #pod it namespaces all your type declarations, effectively prevent name clashes #pod between packages. #pod #pod This is done by creating a type library module like C and then #pod importing types from that module into other modules. #pod #pod As a side effect, the declaration mechanism allows you to write type names as #pod barewords (really function calls), which catches typos in names at compile #pod time rather than run time. #pod #pod This module also provides some helper functions for using Moose types outside #pod of attribute declarations. #pod #pod If you mix string-based names with types created by this module, it will warn, #pod with a few exceptions. If you are declaring a C or #pod C within your type library, or if you use a fully qualified name #pod like C<"MyApp::Foo">. #pod #pod =head1 LIBRARY DEFINITION #pod #pod A MooseX::Types is just a normal Perl module. Unlike Moose #pod itself, it does not install C and C in your #pod class by default, so this is up to you. #pod #pod The only thing a library is required to do is #pod #pod use MooseX::Types -declare => \@types; #pod #pod with C<@types> being a list of types you wish to define in this library. #pod This line will install a proper base class in your package as well as the #pod full set of L for your declared #pod types. It will then hand control over to L' #pod C method to export the functions you will need to declare your #pod types. #pod #pod If you want to use Moose' built-in types (e.g. for subtyping) you will #pod want to #pod #pod use MooseX::Types::Moose @types; #pod #pod to import the helpers from the shipped L #pod library which can export all types that come with Moose. #pod #pod You will have to define coercions for your types or your library won't #pod export a L coercion helper for it. #pod #pod Note that you currently cannot define types containing C<::>, since #pod exporting would be a problem. #pod #pod You also don't need to use C and C, since the #pod definition of a library automatically exports those. #pod #pod =head1 LIBRARY USAGE #pod #pod You can import the L<"type helpers"|/"TYPE HANDLER FUNCTIONS"> of a #pod library by Cing it with a list of types to import as arguments. If #pod you want all of them, use the C<:all> tag. For example: #pod #pod use MyLibrary ':all'; #pod use MyOtherLibrary qw( TypeA TypeB ); #pod #pod MooseX::Types comes with a library of Moose' built-in types called #pod L. #pod #pod The exporting mechanism is, since version 0.5, implemented via a wrapper #pod around L. This means you can do something like this: #pod #pod use MyLibrary TypeA => { -as => 'MyTypeA' }, #pod TypeB => { -as => 'MyTypeB' }; #pod #pod =head1 TYPE HANDLER FUNCTIONS #pod #pod =head2 $type #pod #pod A constant with the name of your type. It contains the type's fully #pod qualified name. Takes no value, as all constants. #pod #pod =head2 is_$type #pod #pod This handler takes a value and tests if it is a valid value for this #pod C<$type>. It will return true or false. #pod #pod =head2 to_$type #pod #pod A handler that will take a value and coerce it into the C<$type>. It will #pod return a false value if the type could not be coerced. #pod #pod B: This handler will only be exported for types that can #pod do type coercion. This has the advantage that a coercion to a type that #pod has not defined any coercions will lead to a compile-time error. #pod #pod =head1 WRAPPING A LIBRARY #pod #pod You can define your own wrapper subclasses to manipulate the behaviour #pod of a set of library exports. Here is an example: #pod #pod package MyWrapper; #pod use strict; #pod use MRO::Compat; #pod use base 'MooseX::Types::Wrapper'; #pod #pod sub coercion_export_generator { #pod my $class = shift; #pod my $code = $class->next::method(@_); #pod return sub { #pod my $value = $code->(@_); #pod warn "Coercion returned undef!" #pod unless defined $value; #pod return $value; #pod }; #pod } #pod #pod 1; #pod #pod This class wraps the coercion generator (e.g., C) and warns #pod if a coercion returned an undefined value. You can wrap any library #pod with this: #pod #pod package Foo; #pod use strict; #pod use MyWrapper MyLibrary => [qw( Foo Bar )], #pod Moose => [qw( Str Int )]; #pod #pod ... #pod 1; #pod #pod The C library name is a special shortcut for L. #pod #pod =head2 Generator methods you can overload #pod #pod =over 4 #pod #pod =item type_export_generator( $short, $full ) #pod #pod Creates a closure returning the type's L object. #pod #pod =item check_export_generator( $short, $full, $undef_message ) #pod #pod This creates the closure used to test if a value is valid for this type. #pod #pod =item coercion_export_generator( $short, $full, $undef_message ) #pod #pod This is the closure that's doing coercions. #pod #pod =back #pod #pod =head2 Provided Parameters #pod #pod =over 4 #pod #pod =item $short #pod #pod The short, exported name of the type. #pod #pod =item $full #pod #pod The fully qualified name of this type as L knows it. #pod #pod =item $undef_message #pod #pod A message that will be thrown when type functionality is used but the #pod type does not yet exist. #pod #pod =back #pod #pod =head1 RECURSIVE SUBTYPES #pod #pod As of version 0.08, L has experimental support for Recursive #pod subtypes. This will allow: #pod #pod subtype Tree() => as HashRef[Str|Tree]; #pod #pod Which validates things like: #pod #pod {key=>'value'}; #pod {key=>{subkey1=>'value', subkey2=>'value'}} #pod #pod And so on. This feature is new and there may be lurking bugs so don't be afraid #pod to hunt me down with patches and test cases if you have trouble. #pod #pod =head1 NOTES REGARDING TYPE UNIONS #pod #pod L uses L to do some overloading #pod which generally allows you to easily create union types: #pod #pod subtype StrOrArrayRef, #pod as Str|ArrayRef; #pod #pod As with parameterized constraints, this overloading extends to modules using the #pod types you define in a type library. #pod #pod use Moose; #pod use MooseX::Types::Moose qw(HashRef Int); #pod #pod has 'attr' => ( isa => HashRef | Int ); #pod #pod And everything should just work as you'd think. #pod #pod =head1 METHODS #pod #pod =head2 import #pod #pod Installs the L class into the caller and exports types #pod according to the specification described in L. This #pod will continue to L' C method to export #pod helper functions you will need to declare your types. #pod #pod =cut sub import { my ($class, %args) = @_; my $caller = caller; # everyone should want this strict->import; warnings->import; # inject base class into new library { no strict 'refs'; unshift @{ $caller . '::ISA' }, 'MooseX::Types::Base'; } # generate predeclared type helpers if (my @orig_declare = @{ $args{ -declare } || [] }) { my ($tags, $declare) = filter_tags @orig_declare; my @to_export; for my $type (@$declare) { croak "Cannot create a type containing '::' ($type) at the moment" if $type =~ /::/; # add type to library and remember to export $caller->add_type($type); push @to_export, $type; } $caller->import({ -full => 1, -into => $caller, installer => method_installer({ rebless => 1 }), }, @to_export); } # run type constraints import Moose::Util::TypeConstraints->import({ into => $caller }); # override some with versions that check for syntax errors MooseX::Types::CheckedUtilExports->import({ into => $caller }); 1; } #pod =head2 type_export_generator #pod #pod Generate a type export, e.g. C. This will return either a #pod L object, or alternatively a #pod L object if the type was not yet defined. #pod #pod =cut sub type_export_generator { my ($class, $type, $name) = @_; ## Return an anonymous subroutine that will generate the proxied type ## constraint for you. return subname "__TYPE__::$name" => sub { my $type_constraint = $class->create_base_type_constraint($name); if(defined(my $params = shift @_)) { ## We currently only allow a TC to accept a single, ArrayRef ## parameter, as in HashRef[Int], where [Int] is what's inside the ## ArrayRef passed. if(reftype $params eq 'ARRAY') { $type_constraint = $class->create_arged_type_constraint($name, @$params); } elsif(!defined $type_constraint) { croak "Syntax error in type definition (did you forget a comma" . " after $type?)"; } else { croak "Argument must be an ArrayRef to create a parameterized " . "type, Eg.: ${type}[Int]. Got: ".ref($params)."." } } $type_constraint = defined($type_constraint) ? $type_constraint : MooseX::Types::UndefinedType->new($name); my $type_decorator = $class->create_type_decorator($type_constraint); ## If there are additional args, that means it's probably stuff that ## needs to be returned to the subtype. Not an ideal solution here but ## doesn't seem to cause trouble. if(@_) { return ($type_decorator, @_); } else { return $type_decorator; } }; } #pod =head2 create_arged_type_constraint ($name, @args) #pod #pod Given a String $name with @args find the matching type constraint and parameterize #pod it with @args. #pod #pod =cut sub create_arged_type_constraint { my ($class, $name, @args) = @_; my $type_constraint = Moose::Util::TypeConstraints::find_or_create_type_constraint("$name"); my $parameterized = $type_constraint->parameterize(@args); # It's obnoxious to have to parameterize before looking for the TC, but the # alternative is to hard-code the assumption that the name is # "$name[$args[0]]", which would be worse. # This breaks MXMS, unfortunately, which relies on things like Tuple[...] # creating new type objects each time. # if (my $existing = # Moose::Util::TypeConstraints::find_type_constraint($parameterized->name)) { # return $existing; # } # Moose::Util::TypeConstraints::register_type_constraint($parameterized); return $parameterized; } #pod =head2 create_base_type_constraint ($name) #pod #pod Given a String $name, find the matching type constraint. #pod #pod =cut sub create_base_type_constraint { my ($class, $name) = @_; return find_type_constraint($name); } #pod =head2 create_type_decorator ($type_constraint) #pod #pod Given a $type_constraint, return a lightweight L #pod instance. #pod #pod =cut sub create_type_decorator { my ($class, $type_constraint) = @_; return MooseX::Types::TypeDecorator->new($type_constraint); } #pod =head2 coercion_export_generator #pod #pod This generates a coercion handler function, e.g. C. #pod #pod =cut sub coercion_export_generator { my ($class, $type, $full, $undef_msg) = @_; return sub { my ($value) = @_; # we need a type object my $tobj = find_type_constraint($full) or croak $undef_msg; my $return = $tobj->coerce($value); # non-successful coercion returns false return unless $tobj->check($return); return $return; } } #pod =head2 check_export_generator #pod #pod Generates a constraint check closure, e.g. C. #pod #pod =cut sub check_export_generator { my ($class, $type, $full, $undef_msg) = @_; return sub { my ($value) = @_; # we need a type object my $tobj = find_type_constraint($full) or croak $undef_msg; return $tobj->check($value); } } __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types - Organise your Moose types in libraries =head1 VERSION version 0.46 =head1 SYNOPSIS =head2 Library Definition package MyLibrary; # predeclare our own types use MooseX::Types -declare => [ qw( PositiveInt NegativeInt ArrayRefOfPositiveInt ArrayRefOfAtLeastThreeNegativeInts LotsOfInnerConstraints StrOrArrayRef MyDateTime ) ]; # import builtin types use MooseX::Types::Moose qw/Int HashRef/; # type definition. subtype PositiveInt, as Int, where { $_ > 0 }, message { "Int is not larger than 0" }; subtype NegativeInt, as Int, where { $_ < 0 }, message { "Int is not smaller than 0" }; # type coercion coerce PositiveInt, from Int, via { 1 }; # with parameterized constraints. subtype ArrayRefOfPositiveInt, as ArrayRef[PositiveInt]; subtype ArrayRefOfAtLeastThreeNegativeInts, as ArrayRef[NegativeInt], where { scalar(@$_) > 2 }; subtype LotsOfInnerConstraints, as ArrayRef[ArrayRef[HashRef[Int]]]; # with TypeConstraint Unions subtype StrOrArrayRef, as Str|ArrayRef; # class types class_type 'DateTime'; # or better class_type MyDateTime, { class => 'DateTime' }; coerce MyDateTime, from HashRef, via { DateTime->new(%$_) }; 1; =head2 Usage package Foo; use Moose; use MyLibrary qw( PositiveInt NegativeInt ); # use the exported constants as type names has 'bar', isa => PositiveInt, is => 'rw'; has 'baz', isa => NegativeInt, is => 'rw'; sub quux { my ($self, $value); # test the value print "positive\n" if is_PositiveInt($value); print "negative\n" if is_NegativeInt($value); # coerce the value, NegativeInt doesn't have a coercion # helper, since it didn't define any coercions. $value = to_PositiveInt($value) or die "Cannot coerce"; } 1; =head1 DESCRIPTION The type system provided by Moose effectively makes all of its builtin type global, as are any types you declare with Moose. This means that every module that declares a type named C is sharing the same type object. This can be a problem when different parts of the code base want to use the same name for different things. This package lets you declare types using short names, but behind the scenes it namespaces all your type declarations, effectively prevent name clashes between packages. This is done by creating a type library module like C and then importing types from that module into other modules. As a side effect, the declaration mechanism allows you to write type names as barewords (really function calls), which catches typos in names at compile time rather than run time. This module also provides some helper functions for using Moose types outside of attribute declarations. If you mix string-based names with types created by this module, it will warn, with a few exceptions. If you are declaring a C or C within your type library, or if you use a fully qualified name like C<"MyApp::Foo">. =head1 LIBRARY DEFINITION A MooseX::Types is just a normal Perl module. Unlike Moose itself, it does not install C and C in your class by default, so this is up to you. The only thing a library is required to do is use MooseX::Types -declare => \@types; with C<@types> being a list of types you wish to define in this library. This line will install a proper base class in your package as well as the full set of L for your declared types. It will then hand control over to L' C method to export the functions you will need to declare your types. If you want to use Moose' built-in types (e.g. for subtyping) you will want to use MooseX::Types::Moose @types; to import the helpers from the shipped L library which can export all types that come with Moose. You will have to define coercions for your types or your library won't export a L coercion helper for it. Note that you currently cannot define types containing C<::>, since exporting would be a problem. You also don't need to use C and C, since the definition of a library automatically exports those. =head1 LIBRARY USAGE You can import the L<"type helpers"|/"TYPE HANDLER FUNCTIONS"> of a library by Cing it with a list of types to import as arguments. If you want all of them, use the C<:all> tag. For example: use MyLibrary ':all'; use MyOtherLibrary qw( TypeA TypeB ); MooseX::Types comes with a library of Moose' built-in types called L. The exporting mechanism is, since version 0.5, implemented via a wrapper around L. This means you can do something like this: use MyLibrary TypeA => { -as => 'MyTypeA' }, TypeB => { -as => 'MyTypeB' }; =head1 TYPE HANDLER FUNCTIONS =head2 $type A constant with the name of your type. It contains the type's fully qualified name. Takes no value, as all constants. =head2 is_$type This handler takes a value and tests if it is a valid value for this C<$type>. It will return true or false. =head2 to_$type A handler that will take a value and coerce it into the C<$type>. It will return a false value if the type could not be coerced. B: This handler will only be exported for types that can do type coercion. This has the advantage that a coercion to a type that has not defined any coercions will lead to a compile-time error. =head1 WRAPPING A LIBRARY You can define your own wrapper subclasses to manipulate the behaviour of a set of library exports. Here is an example: package MyWrapper; use strict; use MRO::Compat; use base 'MooseX::Types::Wrapper'; sub coercion_export_generator { my $class = shift; my $code = $class->next::method(@_); return sub { my $value = $code->(@_); warn "Coercion returned undef!" unless defined $value; return $value; }; } 1; This class wraps the coercion generator (e.g., C) and warns if a coercion returned an undefined value. You can wrap any library with this: package Foo; use strict; use MyWrapper MyLibrary => [qw( Foo Bar )], Moose => [qw( Str Int )]; ... 1; The C library name is a special shortcut for L. =head2 Generator methods you can overload =over 4 =item type_export_generator( $short, $full ) Creates a closure returning the type's L object. =item check_export_generator( $short, $full, $undef_message ) This creates the closure used to test if a value is valid for this type. =item coercion_export_generator( $short, $full, $undef_message ) This is the closure that's doing coercions. =back =head2 Provided Parameters =over 4 =item $short The short, exported name of the type. =item $full The fully qualified name of this type as L knows it. =item $undef_message A message that will be thrown when type functionality is used but the type does not yet exist. =back =head1 RECURSIVE SUBTYPES As of version 0.08, L has experimental support for Recursive subtypes. This will allow: subtype Tree() => as HashRef[Str|Tree]; Which validates things like: {key=>'value'}; {key=>{subkey1=>'value', subkey2=>'value'}} And so on. This feature is new and there may be lurking bugs so don't be afraid to hunt me down with patches and test cases if you have trouble. =head1 NOTES REGARDING TYPE UNIONS L uses L to do some overloading which generally allows you to easily create union types: subtype StrOrArrayRef, as Str|ArrayRef; As with parameterized constraints, this overloading extends to modules using the types you define in a type library. use Moose; use MooseX::Types::Moose qw(HashRef Int); has 'attr' => ( isa => HashRef | Int ); And everything should just work as you'd think. =head1 METHODS =head2 import Installs the L class into the caller and exports types according to the specification described in L. This will continue to L' C method to export helper functions you will need to declare your types. =head2 type_export_generator Generate a type export, e.g. C. This will return either a L object, or alternatively a L object if the type was not yet defined. =head2 create_arged_type_constraint ($name, @args) Given a String $name with @args find the matching type constraint and parameterize it with @args. =head2 create_base_type_constraint ($name) Given a String $name, find the matching type constraint. =head2 create_type_decorator ($type_constraint) Given a $type_constraint, return a lightweight L instance. =head2 coercion_export_generator This generates a coercion handler function, e.g. C. =head2 check_export_generator Generates a constraint check closure, e.g. C. =head1 CAVEATS The following are lists of gotchas and their workarounds for developers coming from the standard string based type constraint names =head2 Uniqueness A library makes the types quasi-unique by prefixing their names with (by default) the library package name. If you're only using the type handler functions provided by MooseX::Types, you shouldn't ever have to use a type's actual full name. =head2 Argument separation ('=>' versus ',') The L manpage has this to say about the '=>' operator: "The => operator is a synonym for the comma, but forces any word (consisting entirely of word characters) to its left to be interpreted as a string (as of 5.001). This includes words that might otherwise be considered a constant or function call." Due to this stringification, the following will NOT work as you might think: subtype StrOrArrayRef => as Str | ArrayRef; The C type will have its stringification activated -- this causes the subtype to not be created. Since the bareword type constraints are not strings you really should not try to treat them that way. You will have to use the ',' operator instead. The authors of this package realize that all the L documentation and examples nearly uniformly use the '=>' version of the comma operator and this could be an issue if you are converting code. Patches welcome for discussion. =head2 Compatibility with Sub::Exporter If you want to use L with a Type Library, you need to make sure you export all the type constraints declared AS WELL AS any additional export targets. For example if you do: package TypeAndSubExporter; use MooseX::Types::Moose qw(Str); use MooseX::Types -declare => [qw(MyStr)]; use Sub::Exporter -setup => { exports => [qw(something)] }; subtype MyStr, as Str; sub something { return 1; } # then in another module ... package Foo; use TypeAndSubExporter qw(MyStr); You'll get a C<< "MyStr" is not exported by the TypeAndSubExporter module >> error. It can be worked around by: - use Sub::Exporter -setup => { exports => [ qw(something) ] }; + use Sub::Exporter -setup => { exports => [ qw(something MyStr) ] }; This is a workaround and I am exploring how to make these modules work better together. I realize this workaround will lead a lot of duplication in your export declarations and will be onerous for large type libraries. Patches and detailed test cases welcome. See the tests directory for a start on this. =head1 COMBINING TYPE LIBRARIES You may want to combine a set of types for your application with other type libraries, like L or L. The L module provides a simple API for combining a set of type libraries together. =head1 SEE ALSO L, L, L, L =head1 ACKNOWLEDGEMENTS Many thanks to the C<#moose> cabal on C. =head1 AUTHOR Robert "phaylon" Sedlacek =head1 CONTRIBUTORS =for stopwords Karen Etheridge Dave Rolsky John Napiorkowski Robert 'phaylon' Sedlacek Rafael Kitover Florian Ragwitz Matt S Trout Tomas Doran (t0m) Jesse Luehrs Hans Dieter Pearcey Graham Knop Paul Fenwick Kent Fredric Justin Hunter =over 4 =item * Karen Etheridge =item * Dave Rolsky =item * John Napiorkowski =item * Robert 'phaylon' Sedlacek =item * Rafael Kitover =item * Florian Ragwitz =item * Matt S Trout =item * Tomas Doran (t0m) =item * Jesse Luehrs =item * Hans Dieter Pearcey =item * Graham Knop =item * Paul Fenwick =item * Kent Fredric =item * Justin Hunter =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/Base.pm000600 000766 000024 00000021540 12563756310 020530 0ustar00etherstaff000000 000000 package MooseX::Types::Base; # ABSTRACT: Type library base class our $VERSION = '0.46'; use Moose; use Carp::Clan qw( ^MooseX::Types ); use MooseX::Types::Util qw( filter_tags ); use Sub::Exporter qw( build_exporter ); use Moose::Util::TypeConstraints qw( find_type_constraint ); use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod You normally won't need to interact with this class by yourself. It is #pod merely a collection of functionality that type libraries need to #pod interact with moose and the rest of the L module. #pod #pod =cut my $UndefMsg = q{Unable to find type '%s' in library '%s'}; #pod =head1 METHODS #pod #pod =cut #pod =head2 import #pod #pod Provides the import mechanism for your library. See #pod L for syntax details on this. #pod #pod =cut sub import { my ($class, @args) = @_; # filter or create options hash for S:E my $options = (@args and (ref($args[0]) eq 'HASH')) ? $args[0] : undef; # preserve additional options, to ensure types are installed into the type library's namespace my %ex_spec = %{ $options || {} }; delete @ex_spec{ qw(-wrapper -into -full) }; unless ($options) { $options = {foo => 23}; unshift @args, $options; } # all types known to us my @types = $class->type_names; # determine the wrapper, -into is supported for compatibility reasons my $wrapper = $options->{ -wrapper } || 'MooseX::Types'; $args[0]->{into} = $options->{ -into } if exists $options->{ -into }; my %ex_util; TYPE: for my $type_short (@types) { # find type name and object, create undefined message my $type_full = $class->get_type($type_short) or croak "No fully qualified type name stored for '$type_short'"; my $type_cons = find_type_constraint($type_full); my $undef_msg = sprintf($UndefMsg, $type_short, $class); # the type itself push @{ $ex_spec{exports} }, $type_short, sub { bless $wrapper->type_export_generator($type_short, $type_full), 'MooseX::Types::EXPORTED_TYPE_CONSTRAINT'; }; # the check helper push @{ $ex_spec{exports} }, "is_${type_short}", sub { $wrapper->check_export_generator($type_short, $type_full, $undef_msg) }; # only export coercion helper if full (for libraries) or coercion is defined next TYPE unless $options->{ -full } or ($type_cons and $type_cons->has_coercion); push @{ $ex_spec{exports} }, "to_${type_short}", sub { $wrapper->coercion_export_generator($type_short, $type_full, $undef_msg) }; $ex_util{ $type_short }{to}++; # shortcut to remember this exists } # create S:E exporter and increase export level unless specified explicitly my $exporter = build_exporter \%ex_spec; $options->{into_level}++ unless $options->{into}; # remember requested symbols to determine what helpers to auto-export my %was_requested = map { ($_ => 1) } grep { not ref } @args; # determine which additional symbols (helpers) to export along my %add; EXPORT: for my $type (grep { exists $was_requested{ $_ } } @types) { $add{ "is_$type" }++ unless $was_requested{ "is_$type" }; next EXPORT unless exists $ex_util{ $type }{to}; $add{ "to_$type" }++ unless $was_requested{ "to_$type" }; } # and on to the real exporter my @new_args = (@args, keys %add); return $class->$exporter(@new_args); } #pod =head2 get_type #pod #pod This returns a type from the library's store by its name. #pod #pod =cut sub get_type { my ($class, $type) = @_; # useful message if the type couldn't be found croak "Unknown type '$type' in library '$class'" unless $class->has_type($type); # return real name of the type return $class->type_storage->{ $type }; } #pod =head2 type_names #pod #pod Returns a list of all known types by their name. #pod #pod =cut sub type_names { my ($class) = @_; # return short names of all stored types return keys %{ $class->type_storage }; } #pod =head2 add_type #pod #pod Adds a new type to the library. #pod #pod =cut sub add_type { my ($class, $type) = @_; # store type with library prefix as real name $class->type_storage->{ $type } = "${class}::${type}"; } #pod =head2 has_type #pod #pod Returns true or false depending on if this library knows a type by that #pod name. #pod #pod =cut sub has_type { my ($class, $type) = @_; # check if we stored a type under that name return ! ! $class->type_storage->{ $type }; } #pod =head2 type_storage #pod #pod Returns the library's type storage hash reference. You shouldn't use this #pod method directly unless you know what you are doing. It is not an internal #pod method because overriding it makes virtual libraries very easy. #pod #pod =cut sub type_storage { my ($class) = @_; # return a reference to the storage in ourself { no strict 'refs'; return \%{ $class . '::__MOOSEX_TYPELIBRARY_STORAGE' }; } } #pod =head2 registered_class_types #pod #pod Returns the class types registered within this library. Don't use directly. #pod #pod =cut sub registered_class_types { my ($class) = @_; { no strict 'refs'; return \%{ $class . '::__MOOSEX_TYPELIBRARY_CLASS_TYPES' }; } } #pod =head2 register_class_type #pod #pod Register a C for use in this library by class name. #pod #pod =cut sub register_class_type { my ($class, $type) = @_; croak "Not a class_type" unless $type->isa('Moose::Meta::TypeConstraint::Class'); $class->registered_class_types->{$type->class} = $type; } #pod =head2 get_registered_class_type #pod #pod Get a C registered in this library by name. #pod #pod =cut sub get_registered_class_type { my ($class, $name) = @_; $class->registered_class_types->{$name}; } #pod =head2 registered_role_types #pod #pod Returns the role types registered within this library. Don't use directly. #pod #pod =cut sub registered_role_types { my ($class) = @_; { no strict 'refs'; return \%{ $class . '::__MOOSEX_TYPELIBRARY_ROLE_TYPES' }; } } #pod =head2 register_role_type #pod #pod Register a C for use in this library by role name. #pod #pod =cut sub register_role_type { my ($class, $type) = @_; croak "Not a role_type" unless $type->isa('Moose::Meta::TypeConstraint::Role'); $class->registered_role_types->{$type->role} = $type; } #pod =head2 get_registered_role_type #pod #pod Get a C registered in this library by role name. #pod #pod =cut sub get_registered_role_type { my ($class, $name) = @_; $class->registered_role_types->{$name}; } #pod =head1 SEE ALSO #pod #pod L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::Base - Type library base class =head1 VERSION version 0.46 =head1 DESCRIPTION You normally won't need to interact with this class by yourself. It is merely a collection of functionality that type libraries need to interact with moose and the rest of the L module. =head1 METHODS =head2 import Provides the import mechanism for your library. See L for syntax details on this. =head2 get_type This returns a type from the library's store by its name. =head2 type_names Returns a list of all known types by their name. =head2 add_type Adds a new type to the library. =head2 has_type Returns true or false depending on if this library knows a type by that name. =head2 type_storage Returns the library's type storage hash reference. You shouldn't use this method directly unless you know what you are doing. It is not an internal method because overriding it makes virtual libraries very easy. =head2 registered_class_types Returns the class types registered within this library. Don't use directly. =head2 register_class_type Register a C for use in this library by class name. =head2 get_registered_class_type Get a C registered in this library by name. =head2 registered_role_types Returns the role types registered within this library. Don't use directly. =head2 register_role_type Register a C for use in this library by role name. =head2 get_registered_role_type Get a C registered in this library by role name. =head1 SEE ALSO L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/CheckedUtilExports.pm000644 000766 000024 00000005701 12563756310 023440 0ustar00etherstaff000000 000000 package MooseX::Types::CheckedUtilExports; # ABSTRACT: Wrap L to be safer for L our $VERSION = '0.46'; use strict; use warnings; use Moose::Util::TypeConstraints (); use Moose::Exporter; use Carp; use namespace::autoclean; my $StringFoundMsg = q{WARNING: String found where Type expected (did you use a => instead of a , ?)}; my @exports = qw/type subtype maybe_type duck_type enum coerce from as/; #pod =head1 DESCRIPTION #pod #pod Prevents errors like: #pod #pod subtype Foo => #pod ... #pod #pod Which should be written as: #pod #pod subtype Foo, #pod ... #pod #pod When using L. Exported by that module. #pod #pod Exports checked versions of the following subs: #pod #pod C C C C C C C C #pod #pod While C and C will also register the type in the library. #pod #pod From L. See that module for syntax. #pod #pod =cut for my $export (@exports) { no strict 'refs'; Sub::Install::install_sub({ into => __PACKAGE__, as => $export, code => sub { my $caller = shift; local $Carp::CarpLevel = $Carp::CarpLevel + 1; carp $StringFoundMsg unless ref($_[0]) || $_[0] =~ /\b::\b/ || # qualified type $caller->get_registered_class_type($_[0]) || $caller->get_registered_role_type($_[0]); goto &{"Moose::Util::TypeConstraints::$export"}; } }); } Moose::Exporter->setup_import_methods( with_caller => [ @exports, 'class_type', 'role_type' ] ); sub class_type { my $caller = shift; $caller->register_class_type( Moose::Util::TypeConstraints::class_type(@_) ); } sub role_type ($;$) { my ($caller, $name, $opts) = @_; $caller->register_role_type( Moose::Util::TypeConstraints::role_type($name, $opts) ); } #pod =head1 SEE ALSO #pod #pod L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::CheckedUtilExports - Wrap L to be safer for L =head1 VERSION version 0.46 =head1 DESCRIPTION Prevents errors like: subtype Foo => ... Which should be written as: subtype Foo, ... When using L. Exported by that module. Exports checked versions of the following subs: C C C C C C C C While C and C will also register the type in the library. From L. See that module for syntax. =head1 SEE ALSO L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/Combine.pm000644 000766 000024 00000006656 12563756310 021255 0ustar00etherstaff000000 000000 use strict; use warnings; package MooseX::Types::Combine; # ABSTRACT: Combine type libraries for exporting our $VERSION = '0.46'; use Module::Runtime 'use_module'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod package CombinedTypeLib; #pod #pod use base 'MooseX::Types::Combine'; #pod #pod __PACKAGE__->provide_types_from(qw/TypeLib1 TypeLib2/); #pod #pod package UserClass; #pod #pod use CombinedTypeLib qw/Type1 Type2 ... /; #pod #pod =head1 DESCRIPTION #pod #pod Allows you to export types from multiple type libraries. #pod #pod Libraries on the right end of the list passed to L #pod take precedence over those on the left in case of conflicts. #pod #pod =cut sub import { my ($class, @types) = @_; my $caller = caller; my %types = $class->_provided_types; if ( grep { $_ eq ':all' } @types ) { $_->import( { -into => $caller }, q{:all} ) for $class->provide_types_from; return; } my %from; for my $type (@types) { unless ($types{$type}) { my @type_libs = $class->provide_types_from; die "$caller asked for a type ($type) which is not found in any of the" . " type libraries (@type_libs) combined by $class\n"; } push @{ $from{ $types{$type} } }, $type; } $_->import({ -into => $caller }, @{ $from{ $_ } }) for keys %from; } #pod =head1 CLASS METHODS #pod #pod =head2 provide_types_from #pod #pod Sets or returns a list of type libraries to re-export from. #pod #pod =cut sub provide_types_from { my ($class, @libs) = @_; my $store = do { no strict 'refs'; \@{ "${class}::__MOOSEX_TYPELIBRARY_LIBRARIES" } }; if (@libs) { $class->_check_type_lib($_) for @libs; @$store = @libs; my %types = map { my $lib = $_; map +( $_ => $lib ), $lib->type_names } @libs; $class->_provided_types(%types); } @$store; } sub _check_type_lib { my ($class, $lib) = @_; use_module($lib); die "Cannot use $lib in a combined type library, it does not provide any types" unless $lib->can('type_names'); } sub _provided_types { my ($class, %types) = @_; my $types = do { no strict 'refs'; \%{ "${class}::__MOOSEX_TYPELIBRARY_TYPES" } }; %$types = %types if keys %types; %$types; } #pod =head1 SEE ALSO #pod #pod L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::Combine - Combine type libraries for exporting =head1 VERSION version 0.46 =head1 SYNOPSIS package CombinedTypeLib; use base 'MooseX::Types::Combine'; __PACKAGE__->provide_types_from(qw/TypeLib1 TypeLib2/); package UserClass; use CombinedTypeLib qw/Type1 Type2 ... /; =head1 DESCRIPTION Allows you to export types from multiple type libraries. Libraries on the right end of the list passed to L take precedence over those on the left in case of conflicts. =head1 CLASS METHODS =head2 provide_types_from Sets or returns a list of type libraries to re-export from. =head1 SEE ALSO L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/Moose.pm000600 000766 000024 00000005352 12563756310 020743 0ustar00etherstaff000000 000000 use warnings; use strict; package MooseX::Types::Moose; # ABSTRACT: Type exports that match the types shipped with L our $VERSION = '0.46'; use MooseX::Types; use Moose::Util::TypeConstraints (); use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod package Foo; #pod use Moose; #pod use MooseX::Types::Moose qw( ArrayRef Int Str ); #pod use Carp qw( croak ); #pod #pod has 'name', #pod is => 'rw', #pod isa => Str; #pod #pod has 'ids', #pod is => 'rw', #pod isa => ArrayRef[Int]; #pod #pod sub add { #pod my ($self, $x, $y) = @_; #pod croak 'First arg not an Int' unless is_Int($x); #pod croak 'Second arg not an Int' unless is_Int($y); #pod return $x + $y; #pod } #pod #pod 1; #pod #pod =head1 DESCRIPTION #pod #pod This package contains a virtual library for L that #pod is able to export all types known to L. See L #pod for general usage information. #pod #pod =cut # all available builtin types as short and long name my %BuiltIn_Storage = map { ($_) x 2 } Moose::Util::TypeConstraints->list_all_builtin_type_constraints; #pod =head1 METHODS #pod #pod =head2 type_storage #pod #pod Overrides L' C to provide a hash #pod reference containing all built-in L types. #pod #pod =cut # use prepopulated builtin hash as type storage sub type_storage { \%BuiltIn_Storage } #pod =head1 SEE ALSO #pod #pod L, #pod L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::Moose - Type exports that match the types shipped with L =head1 VERSION version 0.46 =head1 SYNOPSIS package Foo; use Moose; use MooseX::Types::Moose qw( ArrayRef Int Str ); use Carp qw( croak ); has 'name', is => 'rw', isa => Str; has 'ids', is => 'rw', isa => ArrayRef[Int]; sub add { my ($self, $x, $y) = @_; croak 'First arg not an Int' unless is_Int($x); croak 'Second arg not an Int' unless is_Int($y); return $x + $y; } 1; =head1 DESCRIPTION This package contains a virtual library for L that is able to export all types known to L. See L for general usage information. =head1 METHODS =head2 type_storage Overrides L' C to provide a hash reference containing all built-in L types. =head1 SEE ALSO L, L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/TypeDecorator.pm000644 000766 000024 00000016676 12563756310 022470 0ustar00etherstaff000000 000000 use strict; use warnings; package MooseX::Types::TypeDecorator; # ABSTRACT: Wraps Moose::Meta::TypeConstraint objects with added features our $VERSION = '0.46'; use Carp::Clan '^MooseX::Types'; use Moose::Util::TypeConstraints (); use Moose::Meta::TypeConstraint::Union; use Scalar::Util qw(blessed); use namespace::autoclean 0.16; use overload( '0+' => sub { my $self = shift @_; my $tc = $self->{__type_constraint}; return 0+$tc; }, # workaround for perl 5.8.5 bug '==' => sub { 0+$_[0] == 0+$_[1] }, '""' => sub { my $self = shift @_; if(blessed $self) { return $self->__type_constraint->name; } else { return "$self"; } }, bool => sub { 1 }, '|' => sub { ## It's kind of ugly that we need to know about Union Types, but this ## is needed for syntax compatibility. Maybe someday we'll all just do ## Or[Str,Str,Int] my @args = @_[0,1]; ## arg 3 is special, see the overload docs. my @tc = grep {blessed $_} map { blessed $_ ? $_ : Moose::Util::TypeConstraints::find_or_parse_type_constraint($_) || __PACKAGE__->_throw_error( "$_ is not a type constraint") } @args; ( scalar @tc == scalar @args) || __PACKAGE__->_throw_error( "one of your type constraints is bad. Passed: ". join(', ', @args) ." Got: ". join(', ', @tc)); ( scalar @tc >= 2 ) || __PACKAGE__->_throw_error("You must pass in at least 2 type names to make a union"); my $union = Moose::Meta::TypeConstraint::Union->new(type_constraints=>\@tc); return Moose::Util::TypeConstraints::register_type_constraint($union); }, fallback => 1, ); #pod =head1 DESCRIPTION #pod #pod This is a decorator object that contains an underlying type constraint. We use #pod this to control access to the type constraint and to add some features. #pod #pod =head1 METHODS #pod #pod This class defines the following methods. #pod #pod =head2 new #pod #pod Old school instantiation #pod #pod =cut sub new { my $proto = shift; if (ref($proto)) { return $proto->_try_delegate('new', @_); } my $class = $proto; if(my $arg = shift @_) { if(blessed $arg && $arg->isa('Moose::Meta::TypeConstraint')) { return bless {'__type_constraint'=>$arg}, $class; } elsif( blessed $arg && $arg->isa('MooseX::Types::UndefinedType') ) { ## stub in case we'll need to handle these types differently return bless {'__type_constraint'=>$arg}, $class; } elsif(blessed $arg) { __PACKAGE__->_throw_error("Argument must be ->isa('Moose::Meta::TypeConstraint') or ->isa('MooseX::Types::UndefinedType'), not ". blessed $arg); } else { __PACKAGE__->_throw_error("Argument cannot be '$arg'"); } } else { __PACKAGE__->_throw_error("This method [new] requires a single argument."); } } #pod =head2 __type_constraint ($type_constraint) #pod #pod Set/Get the type_constraint. #pod #pod =cut sub __type_constraint { my $self = shift @_; if(blessed $self) { if(defined(my $tc = shift @_)) { $self->{__type_constraint} = $tc; } return $self->{__type_constraint}; } else { __PACKAGE__->_throw_error('cannot call __type_constraint as a class method'); } } #pod =head2 C #pod #pod handle C<< $self->isa >> since C can't - this tries both the type constraint, #pod and for a class type, the class. #pod #pod =cut sub isa { my $self = shift; return blessed $self ? $self->__type_constraint->isa(@_) || $self->_try_delegate( 'isa', @_ ) : $self->SUPER::isa(@_); } #pod =head2 can #pod #pod handle $self->can since AUTOLOAD can't. #pod #pod =cut sub can { my $self = shift; return blessed $self ? $self->_try_delegate( 'can', @_ ) : $self->SUPER::can(@_); } #pod =head2 _throw_error #pod #pod properly delegate error messages #pod #pod =cut sub _throw_error { shift; require Moose; unshift @_, 'Moose'; goto &Moose::throw_error; } #pod =head2 DESTROY #pod #pod We might need it later #pod #pod =cut sub DESTROY { return; } #pod =head2 AUTOLOAD #pod #pod Delegate to the decorator target, unless this is a class type, in which #pod case it will try to delegate to the type object, then if that fails try #pod the class. The method 'new' is special cased to only be permitted on #pod the class; if there is no class, or it does not provide a new method, #pod an exception will be thrown. #pod #pod =cut sub AUTOLOAD { my ($self, @args) = @_; my ($method) = (our $AUTOLOAD =~ /([^:]+)$/); ## We delegate with this method in an attempt to support a value of ## __type_constraint which is also AUTOLOADing, in particular the class ## MooseX::Types::UndefinedType which AUTOLOADs during autovivication. $self->_try_delegate($method, @args); } sub _try_delegate { my ($self, $method, @args) = @_; my $tc = $self->__type_constraint; my $class; if ($tc->can('is_subtype_of')) { # Union can't my $search_tc = $tc; while (1) { if ($search_tc->isa('Moose::Meta::TypeConstraint::Class')) { $class = $search_tc->class; last; } $search_tc = $search_tc->parent; last unless $search_tc && $search_tc->is_subtype_of('Object'); } } my $inv = do { if ($method eq 'new') { die "new called on type decorator for non-class-type ".$tc->name unless $class; die "new called on class type decorator ".$tc->name."\n" ." for class ${class}\n" ." which does not provide a new method - did you forget to load it?" unless $class->can('new'); $class } elsif ($class && !$tc->can($method)) { $class } else { $tc } }; $inv->$method(@args); } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::TypeDecorator - Wraps Moose::Meta::TypeConstraint objects with added features =head1 VERSION version 0.46 =head1 DESCRIPTION This is a decorator object that contains an underlying type constraint. We use this to control access to the type constraint and to add some features. =head1 METHODS This class defines the following methods. =head2 new Old school instantiation =head2 __type_constraint ($type_constraint) Set/Get the type_constraint. =head2 C handle C<< $self->isa >> since C can't - this tries both the type constraint, and for a class type, the class. =head2 can handle $self->can since AUTOLOAD can't. =head2 _throw_error properly delegate error messages =head2 DESTROY We might need it later =head2 AUTOLOAD Delegate to the decorator target, unless this is a class type, in which case it will try to delegate to the type object, then if that fails try the class. The method 'new' is special cased to only be permitted on the class; if there is no class, or it does not provide a new method, an exception will be thrown. =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/UndefinedType.pm000644 000766 000024 00000007703 12563756310 022436 0ustar00etherstaff000000 000000 use warnings; use strict; package MooseX::Types::UndefinedType; # ABSTRACT: a fallback type for when a type cannot be found our $VERSION = '0.46'; use Moose::Util::TypeConstraints (); use Carp::Clan '^MooseX::Types'; use namespace::autoclean 0.16; use overload '""' => sub { shift->name }, fallback => 1; #pod =head1 DESCRIPTION #pod #pod Whenever a type handle function (e.g. C can't find a type #pod constraint under its full name, it assumes it has not yet been defined. #pod It will then return an instance of this class, handling only #pod stringification, name and possible identification of undefined types. #pod #pod Later, when you try to use the Undefined Type Constraint, autovivification will #pod be attempted. #pod #pod =head1 METHODS #pod #pod =head2 new #pod #pod Takes a full type name as argument and returns an instance of this #pod class. #pod #pod =cut sub new { return bless { name => $_[1] }, $_[0]; } #pod =head2 name #pod #pod Returns the stored type name. #pod #pod =cut sub name { return $_[0]->{name}; } #pod =head2 __autovivify #pod #pod Try to see if the type constraint has yet been defined and if so create it. #pod #pod =cut sub __autovivify { my ($self) = @_; if(my $tc = $self->{instance}) { return $tc; } elsif( my $new_tc = Moose::Util::TypeConstraints::find_type_constraint($self->name)) { $self->{instance} = $new_tc; return $new_tc; } else { return; } } #pod =head2 can_be_inlined #pod #pod Make sure that if a type hasn't been defined yet when Moose wants to inline it, #pod we don't allow inlining. #pod #pod =cut sub can_be_inlined { my $self = shift; if(my $type_constraint = $self->__autovivify) { return $type_constraint->can_be_inlined; } else { return; } } #pod =head2 AUTOLOAD #pod #pod Try to autovivify and delegate #pod #pod =cut sub AUTOLOAD { my ($self, @args) = @_; my ($method) = our $AUTOLOAD =~ /([^:]+)$/; if(my $type_constraint = $self->__autovivify) { return $type_constraint->$method(@args); } else { croak "Method '$method' is not supported for " . $self->name; } } #pod =head2 DESTROY #pod #pod Moose::Meta::TypeConstraint::Parameterizable complains if this isn't here. TODO #pod to find out why. #pod #pod =cut sub DESTROY { return; } #pod =head1 SEE ALSO #pod #pod L, #pod L, #pod L, #pod L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::UndefinedType - a fallback type for when a type cannot be found =head1 VERSION version 0.46 =head1 DESCRIPTION Whenever a type handle function (e.g. C can't find a type constraint under its full name, it assumes it has not yet been defined. It will then return an instance of this class, handling only stringification, name and possible identification of undefined types. Later, when you try to use the Undefined Type Constraint, autovivification will be attempted. =head1 METHODS =head2 new Takes a full type name as argument and returns an instance of this class. =head2 name Returns the stored type name. =head2 __autovivify Try to see if the type constraint has yet been defined and if so create it. =head2 can_be_inlined Make sure that if a type hasn't been defined yet when Moose wants to inline it, we don't allow inlining. =head2 AUTOLOAD Try to autovivify and delegate =head2 DESTROY Moose::Meta::TypeConstraint::Parameterizable complains if this isn't here. TODO to find out why. =head1 SEE ALSO L, L, L, L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/Util.pm000644 000766 000024 00000010055 12563756310 020602 0ustar00etherstaff000000 000000 use warnings; use strict; package MooseX::Types::Util; # ABSTRACT: Common utility functions for the distribution our $VERSION = '0.46'; use Scalar::Util 'blessed'; use base 'Exporter'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This package the exportable functions that many parts in #pod L might need. #pod #pod =cut our @EXPORT_OK = qw( filter_tags has_available_type_export ); #pod =head1 FUNCTIONS #pod #pod =head2 filter_tags #pod #pod Takes a list and returns two references. The first is a hash reference #pod containing the tags as keys and the number of their appearance as values. #pod The second is an array reference containing all other elements. #pod #pod =cut sub filter_tags { my (@list) = @_; my (%tags, @other); for (@list) { if (/^:(.*)$/) { $tags{ $1 }++; next; } push @other, $_; } return \%tags, \@other; } #pod =head2 has_available_type_export #pod #pod TypeConstraint | Undef = has_available_type_export($package, $name); #pod #pod This function allows you to introspect if a given type export is available #pod I. This means that the C<$package> must have imported #pod a type constraint with the name C<$name>, and it must be still in its symbol #pod table. #pod #pod Two arguments are expected: #pod #pod =over 4 #pod #pod =item $package #pod #pod The name of the package to introspect. #pod #pod =item $name #pod #pod The name of the type export to introspect. #pod #pod =back #pod #pod B that the C<$name> is the I name of the type, not the declared #pod one. This means that if you use Ls functionality to rename an import #pod like this: #pod #pod use MyTypes Str => { -as => 'MyStr' }; #pod #pod you would have to introspect this type like this: #pod #pod has_available_type_export $package, 'MyStr'; #pod #pod The return value will be either the type constraint that belongs to the export #pod or an undefined value. #pod #pod =cut sub has_available_type_export { my ($package, $name) = @_; my $sub = $package->can($name) or return undef; return undef unless blessed $sub && $sub->isa('MooseX::Types::EXPORTED_TYPE_CONSTRAINT'); return $sub->(); } #pod =head1 SEE ALSO #pod #pod L, L #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::Util - Common utility functions for the distribution =head1 VERSION version 0.46 =head1 DESCRIPTION This package the exportable functions that many parts in L might need. =head1 FUNCTIONS =head2 filter_tags Takes a list and returns two references. The first is a hash reference containing the tags as keys and the number of their appearance as values. The second is an array reference containing all other elements. =head2 has_available_type_export TypeConstraint | Undef = has_available_type_export($package, $name); This function allows you to introspect if a given type export is available I. This means that the C<$package> must have imported a type constraint with the name C<$name>, and it must be still in its symbol table. Two arguments are expected: =over 4 =item $package The name of the package to introspect. =item $name The name of the type export to introspect. =back B that the C<$name> is the I name of the type, not the declared one. This means that if you use Ls functionality to rename an import like this: use MyTypes Str => { -as => 'MyStr' }; you would have to introspect this type like this: has_available_type_export $package, 'MyStr'; The return value will be either the type constraint that belongs to the export or an undefined value. =head1 SEE ALSO L, L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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-Types-0.46/lib/MooseX/Types/Wrapper.pm000644 000766 000024 00000002727 12563756310 021314 0ustar00etherstaff000000 000000 package MooseX::Types::Wrapper; # ABSTRACT: Wrap exports from a library our $VERSION = '0.46'; use Moose; use Carp::Clan qw( ^MooseX::Types ); use Module::Runtime 'use_module'; use namespace::autoclean; extends 'MooseX::Types'; #pod =head1 DESCRIPTION #pod #pod See L for detailed usage. #pod #pod =head1 METHODS #pod #pod =head2 import #pod #pod =cut sub import { my ($class, @args) = @_; my %libraries = @args == 1 ? (Moose => $args[0]) : @args; for my $l (keys %libraries) { croak qq($class expects an array reference as import spec) unless ref $libraries{ $l } eq 'ARRAY'; my $library_class = ($l eq 'Moose' ? 'MooseX::Types::Moose' : $l ); use_module($library_class); $library_class->import({ -into => scalar(caller), -wrapper => $class, }, @{ $libraries{ $l } }); } return 1; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Types::Wrapper - Wrap exports from a library =head1 VERSION version 0.46 =head1 DESCRIPTION See L for detailed usage. =head1 METHODS =head2 import =head1 SEE ALSO L =head1 AUTHOR Robert "phaylon" Sedlacek =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. 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