Any-Moose-0.21/000755 000765 000024 00000000000 12114415752 013675 5ustar00sartakstaff000000 000000 Any-Moose-0.21/Changes000644 000765 000024 00000006235 12114415752 015176 0ustar00sartakstaff000000 000000 0.21 2013-03-02 * Add tokuhirom's translation of the deprecation notice 0.20 2012-12-30 * Documentation fixes 0.19 2012-12-30 * Deprecated in favor of Moo. Good night, sweet prince. 0.18 2011-11-07 * Try to cope with broken smokers better by recording a Moose prereq when it is used. (Chris Williams) - see https://rt.cpan.org/Public/Bug/Display.html?id=72043 0.17 2011-09-16 * Better indicate that this module is dynamically configured. - fixes [rt.cpan.org #70996] 0.16 2011-09-15 * If you have Moose installed you no longer get the Mouse dependency (rjbs, reported by andk) Any::Moose has long had both runtime and test support for Moose without Mouse, but the toolchain has not, until recently, been good enough to handle alternatives. This change is designed to affect very few people. - fixes [rt.cpan.org #70597] 0.15 2011-06-07 * Standardize the tests' Mouse/Moose loading eval/skip code (Sartak, reported by Daniel Macks) - fixes [rt.cpan.org #68657] 0.14 2011-04-29 * Skip t/004-x-modules-mouse.t if you don't have MouseX::Types 0.03 since older versions do not work with modern Mouse (Sartak, reported by ewilhelm) 0.13 Wed 19 May 2010 * Add load_first_existing_class (gfx) 0.12 Fri 02 Apr 2010 * t/000-version.t for better diagnostics (tokuhirom) * Slight performance improvements for is_class_loaded, lazily loading Carp, etc (Sartak) * Start some real documentation (Sartak) * Document $ENV{ANY_MOOSE} (Sartak) - fixes [rt.cpan.org #52339] * Test that Moose is loaded, not CMOP (Sartak) - fixes [rt.cpan.org #56093] * Alias class_of and more functions (Sartak) - requested by [rt.cpan.org #52275] 0.11 Sun 19 Dec 2009 * Support "use Any::Moose '::Util::TypeConstraints'" (gfx) * Support "no Any::Moose '::Util::TypeConstraints'" (gfx) * $@ related fixes (gfx) * Documentation and other minor improvements (gfx) * Any::Moose should now work when you have Moose but not Mouse. Still need to work out how to encode this in the installation system (Sartak) 0.10 Fri 19 Jun 2009 * Fix META.yml 0.09 Tue 19 May 2009 * Depend on Mouse 0.21. 0.08 Mon 18 May 2009 * Add moose_is_preferred and mouse_is_preferred functions for when you need to care about which backend is in use (Sartak) * Deprecate the internal is_moose_loaded in favor of moose_is_preferred (Sartak) 0.07 Fri, 10 Apr 2009 * Depend on Mouse 0.20 for better compatibility with Moose >= 0.74 (rafl). 0.06 Wed, 18 Mar 2009 * Add Any::Moose::is_class_loaded. (tokuhirom) 0.05 Wed, 25 Feb 2009 * Stop using ambiguous ways of creating named subtypes in the tests. This makes them pass again with Moose >= 0.72. (rafl) 0.04 Tue, 17 Feb 2009 * Any::Moose now gives you strict and warnings (oops!) * Support "use Any::Moose 'X::Types'" (tokuhirom) 0.03 Mon, 09 Feb 2009 * When we load one of Mo*se, we'll continue to load that backer even if Moose had become loaded * Skip some tests if Moose is not installed * Hard dependency on Mouse 0.02 Sun, 08 Feb 2009 * Fix compilation error (rafl) * Add load_class and is_moose_loaded (stevan) 0.01 Sun, 05 Feb 2009 * Initial release Any-Moose-0.21/devel/000755 000765 000024 00000000000 12114415752 014774 5ustar00sartakstaff000000 000000 Any-Moose-0.21/dist.ini000644 000765 000024 00000001066 12114415752 015344 0ustar00sartakstaff000000 000000 name = Any-Moose version = 0.21 author = Shawn M Moore author = Florian Ragwitz author = Stevan Little author = Tokuhiro Matsuno author = Goro Fuji author = Ricardo Signes license = Perl_5 copyright_holder = Best Practical Solutions [@Filter] bundle = @Classic remove = PodVersion remove = MakeMaker [=inc::MakeMaker] ; authordep Dist::Zilla::Plugin::MakeMaker::Awesome [Meta::Dynamic::Config] [PodWeaver] [Prereqs] perl = 5.006_002 Any-Moose-0.21/inc/000755 000765 000024 00000000000 12114415752 014446 5ustar00sartakstaff000000 000000 Any-Moose-0.21/lib/000755 000765 000024 00000000000 12114415752 014443 5ustar00sartakstaff000000 000000 Any-Moose-0.21/LICENSE000644 000765 000024 00000043717 12114415752 014716 0ustar00sartakstaff000000 000000 This software is copyright (c) 2013 by Best Practical Solutions. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 by Best Practical Solutions. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 by Best Practical Solutions. 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 Any-Moose-0.21/Makefile.PL000644 000765 000024 00000003256 12114415752 015655 0ustar00sartakstaff000000 000000 # This Makefile.PL for was generated by Dist::Zilla. # Don't edit it but the dist.ini used to construct it. BEGIN { require 5.006_002; } use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( 'ABSTRACT' => '*deprecated* - use Moo instead!', 'AUTHOR' => 'Shawn M Moore , Florian Ragwitz , Stevan Little , Tokuhiro Matsuno , Goro Fuji , Ricardo Signes ', 'BUILD_REQUIRES' => {}, 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.30' }, 'DISTNAME' => 'Any-Moose', 'EXE_FILES' => [], 'LICENSE' => 'perl', 'NAME' => 'Any::Moose', 'PREREQ_PM' => {}, 'VERSION' => '0.21', 'test' => { 'TESTS' => 't/*.t' } ); ; $WriteMakefileArgs{PREREQ_PM} ||= {}; if (eval { require Moose }) { # we have any version of Moose; good enough! -- rjbs, 2011-09-15 # This should fix a crufty edge-case with cpantesting -- bingos, 2011-11-07 $WriteMakefileArgs{PREREQ_PM}{Moose} = '0'; } else { # No Moose? Well, we need *something* to test with, so we'll ask for the # lighter-weight one, Mouse. -- rjbs, 2011-09-15 $WriteMakefileArgs{PREREQ_PM}{Mouse} = '0.40'; } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Any-Moose-0.21/MANIFEST000644 000765 000024 00000001121 12114415752 015021 0ustar00sartakstaff000000 000000 Changes LICENSE MANIFEST META.yml Makefile.PL README devel/test-combos.pl dist.ini inc/MakeMaker.pm lib/Any/Moose.pm t/000-version.t t/001-basic-moose.t t/001-basic-mouse.t t/001-basic.t t/002-other-modules-moose.t t/002-other-modules-mouse.t t/003-is_moose_loaded.t t/004-x-modules-moose.t t/004-x-modules-mouse.t t/005-aliases-moose.t t/005-aliases-mouse.t t/010-use_mouse_roles.t t/011-use_moose_roles.t t/012-use_moose_util.t t/012-use_mouse_util.t t/020-strict.t t/100-canonicalize-fragments.t t/101-localize-errvar.t t/lib/AnyMooseTest.pm t/release-pod-coverage.t t/release-pod-syntax.t Any-Moose-0.21/META.yml000644 000765 000024 00000001163 12114415752 015147 0ustar00sartakstaff000000 000000 --- abstract: '*deprecated* - use Moo instead!' author: - 'Shawn M Moore ' - 'Florian Ragwitz ' - 'Stevan Little ' - 'Tokuhiro Matsuno ' - 'Goro Fuji ' - 'Ricardo Signes ' build_requires: {} configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 1 generated_by: 'Dist::Zilla version 4.300030, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Any-Moose requires: perl: 5.006_002 version: 0.21 Any-Moose-0.21/README000644 000765 000024 00000000461 12114415752 014556 0ustar00sartakstaff000000 000000 This archive contains the distribution Any-Moose, version 0.21: *deprecated* - use Moo instead! This software is copyright (c) 2013 by Best Practical Solutions. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Any-Moose-0.21/t/000755 000765 000024 00000000000 12114415752 014140 5ustar00sartakstaff000000 000000 Any-Moose-0.21/t/000-version.t000644 000765 000024 00000000566 12114415752 016316 0ustar00sartakstaff000000 000000 use strict; use Test::More tests => 1; use_ok 'Any::Moose'; show_version($_) for qw/ Mouse MouseX::Types Moose Class::MOP MooseX::Types /; sub show_version { my $klass = shift; if (eval "use $klass (); 1") { no strict 'refs'; diag "$klass: " . ${"${klass}::VERSION"}; } else { diag "$klass unavailable: $@"; } } Any-Moose-0.21/t/001-basic-moose.t000644 000765 000024 00000001575 12114415752 017034 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; plan tests => 9; } do { package Moosed::Any::Moose; use Any::Moose; ::ok(__PACKAGE__->can('meta'), 'Mo*se was installed'); ::like(__PACKAGE__->meta, qr/^Moose/, 'Moose was installed'); ::is(any_moose, 'Moose'); ::is(any_moose('::Util::TypeConstraints'), 'Moose::Util::TypeConstraints'); ::is(any_moose, 'Moose', 'still Moose even if Moose is loaded'); no Any::Moose; }; ok(!Moosed::Any::Moose->can('has'), "has was unimported"); do { package After::Moose; use Any::Moose; ::is(any_moose, 'Moose'); ::is(any_moose('::Util::TypeConstraints'), 'Moose::Util::TypeConstraints'); no Any::Moose; }; ok(!After::Moose->can('has'), "has was unimported"); Any-Moose-0.21/t/001-basic-mouse.t000644 000765 000024 00000001756 12114415752 017043 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 9; } do { package Moused::Any::Moose; use Any::Moose; ::ok(__PACKAGE__->can('meta'), 'Mo*se was installed'); ::like(__PACKAGE__->meta, qr/^Mouse/, 'Mouse was installed'); ::is(any_moose, 'Mouse'); ::is(any_moose('::Util::TypeConstraints'), 'Mouse::Util::TypeConstraints'); ::is(any_moose, 'Mouse', 'still Mouse even if Moose is loaded'); no Any::Moose; }; ok(!Moused::Any::Moose->can('has'), "has was unimported"); SKIP: { eval 'use Moose ()'; skip "Moose unavailable: $@" => 3 if $@; do { package After::Moose; use Any::Moose; ::is(any_moose, 'Mouse'); ::is(any_moose('::Util::TypeConstraints'), 'Mouse::Util::TypeConstraints'); no Any::Moose; }; ok(!After::Moose->can('has'), "has was unimported"); } Any-Moose-0.21/t/001-basic.t000644 000765 000024 00000000730 12114415752 015704 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; do { package Point; use Any::Moose; has ['x', 'y'] => ( is => 'rw', isa => 'Int', ); sub BUILDARGS { my ($class, $x, $y) = @_; return { x => $x, y => $y }; } }; my $origin = Point->new(0, 0); is($origin->x, 0); is($origin->y, 0); my $aa = Point->new(1, 1); is($aa->x, 1); is($aa->y, 1); $aa->x(-1); is($aa->x, -1); is($aa->y, 1); done_testing; Any-Moose-0.21/t/002-other-modules-moose.t000644 000765 000024 00000001354 12114415752 020536 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; plan tests => 2; } do { package Moosed::Any::Moose; use Any::Moose; use Any::Moose '::Util::TypeConstraints' => ['subtype', 'as']; subtype 'XYZ' => as 'Int'; ::ok(Moose::Util::TypeConstraints::find_type_constraint('XYZ'), 'subtype used Moose'); }; do { package After::Moose; use Any::Moose; use Any::Moose '::Util::TypeConstraints'; use Any::Moose '::Util::TypeConstraints' => ['subtype', 'as']; subtype 'ABC' => as 'Int'; ::ok(Moose::Util::TypeConstraints::find_type_constraint('ABC'), 'subtype used Moose'); }; Any-Moose-0.21/t/002-other-modules-mouse.t000644 000765 000024 00000001536 12114415752 020546 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 2; } do { package Moused::Any::Moose; use Any::Moose; use Any::Moose '::Util::TypeConstraints' => ['subtype', 'as']; subtype 'XYZ' => as 'Int'; ::ok(Mouse::Util::TypeConstraints::find_type_constraint('XYZ'), 'subtype used Mouse'); }; SKIP: { eval 'use Moose ()'; skip "Moose unavailable: $@" => 1 if $@; do { package After::Moose; use Any::Moose; use Any::Moose '::Util::TypeConstraints'; use Any::Moose '::Util::TypeConstraints' => ['subtype', 'as']; subtype 'ABC' => as 'Int'; ::ok(Mouse::Util::TypeConstraints::find_type_constraint('ABC'), 'subtype used Mouse'); }; }; Any-Moose-0.21/t/003-is_moose_loaded.t000644 000765 000024 00000001052 12114415752 017750 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 3; } package Test; BEGIN { ::use_ok('Any::Moose'); ::ok(!Any::Moose::_is_moose_loaded(), '... Moose is not loaded'); } { package Foo; BEGIN { SKIP: { eval 'use Moose ()'; ::skip "Moose unavailable: $@", 1 if $@; ::ok(Any::Moose::_is_moose_loaded(), '... Moose is loaded'); } } } Any-Moose-0.21/t/004-x-modules-moose.t000644 000765 000024 00000001121 12114415752 017656 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; eval 'use MooseX::Types ()'; plan skip_all => "Moose::Types unavailable: $@" if $@; plan tests => 2; } do { package Moosed::Any::Moose; use Any::Moose; use Any::Moose 'X::Types'; ::ok(MooseX::Types->can('import'), 'MooseX::Types'); }; do { package After::Moose; use Any::Moose; use Any::Moose 'X::Types'; ::ok(MooseX::Types->can('import'), 'MooseX::Types'); }; Any-Moose-0.21/t/004-x-modules-mouse.t000644 000765 000024 00000001430 12114415752 017667 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; eval 'use MouseX::Types 0.03'; plan skip_all => "Mouse::Types 0.03 unavailable: $@" if $@; plan tests => 2; } do { package Moused::Any::Moose; use Any::Moose; use Any::Moose 'X::Types'; ::ok(MouseX::Types->can('import'), 'MouseX::Types'); }; SKIP: { eval 'use Moose ()'; skip "Moose unavailable: $@" => 1 if $@; eval 'use MooseX::Types ()'; skip "MooseX::Types unavailable: $@" => 1 if $@; do { package After::Moose; use Any::Moose; use Any::Moose 'X::Types'; ::ok(MouseX::Types->can('import'), 'MouseX::Types'); }; }; Any-Moose-0.21/t/005-aliases-moose.t000644 000765 000024 00000004062 12114415752 017372 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; plan tests => 21; } package MyClass; use Any::Moose; package main; ok(Any::Moose::is_class_loaded('Moose'), 'Moose is loaded'); ok(Any::Moose::is_class_loaded('MyClass'), 'MyClass is loaded'); ok(!Any::Moose::is_class_loaded('NonexistentPackage'), 'NonexistentPackage is not loaded'); push @INC, 't/lib'; ok(!Any::Moose::is_class_loaded('AnyMooseTest'), 'AnyMooseTest not yet loaded'); ok(Any::Moose::load_class('AnyMooseTest'), 'Loading AnyMooseTest'); ok(Any::Moose::is_class_loaded('AnyMooseTest'), 'AnyMooseTest now loaded'); is(eval { Any::Moose::load_class('NonexistentTest'); 1 }, undef, 'load_class on nonexistent module fails'); ok(!Any::Moose::is_class_loaded('NonexistentTest'), 'and it is still not loaded'); like(Any::Moose::class_of('MyClass'), qr/Moose::Meta::Class=HASH/, 'metaclass check'); is(Any::Moose::class_of('NonexistentTest'), undef, 'class_of nonexistent class is undef'); like(Any::Moose::class_of(MyClass->new), qr/Moose::Meta::Class=HASH/, 'metaclass check via object'); like(Any::Moose::get_metaclass_by_name('MyClass'), qr/Moose::Meta::Class=HASH/, 'metaclass check'); is(Any::Moose::get_metaclass_by_name('NonexistentTest'), undef, 'class_of nonexistent class is undef'); is(Any::Moose::get_metaclass_by_name(MyClass->new), undef, 'get_metaclass_by_name via object returns undef'); my %metaclasses = map { $_->name => $_ } Any::Moose::get_all_metaclass_instances(); is($metaclasses{MyClass}, MyClass->meta); is($metaclasses{AnyMooseTest}, AnyMooseTest->meta); is($metaclasses{NonexistentTest}, undef); is((grep { $_ eq 'MyClass' } Any::Moose::get_all_metaclass_names()), 1); is((grep { $_ eq 'AnyMooseTest' } Any::Moose::get_all_metaclass_names()), 1); is((grep { $_ eq 'NonexistentTest' } Any::Moose::get_all_metaclass_names()), 0); my $c = Any::Moose::load_first_existing_class('Any::Moose::No::Such::Module', 'strict'); is $c, 'strict', 'load_first_existing_class'; Any-Moose-0.21/t/005-aliases-mouse.t000644 000765 000024 00000004062 12114415752 017400 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 21; } package MyClass; use Any::Moose; package main; ok(Any::Moose::is_class_loaded('Mouse'), 'Mouse is loaded'); ok(Any::Moose::is_class_loaded('MyClass'), 'MyClass is loaded'); ok(!Any::Moose::is_class_loaded('NonexistentPackage'), 'NonexistentPackage is not loaded'); push @INC, 't/lib'; ok(!Any::Moose::is_class_loaded('AnyMooseTest'), 'AnyMooseTest not yet loaded'); ok(Any::Moose::load_class('AnyMooseTest'), 'Loading AnyMooseTest'); ok(Any::Moose::is_class_loaded('AnyMooseTest'), 'AnyMooseTest now loaded'); is(eval { Any::Moose::load_class('NonexistentTest'); 1 }, undef, 'load_class on nonexistent module fails'); ok(!Any::Moose::is_class_loaded('NonexistentTest'), 'and it is still not loaded'); like(Any::Moose::class_of('MyClass'), qr/Mouse::Meta::Class=HASH/, 'metaclass check'); is(Any::Moose::class_of('NonexistentTest'), undef, 'class_of nonexistent class is undef'); like(Any::Moose::class_of(MyClass->new), qr/Mouse::Meta::Class=HASH/, 'metaclass check via object'); like(Any::Moose::get_metaclass_by_name('MyClass'), qr/Mouse::Meta::Class=HASH/, 'metaclass check'); is(Any::Moose::get_metaclass_by_name('NonexistentTest'), undef, 'class_of nonexistent class is undef'); is(Any::Moose::get_metaclass_by_name(MyClass->new), undef, 'get_metaclass_by_name via object returns undef'); my %metaclasses = map { $_->name => $_ } Any::Moose::get_all_metaclass_instances(); is($metaclasses{MyClass}, MyClass->meta); is($metaclasses{AnyMooseTest}, AnyMooseTest->meta); is($metaclasses{NonexistentTest}, undef); is((grep { $_ eq 'MyClass' } Any::Moose::get_all_metaclass_names()), 1); is((grep { $_ eq 'AnyMooseTest' } Any::Moose::get_all_metaclass_names()), 1); is((grep { $_ eq 'NonexistentTest' } Any::Moose::get_all_metaclass_names()), 0); my $c = Any::Moose::load_first_existing_class('Any::Moose::No::Such::Module', 'strict'); is $c, 'strict', 'load_first_existing_class'; Any-Moose-0.21/t/010-use_mouse_roles.t000644 000765 000024 00000000464 12114415752 020037 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 1; } { package My::Role; use Any::Moose '::Role'; } isa_ok(My::Role->meta, 'Mouse::Meta::Role'); Any-Moose-0.21/t/011-use_moose_roles.t000644 000765 000024 00000000463 12114415752 020031 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; plan tests => 1; } { package My::Role; use Any::Moose '::Role'; } isa_ok(My::Role->meta, 'Moose::Meta::Role'); Any-Moose-0.21/t/012-use_moose_util.t000644 000765 000024 00000000616 12114415752 017663 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Moose ()'; plan skip_all => "Moose unavailable: $@" if $@; plan tests => 2; } { package My::Package; use Any::Moose '::Util::TypeConstraints' => [qw(type)]; ::ok defined(&type); no Any::Moose '::Util::TypeConstraints'; } ok !My::Package->can('type'); Any-Moose-0.21/t/012-use_mouse_util.t000644 000765 000024 00000000616 12114415752 017671 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { eval 'use Mouse ()'; plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 2; } { package My::Package; use Any::Moose '::Util::TypeConstraints' => [qw(type)]; ::ok defined(&type); no Any::Moose '::Util::TypeConstraints'; } ok !My::Package->can('type'); Any-Moose-0.21/t/020-strict.t000644 000765 000024 00000000376 12114415752 016142 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use Test::More tests => 1; do { package Need::Strict; use Any::Moose; eval { my $foo = "ack!"; my $bar = '$foo'; my $garbage = $$bar; }; ::ok($@, "Any::Moose gives you strictures"); }; Any-Moose-0.21/t/100-canonicalize-fragments.t000644 000765 000024 00000001536 12114415752 021253 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More; require Any::Moose; BEGIN { delete $ENV{ANY_MOOSE} } my @tests = ( '' => 'Moose', 'Moose' => 'Moose', 'Mouse' => 'Moose', 'Moose::Util' => 'Moose::Util', 'Mouse::Util' => 'Moose::Util', '::Util' => 'Moose::Util', 'Util' => 'Moose::Util', 'MooseX::Types' => 'MooseX::Types', 'MouseX::Types' => 'MooseX::Types', 'X::Types' => 'MooseX::Types', 'Moose::X::Types' => 'Moose::X::Types', 'Mouse::X::Types' => 'Moose::X::Types', '::X::Types' => 'Moose::X::Types', ); plan tests => @tests / 2; while (my ($fragment, $expected) = splice @tests, 0, 2) { my $got = Any::Moose::_canonicalize_fragment($fragment); is($got, $expected, "Canonicalized '$fragment'"); } Any-Moose-0.21/t/101-localize-errvar.t000644 000765 000024 00000000574 12114415752 017733 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Test::More tests => 3; use Any::Moose(); $@ = 'Foo'; Any::Moose::any_moose(); is $@, 'Foo', 'any_moose() does not clear $@'; { package X; Any::Moose->import; } is $@, 'Foo', 'Any::Moose->import does not clear $@'; { package X; Any::Moose->unimport; } is $@, 'Foo', 'Any::Moose->unimport does not clear $@'; Any-Moose-0.21/t/lib/000755 000765 000024 00000000000 12114415752 014706 5ustar00sartakstaff000000 000000 Any-Moose-0.21/t/release-pod-coverage.t000644 000765 000024 00000000765 12114415752 020326 0ustar00sartakstaff000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Any-Moose-0.21/t/release-pod-syntax.t000644 000765 000024 00000000450 12114415752 020050 0ustar00sartakstaff000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); Any-Moose-0.21/t/lib/AnyMooseTest.pm000644 000765 000024 00000000125 12114415752 017634 0ustar00sartakstaff000000 000000 package AnyMooseTest; use Any::Moose; has an_attribute => ( is => 'ro', ); 1; Any-Moose-0.21/lib/Any/000755 000765 000024 00000000000 12114415752 015172 5ustar00sartakstaff000000 000000 Any-Moose-0.21/lib/Any/Moose.pm000644 000765 000024 00000015072 12114415752 016617 0ustar00sartakstaff000000 000000 package Any::Moose; { $Any::Moose::VERSION = '0.21'; } # ABSTRACT: *deprecated* - use Moo instead! use 5.006_002; use strict; use warnings; # decide which backend to use our $PREFERRED; do { local $@; if ($ENV{ANY_MOOSE}) { $PREFERRED = $ENV{'ANY_MOOSE'}; warn "ANY_MOOSE is not set to Moose or Mouse" unless $PREFERRED eq 'Moose' || $PREFERRED eq 'Mouse'; # if we die here, then perl gives "unknown error" which doesn't tell # you what the problem is at all. argh. if ($PREFERRED eq 'Moose' && !eval { require Moose }) { warn "\$ANY_MOOSE is set to Moose but we cannot load it"; } elsif ($PREFERRED eq 'Mouse' && !eval { require Mouse }) { warn "\$ANY_MOOSE is set to Mouse but we cannot load it"; } } elsif (_is_moose_loaded()) { $PREFERRED = 'Moose'; } elsif (eval { require Mouse }) { $PREFERRED = 'Mouse'; } elsif (eval { require Moose }) { $PREFERRED = 'Moose'; } else { require Carp; warn "Unable to locate Mouse or Moose in INC"; } }; sub import { my $self = shift; my $pkg = caller; # Any::Moose gives you strict and warnings strict->import; warnings->import; # first options are for Mo*se unshift @_, 'Moose' if !@_ || ref($_[0]); while (my $module = shift) { my $options = @_ && ref($_[0]) ? shift : []; $options = $self->_canonicalize_options( module => $module, options => $options, package => $pkg, ); $self->_install_module($options); } # give them any_moose too no strict 'refs'; *{$pkg.'::any_moose'} = \&any_moose; } sub unimport { my $sel = shift; my $pkg = caller; my $module; if(@_){ $module = any_moose(shift, $pkg); } else { $module = _backer_of($pkg); } my $e = do{ local $@; eval "package $pkg;\n" . '$module->unimport();'; $@; }; if ($e) { require Carp; Carp::croak("Cannot unimport Any::Moose: $e"); } return; } sub _backer_of { my $pkg = shift; if(exists $INC{'Mouse.pm'}){ my $meta = Mouse::Util::get_metaclass_by_name($pkg); if ($meta) { return 'Mouse::Role' if $meta->isa('Mouse::Meta::Role'); return 'Mouse' if $meta->isa('Mouse::Meta::Class'); } } if (_is_moose_loaded()) { my $meta = Class::MOP::get_metaclass_by_name($pkg); if ($meta) { return 'Moose::Role' if $meta->isa('Moose::Meta::Role'); return 'Moose' if $meta->isa('Moose::Meta::Class'); } } return undef; } sub _canonicalize_options { my $self = shift; my %args = @_; my %options; if (ref($args{options}) eq 'HASH') { %options = %{ $args{options} }; } else { %options = ( imports => $args{options}, ); } $options{package} = $args{package}; $options{module} = any_moose($args{module}, $args{package}); return \%options; } sub _install_module { my $self = shift; my $options = shift; my $module = $options->{module}; (my $file = $module . '.pm') =~ s{::}{/}g; require $file; my $e = do { local $@; eval "package $options->{package};\n" . '$module->import(@{ $options->{imports} });'; $@; }; if ($e) { require Carp; Carp::croak("Cannot import Any::Moose: $e"); } return; } sub any_moose { my $fragment = _canonicalize_fragment(shift); my $package = shift || caller; # Mouse gets first dibs because it doesn't introspect existing classes my $backer = _backer_of($package) || ''; if ($backer =~ /^Mouse/) { $fragment =~ s/^Moose/Mouse/; return $fragment; } return $fragment if $backer =~ /^Moose/; $fragment =~ s/^Moose/Mouse/ if mouse_is_preferred(); return $fragment; } for my $name (qw/ load_class is_class_loaded class_of get_metaclass_by_name get_all_metaclass_instances get_all_metaclass_names load_first_existing_class /) { no strict 'refs'; *{__PACKAGE__."::$name"} = moose_is_preferred() ? *{"Class::MOP::$name"} : *{"Mouse::Util::$name"}; } sub moose_is_preferred { $PREFERRED eq 'Moose' } sub mouse_is_preferred { $PREFERRED eq 'Mouse' } sub _is_moose_loaded { exists $INC{'Moose.pm'} } sub is_moose_loaded { require Carp; Carp::carp("Any::Moose::is_moose_loaded is deprecated. Please use Any::Moose::moose_is_preferred instead"); goto \&_is_moose_loaded; } sub _canonicalize_fragment { my $fragment = shift; return 'Moose' if !$fragment; # any_moose("X::Types") -> any_moose("MooseX::Types") $fragment =~ s/^X::/MooseX::/; # any_moose("::Util") -> any_moose("Moose::Util") $fragment =~ s/^::/Moose::/; # any_moose("Mouse::Util") -> any_moose("Moose::Util") $fragment =~ s/^Mouse(X?)\b/Moose$1/; # any_moose("Util") -> any_moose("Moose::Util") $fragment =~ s/^(?!Moose)/Moose::/; return $fragment; } 1; =pod =head1 NAME Any::Moose - *deprecated* - use Moo instead! =head1 VERSION version 0.21 =head1 DEPRECATION 日本語翻訳: http://blog.64p.org/entry/2013/02/06/094906 Please use L instead of Any::Moose for new code. Moo classes and roles will transparently and correctly upgrade to Moose when needed. This is a fundamentally better design than what Any::Moose offers. Mouse metaclasses do not interact with Moose metaclasses which leaks abstractions all over the place. Any::Moose had a good run. It was a simplistic but expedient answer for getting Moose syntax on the cheap but with the transparent upgrade path to Moose when you needed it. But really, please don't use it any more. :) You may find L useful for porting your code from Any::Moose to Moo. For the sparse documentation Any::Moose used to include, see L =head1 AUTHORS =over 4 =item * Shawn M Moore =item * Florian Ragwitz =item * Stevan Little =item * Tokuhiro Matsuno =item * Goro Fuji =item * Ricardo Signes =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Best Practical Solutions. 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 __END__ Any-Moose-0.21/inc/MakeMaker.pm000644 000765 000024 00000001332 12114415752 016640 0ustar00sartakstaff000000 000000 package inc::MakeMaker; use Moose; extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; use namespace::autoclean; override _build_WriteMakefile_dump => sub { my ($self) = @_; my $str = super; $str .= ";\n\n"; $str .= <<'END_NONSENSE'; $WriteMakefileArgs{PREREQ_PM} ||= {}; if (eval { require Moose }) { # we have any version of Moose; good enough! -- rjbs, 2011-09-15 # This should fix a crufty edge-case with cpantesting -- bingos, 2011-11-07 $WriteMakefileArgs{PREREQ_PM}{Moose} = '0'; } else { # No Moose? Well, we need *something* to test with, so we'll ask for the # lighter-weight one, Mouse. -- rjbs, 2011-09-15 $WriteMakefileArgs{PREREQ_PM}{Mouse} = '0.40'; } END_NONSENSE return $str; }; 1; Any-Moose-0.21/devel/test-combos.pl000755 000765 000024 00000002066 12114415752 017577 0ustar00sartakstaff000000 000000 #!/usr/bin/env perl use 5.14.0; use warnings; use Data::PowerSet 'powerset'; my @all_modules = qw(Mouse MouseX::Types Moose MooseX::Types); my %results; for my $modules (@{ powerset(@all_modules) }) { my $list = join ',', @$modules; say '=' x 60; say "RUNNING WITHOUT $list"; say '=' x 60; $ENV{PERL5OPT} = "-MTest::Without::Module=$list"; system("prove"); my $result = $? >> 8 ? "NOT OK" : "OK"; push @{ $results{$result} }, $list; } for my $result (sort keys %results) { my @modules = @{ $results{$result} }; say "$result when testing without:"; say "* $_" for @modules; say ''; } __END__ ... test results ... NOT OK when testing without: * Mouse,MouseX::Types,Moose,MooseX::Types * Mouse,Moose,MooseX::Types * Mouse,MouseX::Types,Moose * Mouse,Moose OK when testing without: * MouseX::Types,Moose,MooseX::Types * Moose,MooseX::Types * Mouse,MouseX::Types,MooseX::Types * MouseX::Types,MooseX::Types * Mouse,MooseX::Types * MooseX::Types * MouseX::Types,Moose * Moose * Mouse,MouseX::Types * MouseX::Types * Mouse *