MooseX-Emulate-Class-Accessor-Fast-0.009032/0000755000000000000000000000000013316670123020372 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/LICENSE0000644000000000000000000004346113316670123021407 0ustar00rootwheel00000000000000Terms 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) 2018 by Guillermo Roditi (groditi) . 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) 2018 by Guillermo Roditi (groditi) . 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-Emulate-Class-Accessor-Fast-0.009032/Changes0000644000000000000000000000610213316670071021666 0ustar00rootwheel00000000000000Revision history for MooseX-Emulate-Class-Accessor-Fast 0.009032 - 2018-07-03 - Releasing as stable 0.009_031 - 2018-06-22 - Repackaged with ExtUtils::MakeMaker (and Distar) rather than Module::Install - enabled previously TODO test for attribute named meta 0.00903 Sept 15, 2009 - Silence a test warning from Moose 0.90 (Dave Rolsky). 0.00902 July 10, 2009 - Bump required Moose version to avoid issues with is => 'bare' when an older version of Moose is already installed. 0.00901 July 06, 2009 - Fix to not warn with newer versions of Moose by passing is => 'bare' to process_accessors method. 0.00900 May 29, 2009 - Fix so that classes which implement BUILD themselves still get all attributes passed to their constuctor placed into the instance hash (t0m) 0.00802 Apr 23, 2009 - Declare test dependency on Test::Exception. Closes RT#43194. (rafl) - Turn build_requires on Test::More into test_requires. (rafl) - Fix doc typos in SYNOPSIS. Closes RT#40380. (rafl) 0.00801 Apr 09, 2009 - Make the accessor meta method class compatible with recent Moose. - Stop using deprecated Moose api to avoid warnings. - Bump Moose dependency to 0.74. 0.00800 Feb 03, 2009 - Fix assigning a list to an accessor stores a list ref - tests - TODO test for Class::Accessor::Chained::Fast compatibility 0.00701 Jan 02, 2009 - Better errors when trying to modify an immutable class - Fix typo in Makefile.PL description - Missing dep in Makefile.PL (rafl) 0.00700 Dec 29, 2008 - Creating a new accessor with the same name as an old one would result in a new attribute with no reader/writer/accessor. Reported by t0m - tests (t0m) 0.00600 Dec 17, 2008 - Add test for a 'meta' accessor, which we need to treat as a special case (t0m) - Add test for not replacing pre-existing accessors generally, which is behavior we don't want to lose (t0m) - Don't use ->meta - Don't use ->can - Attempt to support attrs named meta with no success. test marked as todo. 0.00500 Dec 9, 2008 - make_accessor, make_ro_accessor, make_rw_accessor - tests 0.00400 Oct 28, 2008 - Fix bug where a bad assumption was causing us to infinitely loop on badly-written code like Data::Page. (Reported by marcus) - Tests for this - Up Moose dep to 0.31 0.00300 Jul 30, 2008 - Replace around 'new' with a BUILD method. Faster and avoids Moose bug with around/immutable and sub-classes. (t0m) 0.00200 Mar 28, 2008 - Extend BUILDALL to store constructor keys in the obj. hashref - Minor fix to make sure Adopt doesn't trip PAUSE perms - Bye bye auto_install. 0.00100 Mar 15, 2008 - Initial Release! MooseX-Emulate-Class-Accessor-Fast-0.009032/MANIFEST0000644000000000000000000000145213316670123021525 0ustar00rootwheel00000000000000Changes lib/MooseX/Adopt/Class/Accessor/Fast.pm lib/MooseX/Emulate/Class/Accessor/Fast.pm lib/MooseX/Emulate/Class/Accessor/Fast/Meta/Accessor.pm lib/MooseX/Emulate/Class/Accessor/Fast/Meta/Role/Attribute.pm maint/Makefile.PL.include Makefile.PL MANIFEST This list of files t/accessors.t t/adopt.t t/attr_named_meta.t t/BUILD_in_local_class.t t/class_accessor_chained_fast.t t/construction.t t/getset.t t/lib/TestAdoptCAF.pm t/list_assign.t t/no_replace_existing_symbols.t t/recreated_accessors.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) README README file (added by Distar) LICENSE LICENSE file (added by Distar) MooseX-Emulate-Class-Accessor-Fast-0.009032/t/0000755000000000000000000000000013316670122020634 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/t/getset.t0000644000000000000000000000166013313175254022322 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 9; require_ok("MooseX::Adopt::Class::Accessor::Fast"); { @Foo::ISA = qw(Class::Accessor::Fast); Foo->mk_accessors(qw( foo )); my $test = Foo->new({ foo => 49 }); is( $test->get('foo'), 49, "get initial foo"); $test->set('foo', 42); is($test->get('foo'), 42, "get new foo"); } { @Bar::ISA = qw(Class::Accessor::Fast); my $get_ref = Bar->make_ro_accessor('read'); my $set_ref = Bar->make_wo_accessor('write'); my $getset_ref = Bar->make_accessor('read_write'); ok(Bar->meta->has_attribute("read"),"has read"); ok(Bar->meta->has_attribute("write"),"has write"); ok(Bar->meta->has_attribute("read_write"),"has read_write"); my $obj = Bar->new({read => 1, write => 2, read_write => 3}); is($get_ref->($obj), 1, "read get works"); is($getset_ref->($obj), 3, "read_write get works"); $getset_ref->($obj,2); is($getset_ref->($obj), 2, "read_write set works"); } MooseX-Emulate-Class-Accessor-Fast-0.009032/t/attr_named_meta.t0000644000000000000000000000113613313175212024143 0ustar00rootwheel00000000000000use strict; use warnings; use Class::MOP (); use Test::More tests => 4; use MooseX::Adopt::Class::Accessor::Fast; { package TestPackage; use base 'Class::Accessor::Fast'; __PACKAGE__->mk_accessors(qw/ meta /); } my $i = TestPackage->new( meta => 66 ); is $i->meta, 66, 'meta accessor read value from constructor'; $i->meta(9); is $i->meta, 9, 'meta accessor read set value'; my $meta = Class::MOP::get_metaclass_by_name('TestPackage'); $meta->make_immutable; is $i->meta, 9, 'meta accessor read value from constructor'; $i->meta(66); is $i->meta, 66, 'meta accessor read set value'; __END__; MooseX-Emulate-Class-Accessor-Fast-0.009032/t/BUILD_in_local_class.t0000644000000000000000000000070013313175232024701 0ustar00rootwheel00000000000000use strict; use warnings; { package My::Class; use Moose; use namespace::clean -except => 'meta'; with 'MooseX::Emulate::Class::Accessor::Fast'; sub BUILD { my ($self, $args) = @_; return $self; } __PACKAGE__->meta->make_immutable; } use Test::More tests => 1; my $i = My::Class->new(totally_random_not_an_attribute => 1); is $i->{totally_random_not_an_attribute}, 1, 'Unknown attrs get into hash'; MooseX-Emulate-Class-Accessor-Fast-0.009032/t/accessors.t0000644000000000000000000000344613313175216023016 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 33; use Test::Exception; use Class::MOP; #1 require_ok("MooseX::Adopt::Class::Accessor::Fast"); my $class = "Testing::Class::Accessor::Fast"; { my $infinite_loop_indicator = 0; my $meta = Class::MOP::Class->create( $class, superclasses => ['Class::Accessor::Fast'], methods => { car => sub { shift->_car_accessor(@_); }, mar => sub { return "Overloaded"; }, test => sub { die('Infinite loop detected') if $infinite_loop_indicator++; $_[0]->_test_accessor((@_ > 1 ? @_ : ())); } } ); $class->mk_accessors(qw( foo bar yar car mar test)); $class->mk_ro_accessors(qw(static unchanged)); $class->mk_wo_accessors(qw(sekret double_sekret)); $class->follow_best_practice; $class->mk_accessors(qw( best)); } my %attrs = map{$_->name => $_} $class->meta->get_all_attributes; #2 is(keys %attrs, 11, 'Correct number of attributes'); #3-12 ok(exists $attrs{$_}, "Attribute ${_} created") for qw( foo bar yar car mar static unchanged sekret double_sekret best ); #13-21 ok($class->can("_${_}_accessor"), "Alias method (_${_}_accessor) for ${_} created") for qw( foo bar yar car mar static unchanged sekret double_sekret ); #22-24 is( $attrs{$_}->accessor, $_, "Accessor ${_} created" ) for qw( foo bar yar); #25,26 ok( !$attrs{$_}->has_accessor, "Accessor ${_} not created" ) for qw( car mar); #27,28 is( $attrs{$_}->reader, $_, "Reader ${_} created") for qw( static unchanged ); #29,30 is( $attrs{$_}->writer, $_, "Writer ${_} created") for qw(sekret double_sekret); #31,32 is( $attrs{'best'}->reader, 'get_best', "Reader get_best created"); is( $attrs{'best'}->writer, 'set_best', "Writer set_best created"); #33 lives_ok{ $class->new->test(1) } 'no auto-reference to accessors from aliases'; MooseX-Emulate-Class-Accessor-Fast-0.009032/t/adopt.t0000644000000000000000000000175013313175241022132 0ustar00rootwheel00000000000000use strict; use warnings; use lib 't/lib'; use Test::More tests => 13; #1,2 require_ok("MooseX::Adopt::Class::Accessor::Fast"); use_ok('TestAdoptCAF'); #3-6 ok(TestAdoptCAF->can('meta'), 'Adopt seems to work'); ok(TestAdoptCAF->meta->find_attribute_by_name($_), "attribute $_ created") for qw(foo bar baz); { my $ok = eval { local $SIG{__WARN__} = sub { die "Warning generated when new was called with no arguments: " . join("; ", @_); }; TestAdoptCAF->new(()); }; ok( ref($ok), ref($ok) ? "no warnings when instantiating object" : $@); } #7-9 my $t = TestAdoptCAF->new(foo => 100, bar => 200, groditi => 300); is($t->{foo}, 100, '$self->{foo} set'); is($t->{bar}, 200, '$self->{bar} set'); is($t->{groditi}, 300, '$self->{groditi} set'); #10-12 my $u = TestAdoptCAF->new({foo => 100, bar => 200, groditi => 300}); is($u->{foo}, 100, '$self->{foo} set'); is($u->{bar}, 200, '$self->{bar} set'); is($u->{groditi}, 300, '$self->{groditi} set'); MooseX-Emulate-Class-Accessor-Fast-0.009032/t/recreated_accessors.t0000644000000000000000000000107213313175263025027 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 5; use Test::Exception; # 1 use_ok('MooseX::Emulate::Class::Accessor::Fast'); { package My::Test::Package; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; for (0..1) { __PACKAGE__->mk_accessors(qw( foo )); __PACKAGE__->mk_ro_accessors(qw( bar )); __PACKAGE__->mk_wo_accessors(qw( baz )); } } my $i = My::Test::Package->new(bar => 'bar'); # 2 lives_ok { $i->foo('foo'); $i->baz('baz'); # 3-5 is($i->foo, 'foo'); is($i->bar, 'bar'); is($i->{baz}, 'baz'); } 'No exception'; MooseX-Emulate-Class-Accessor-Fast-0.009032/t/construction.t0000644000000000000000000000276213313175250023561 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 9; #1 require_ok("MooseX::Emulate::Class::Accessor::Fast"); { package MyClass; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; } { package MyClass::MooseChild; use Moose; extends 'MyClass'; } { package MyClass::ImmutableMooseChild; use Moose; extends 'MyClass'; __PACKAGE__->meta->make_immutable(allow_mutable_ancestors => 1); } { package MyClass::TraditionalChild; use base qw(MyClass); } { package MyImmutableClass; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; __PACKAGE__->meta->make_immutable; } { package MyImmutableClass::MooseChild; use Moose; extends 'MyImmutableClass'; } { package MyImmutableClass::ImmutableMooseChild; use Moose; extends 'MyImmutableClass'; __PACKAGE__->meta->make_immutable; } { package MyImmutableClass::TraditionalChild; use base qw(MyImmutableClass); } # 2-9 foreach my $class (qw/ MyClass MyImmutableClass MyClass::MooseChild MyClass::ImmutableMooseChild MyClass::TraditionalChild MyImmutableClass::MooseChild MyImmutableClass::ImmutableMooseChild MyImmutableClass::TraditionalChild /) { my $instance = $class->new(foo => 'bar'); is($instance->{foo}, 'bar', $class . " has CAF construction behavior"); } MooseX-Emulate-Class-Accessor-Fast-0.009032/t/no_replace_existing_symbols.t0000644000000000000000000000131413313175260026611 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 6; { package SomeClass; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; sub anaccessor { 'wibble' } } { package SubClass; use base qw/SomeClass/; sub anotherone { 'flibble' } __PACKAGE__->mk_accessors(qw/ anaccessor anotherone /); } # 1, 2 my $someclass = SomeClass->new; is($someclass->anaccessor, 'wibble'); $someclass->anaccessor('fnord'); is($someclass->anaccessor, 'wibble'); # 3-6 my $subclass = SubClass->new; ok( not defined $subclass->anaccessor ); $subclass->anaccessor('fnord'); is($subclass->anaccessor, 'fnord'); is($subclass->anotherone, 'flibble'); $subclass->anotherone('fnord'); is($subclass->anotherone, 'flibble'); MooseX-Emulate-Class-Accessor-Fast-0.009032/t/class_accessor_chained_fast.t0000644000000000000000000000131313313153720026473 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 1; use MooseX::Adopt::Class::Accessor::Fast; { package MyClass::Accessor::Chained::Fast; use strict; use base 'Class::Accessor::Fast'; sub make_accessor { my($class, $field) = @_; return sub { my $self = shift; if(@_) { $self->{$field} = (@_ == 1 ? $_[0] : [@_]); return $self; } return $self->{$field}; }; } } { package TestPackage; use base qw/MyClass::Accessor::Chained::Fast/; __PACKAGE__->mk_accessors('foo'); } my $i = bless {}, 'TestPackage'; my $other_i = $i->foo('bar'); TODO: { local $TODO = 'ENOWORKEY'; is($other_i, $i, 'Accessor returns instance as opposed to value.'); } MooseX-Emulate-Class-Accessor-Fast-0.009032/t/lib/0000755000000000000000000000000013316670122021402 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/t/lib/TestAdoptCAF.pm0000644000000000000000000000032513313166205024160 0ustar00rootwheel00000000000000package TestAdoptCAF; use Class::Accessor::Fast; BEGIN { our @ISA = qw(Class::Accessor::Fast); } __PACKAGE__->mk_accessors('foo'); __PACKAGE__->mk_ro_accessors('bar'); __PACKAGE__->mk_wo_accessors('baz'); 1; MooseX-Emulate-Class-Accessor-Fast-0.009032/t/list_assign.t0000644000000000000000000000050513313153720023335 0ustar00rootwheel00000000000000use strict; use warnings; use Test::More tests => 1; use MooseX::Adopt::Class::Accessor::Fast; { package Some::Class; use strict; use warnings; use base qw/Class::Accessor::Fast/; __PACKAGE__->mk_accessors(qw/ foo /); } my $i = bless {}, 'Some::Class'; $i->foo(qw/bar baz/); is_deeply($i->foo, [qw/ bar baz /]); MooseX-Emulate-Class-Accessor-Fast-0.009032/README0000644000000000000000000000712013316670123021252 0ustar00rootwheel00000000000000NAME MooseX::Emulate::Class::Accessor::Fast - Emulate Class::Accessor::Fast behavior using Moose attributes SYNOPSYS package MyClass; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; #fields with readers and writers __PACKAGE__->mk_accessors(qw/field1 field2/); #fields with readers only __PACKAGE__->mk_ro_accessors(qw/field3 field4/); #fields with writers only __PACKAGE__->mk_wo_accessors(qw/field5 field6/); DESCRIPTION This module attempts to emulate the behavior of Class::Accessor::Fast as accurately as possible using the Moose attribute system. The public API of "Class::Accessor::Fast" is wholly supported, but the private methods are not. If you are only using the public methods (as you should) migration should be a matter of switching your "use base" line to a "with" line. While I have attempted to emulate the behavior of Class::Accessor::Fast as closely as possible bugs may still be lurking in edge-cases. BEHAVIOR Simple documentation is provided here for your convenience, but for more thorough documentation please see Class::Accessor::Fast and Class::Accessor. A note about introspection Please note that, at this time, the "is" flag attribute is not being set. To determine the "reader" and "writer" methods using introspection in later versions of Class::MOP ( > 0.38) please use the "get_read_method" and "get_write_method" methods in Class::MOP::Attribute. Example # with Class::MOP <= 0.38 my $attr = $self->meta->find_attribute_by_name($field_name); my $reader_method = $attr->reader || $attr->accessor; my $writer_method = $attr->writer || $attr->accessor; # with Class::MOP > 0.38 my $attr = $self->meta->find_attribute_by_name($field_name); my $reader_method = $attr->get_read_method; my $writer_method = $attr->get_write_method; METHODS BUILD $self %args Change the default Moose class building to emulate the behavior of C::A::F and store arguments in the instance hashref. mk_accessors @field_names Create read-write accessors. An attribute named $field_name will be created. The name of the c and "writer" methods will be determined by the return value of "accessor_name_for" and "mutator_name_for", which by default return the name passed unchanged. If the accessor and mutator names are equal the "accessor" attribute will be passes to Moose, otherwise the "reader" and "writer" attributes will be passed. Please see Class::MOP::Attribute for more information. mk_ro_accessors @field_names Create read-only accessors. mk_ro_accessors @field_names Create write-only accessors. follow_best_practices Preface readers with 'get_' and writers with 'set_'. See original Class::Accessor documentation for more information. mutator_name_for accessor_name_for See original Class::Accessor documentation for more information. set See original Class::Accessor documentation for more information. get See original Class::Accessor documentation for more information. meta See Moose::Meta::Class. SEE ALSO Moose, Moose::Meta::Attribute, Class::Accessor, Class::Accessor::Fast, Class::MOP::Attribute, MooseX::Adopt::Class::Accessor::Fast AUTHORS Guillermo Roditi (groditi) With contributions from: Tomas Doran (t0m) Florian Ragwitz (rafl) LICENSE You may distribute this code under the same terms as Perl itself. MooseX-Emulate-Class-Accessor-Fast-0.009032/META.yml0000644000000000000000000000166513316670122021652 0ustar00rootwheel00000000000000--- abstract: 'Emulate Class::Accessor::Fast behavior using Moose attributes' author: - 'Guillermo Roditi (groditi) ' build_requires: Test::Exception: '0' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooseX-Emulate-Class-Accessor-Fast no_index: directory: - t - xt requires: Moose: '0.84' namespace::clean: '0' resources: IRC: irc://irc.perl.org/#moose bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Emulate-Class-Accessor-Fast license: https://dev.perl.org/licenses/ repository: https://github.com/moose/MooseX-Emulate-Class-Accessor-Fast.git version: '0.009032' x_authority: cpan:HAARG x_serialization_backend: 'CPAN::Meta::YAML version 0.018' MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/0000755000000000000000000000000013316670122021137 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/0000755000000000000000000000000013316670122022351 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/0000755000000000000000000000000013316670122023745 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/0000755000000000000000000000000013316670122025012 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/0000755000000000000000000000000013316670122026554 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast.pm0000644000000000000000000002351413316666237030030 0ustar00rootwheel00000000000000package MooseX::Emulate::Class::Accessor::Fast; use Moose::Role; use Class::MOP (); use Scalar::Util (); use MooseX::Emulate::Class::Accessor::Fast::Meta::Accessor (); our $VERSION = '0.009032'; $VERSION =~ tr/_//d; =head1 NAME MooseX::Emulate::Class::Accessor::Fast - Emulate Class::Accessor::Fast behavior using Moose attributes =head1 SYNOPSYS package MyClass; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; #fields with readers and writers __PACKAGE__->mk_accessors(qw/field1 field2/); #fields with readers only __PACKAGE__->mk_ro_accessors(qw/field3 field4/); #fields with writers only __PACKAGE__->mk_wo_accessors(qw/field5 field6/); =head1 DESCRIPTION This module attempts to emulate the behavior of L as accurately as possible using the Moose attribute system. The public API of C is wholly supported, but the private methods are not. If you are only using the public methods (as you should) migration should be a matter of switching your C line to a C line. While I have attempted to emulate the behavior of Class::Accessor::Fast as closely as possible bugs may still be lurking in edge-cases. =head1 BEHAVIOR Simple documentation is provided here for your convenience, but for more thorough documentation please see L and L. =head2 A note about introspection Please note that, at this time, the C flag attribute is not being set. To determine the C and C methods using introspection in later versions of L ( > 0.38) please use the C and C methods in L. Example # with Class::MOP <= 0.38 my $attr = $self->meta->find_attribute_by_name($field_name); my $reader_method = $attr->reader || $attr->accessor; my $writer_method = $attr->writer || $attr->accessor; # with Class::MOP > 0.38 my $attr = $self->meta->find_attribute_by_name($field_name); my $reader_method = $attr->get_read_method; my $writer_method = $attr->get_write_method; =head1 METHODS =head2 BUILD $self %args Change the default Moose class building to emulate the behavior of C::A::F and store arguments in the instance hashref. =cut my $locate_metaclass = sub { my $class = Scalar::Util::blessed($_[0]) || $_[0]; return Class::MOP::get_metaclass_by_name($class) || Moose::Meta::Class->initialize($class); }; sub BUILD { } around 'BUILD' => sub { my $orig = shift; my $self = shift; my %args = %{ $_[0] }; $self->$orig(\%args); my @extra = grep { !exists($self->{$_}) } keys %args; @{$self}{@extra} = @args{@extra}; return $self; }; =head2 mk_accessors @field_names Create read-write accessors. An attribute named C<$field_name> will be created. The name of the c and C methods will be determined by the return value of C and C, which by default return the name passed unchanged. If the accessor and mutator names are equal the C attribute will be passes to Moose, otherwise the C and C attributes will be passed. Please see L for more information. =cut sub mk_accessors { my $self = shift; my $meta = $locate_metaclass->($self); my $class = $meta->name; confess("You are trying to modify ${class}, which has been made immutable, this is ". "not supported. Try subclassing ${class}, rather than monkeypatching it") if $meta->is_immutable; for my $attr_name (@_){ $meta->remove_attribute($attr_name) if $meta->find_attribute_by_name($attr_name); my $reader = $self->accessor_name_for($attr_name); my $writer = $self->mutator_name_for( $attr_name); #dont overwrite existing methods if($reader eq $writer){ my %opts = ( $meta->has_method($reader) ? ( is => 'bare' ) : (accessor => $reader) ); my $attr = $meta->find_attribute_by_name($attr_name) || $meta->add_attribute($attr_name, %opts, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'] ); if($attr_name eq $reader){ my $alias = "_${attr_name}_accessor"; next if $meta->has_method($alias); $meta->add_method($alias => $attr->get_read_method_ref); } } else { my @opts = ( $meta->has_method($writer) ? () : (writer => $writer) ); push(@opts, (reader => $reader)) unless $meta->has_method($reader); my $attr = $meta->find_attribute_by_name($attr_name) || $meta->add_attribute($attr_name, @opts, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'] ); } } } =head2 mk_ro_accessors @field_names Create read-only accessors. =cut sub mk_ro_accessors { my $self = shift; my $meta = $locate_metaclass->($self); my $class = $meta->name; confess("You are trying to modify ${class}, which has been made immutable, this is ". "not supported. Try subclassing ${class}, rather than monkeypatching it") if $meta->is_immutable; for my $attr_name (@_){ $meta->remove_attribute($attr_name) if $meta->find_attribute_by_name($attr_name); my $reader = $self->accessor_name_for($attr_name); my @opts = ($meta->has_method($reader) ? (is => 'bare') : (reader => $reader) ); my $attr = $meta->add_attribute($attr_name, @opts, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'] ) if scalar(@opts); if($reader eq $attr_name && $reader eq $self->mutator_name_for($attr_name)){ $meta->add_method("_${attr_name}_accessor" => $attr->get_read_method_ref) unless $meta->has_method("_${attr_name}_accessor"); } } } =head2 mk_ro_accessors @field_names Create write-only accessors. =cut #this is retarded.. but we need it for compatibility or whatever. sub mk_wo_accessors { my $self = shift; my $meta = $locate_metaclass->($self); my $class = $meta->name; confess("You are trying to modify ${class}, which has been made immutable, this is ". "not supported. Try subclassing ${class}, rather than monkeypatching it") if $meta->is_immutable; for my $attr_name (@_){ $meta->remove_attribute($attr_name) if $meta->find_attribute_by_name($attr_name); my $writer = $self->mutator_name_for($attr_name); my @opts = ($meta->has_method($writer) ? () : (writer => $writer) ); my $attr = $meta->add_attribute($attr_name, @opts, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'] ) if scalar(@opts); if($writer eq $attr_name && $writer eq $self->accessor_name_for($attr_name)){ $meta->add_method("_${attr_name}_accessor" => $attr->get_write_method_ref) unless $meta->has_method("_${attr_name}_accessor"); } } } =head2 follow_best_practices Preface readers with 'get_' and writers with 'set_'. See original L documentation for more information. =cut sub follow_best_practice { my $self = shift; my $meta = $locate_metaclass->($self); $meta->remove_method('mutator_name_for'); $meta->remove_method('accessor_name_for'); $meta->add_method('mutator_name_for', sub{ return "set_".$_[1] }); $meta->add_method('accessor_name_for', sub{ return "get_".$_[1] }); } =head2 mutator_name_for =head2 accessor_name_for See original L documentation for more information. =cut sub mutator_name_for { return $_[1] } sub accessor_name_for { return $_[1] } =head2 set See original L documentation for more information. =cut sub set { my $self = shift; my $k = shift; confess "Wrong number of arguments received" unless scalar @_; my $meta = $locate_metaclass->($self); confess "No such attribute '$k'" unless ( my $attr = $meta->find_attribute_by_name($k) ); my $writer = $attr->get_write_method; $self->$writer(@_ > 1 ? [@_] : @_); } =head2 get See original L documentation for more information. =cut sub get { my $self = shift; confess "Wrong number of arguments received" unless scalar @_; my $meta = $locate_metaclass->($self); my @values; for( @_ ){ confess "No such attribute '$_'" unless ( my $attr = $meta->find_attribute_by_name($_) ); my $reader = $attr->get_read_method; @_ > 1 ? push(@values, $self->$reader) : return $self->$reader; } return @values; } sub make_accessor { my($class, $field) = @_; my $meta = $locate_metaclass->($class); my $attr = $meta->find_attribute_by_name($field) || $meta->add_attribute($field, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'], is => 'bare', ); my $reader = $attr->get_read_method_ref; my $writer = $attr->get_write_method_ref; return sub { my $self = shift; return $reader->($self) unless @_; return $writer->($self,(@_ > 1 ? [@_] : @_)); } } sub make_ro_accessor { my($class, $field) = @_; my $meta = $locate_metaclass->($class); my $attr = $meta->find_attribute_by_name($field) || $meta->add_attribute($field, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'], is => 'bare', ); return $attr->get_read_method_ref; } sub make_wo_accessor { my($class, $field) = @_; my $meta = $locate_metaclass->($class); my $attr = $meta->find_attribute_by_name($field) || $meta->add_attribute($field, traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'], is => 'bare', ); return $attr->get_write_method_ref; } 1; =head2 meta See L. =cut =head1 SEE ALSO L, L, L, L, L, L =head1 AUTHORS Guillermo Roditi (groditi) With contributions from: =over 4 =item Tomas Doran (t0m) =item Florian Ragwitz (rafl) =back =head1 LICENSE You may distribute this code under the same terms as Perl itself. =cut MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast/0000755000000000000000000000000013316670122027451 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast/Meta/0000755000000000000000000000000013316670122030337 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast/Meta/Accessor.pm0000644000000000000000000000252013313153720032433 0ustar00rootwheel00000000000000package MooseX::Emulate::Class::Accessor::Fast::Meta::Accessor; use Moose; extends 'Moose::Meta::Method::Accessor'; sub _generate_accessor_method { my $attr = (shift)->associated_attribute; return sub { my $self = shift; $attr->set_value($self, $_[0]) if scalar(@_) == 1; $attr->set_value($self, [@_]) if scalar(@_) > 1; $attr->get_value($self); }; } sub _generate_writer_method { my $attr = (shift)->associated_attribute; return sub { my $self = shift; $attr->set_value($self, $_[0]) if scalar(@_) == 1; $attr->set_value($self, [@_]) if scalar(@_) > 1; }; } # FIXME - this is shite, but it does work... sub _generate_accessor_method_inline { my $attr = (shift)->associated_attribute; my $attr_name = $attr->name; my $meta_instance = $attr->associated_class->instance_metaclass; my $code = eval "sub { my \$self = shift; \$self->{'$attr_name'} = \$_[0] if scalar(\@_) == 1; \$self->{'$attr_name'} = [\@_] if scalar(\@_) > 1; \$self->{'$attr_name'}; }"; confess "Could not generate inline accessor because : $@" if $@; return $code; } { my $meta = __PACKAGE__->meta; $meta->add_method(_generate_writer_method_inline => $meta->get_method('_generate_accessor_method_inline')); } no Moose; 1; MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast/Meta/Role/0000755000000000000000000000000013316670122031240 5ustar00rootwheel00000000000000Attribute.pm0000644000000000000000000000026113264123661033464 0ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Emulate/Class/Accessor/Fast/Meta/Rolepackage MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute; use Moose::Role; sub accessor_metaclass { 'MooseX::Emulate::Class::Accessor::Fast::Meta::Accessor' } 1; MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Adopt/0000755000000000000000000000000013316670122023420 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Adopt/Class/0000755000000000000000000000000013316670122024465 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Adopt/Class/Accessor/0000755000000000000000000000000013316670122026227 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/lib/MooseX/Adopt/Class/Accessor/Fast.pm0000644000000000000000000000222113316666237027473 0ustar00rootwheel00000000000000package MooseX::Adopt::Class::Accessor::Fast; our $VERSION = '0.009032'; $VERSION =~ tr/_//d; $INC{'Class/Accessor/Fast.pm'} = __FILE__; package #don't index Class::Accessor::Fast; use Moose; use namespace::clean; with 'MooseX::Emulate::Class::Accessor::Fast'; 1; =head1 NAME MooseX::Adopt::Class::Accessor::Fast - Hijack Class::Accessor::Fast in %INC; =head1 SYNOPSYS use MooseX::Adopt::Class::Accessor::Fast; use CAF::Using::Module; #that's it! JustWorks =head1 DESCRIPTION This module attempts to hijack L in %INC and replace it with L. Make sure it is loaded before the classes you have that use . It is meant as a tool to help you migrate your project from L, to L and ultimately, to L. =head1 SEE ALSO L, L, L =head1 AUTHORS =over 4 =item Matt S Trout =item Guillermo Roditi (groditi) =back =head1 LICENSE You may distribute this code under the same terms as Perl itself. =cut MooseX-Emulate-Class-Accessor-Fast-0.009032/Makefile.PL0000644000000000000000000000544213313174623022352 0ustar00rootwheel00000000000000use strict; use warnings FATAL => 'all'; use 5.006; my %META = ( name => 'MooseX-Emulate-Class-Accessor-Fast', license => 'perl_5', prereqs => { configure => { requires => { 'ExtUtils::MakeMaker' => 0, } }, build => { requires => { } }, test => { requires => { 'Test::More' => 0, 'Test::Exception' => 0, }, }, runtime => { requires => { 'Moose' => '0.84', 'namespace::clean' => 0, }, }, }, resources => { repository => { url => 'https://github.com/moose/MooseX-Emulate-Class-Accessor-Fast.git', web => 'https://github.com/moose/MooseX-Emulate-Class-Accessor-Fast', type => 'git', }, x_IRC => 'irc://irc.perl.org/#moose', bugtracker => { web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Emulate-Class-Accessor-Fast', mailto => 'bug-MooseX-Emulate-Class-Accessor-Fast@rt.cpan.org', }, license => [ 'https://dev.perl.org/licenses/' ], }, no_index => { directory => [ 't', 'xt' ] }, x_authority => 'cpan:HAARG', ); my %MM_ARGS = (); ## BOILERPLATE ############################################################### require ExtUtils::MakeMaker; (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; # have to do this since old EUMM dev releases miss the eval $VERSION line my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; my $mymeta = $eumm_version >= 6.57_02; my $mymeta_broken = $mymeta && $eumm_version < 6.57_07; ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g; ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g; $META{license} = [ $META{license} ] if $META{license} && !ref $META{license}; $MM_ARGS{LICENSE} = $META{license}[0] if $META{license} && $eumm_version >= 6.30; $MM_ARGS{NO_MYMETA} = 1 if $mymeta_broken; $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } unless -f 'META.yml'; $MM_ARGS{PL_FILES} ||= {}; $MM_ARGS{NORECURS} = 1 if not exists $MM_ARGS{NORECURS}; for (qw(configure build test runtime)) { my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; my $r = $MM_ARGS{$key} = { %{$META{prereqs}{$_}{requires} || {}}, %{delete $MM_ARGS{$key} || {}}, }; defined $r->{$_} or delete $r->{$_} for keys %$r; } $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0; delete $MM_ARGS{MIN_PERL_VERSION} if $eumm_version < 6.47_01; $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}} if $eumm_version < 6.63_03; $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}} if $eumm_version < 6.55_01; delete $MM_ARGS{CONFIGURE_REQUIRES} if $eumm_version < 6.51_03; ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); ## END BOILERPLATE ########################################################### MooseX-Emulate-Class-Accessor-Fast-0.009032/maint/0000755000000000000000000000000013316670122021501 5ustar00rootwheel00000000000000MooseX-Emulate-Class-Accessor-Fast-0.009032/maint/Makefile.PL.include0000644000000000000000000000034413313166256025103 0ustar00rootwheel00000000000000BEGIN { -e 'Distar' or system("git clone git://git.shadowcat.co.uk/p5sagit/Distar.git") } use lib 'Distar/lib'; use Distar 0.001; use ExtUtils::MakeMaker 6.57_10 (); author 'Guillermo Roditi (groditi) '; 1; MooseX-Emulate-Class-Accessor-Fast-0.009032/META.json0000644000000000000000000000327113316670123022016 0ustar00rootwheel00000000000000{ "abstract" : "Emulate Class::Accessor::Fast behavior using Moose attributes", "author" : [ "Guillermo Roditi (groditi) " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooseX-Emulate-Class-Accessor-Fast", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "build" : { "requires" : {} }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Moose" : "0.84", "namespace::clean" : "0" } }, "test" : { "requires" : { "Test::Exception" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-MooseX-Emulate-Class-Accessor-Fast@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Emulate-Class-Accessor-Fast" }, "license" : [ "https://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "https://github.com/moose/MooseX-Emulate-Class-Accessor-Fast.git", "web" : "https://github.com/moose/MooseX-Emulate-Class-Accessor-Fast" }, "x_IRC" : "irc://irc.perl.org/#moose" }, "version" : "0.009032", "x_authority" : "cpan:HAARG", "x_serialization_backend" : "JSON::PP version 2.97001" }