Class-Refresh-0.05000755001750000144 012162375271 13220 5ustar00doyusers000000000000README100644001750000144 45512162375271 14145 0ustar00doyusers000000000000Class-Refresh-0.05 This archive contains the distribution Class-Refresh, version 0.05: refresh your classes during runtime This software is copyright (c) 2013 by Jesse Luehrs. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Changes100644001750000144 103212162375271 14570 0ustar00doyusers000000000000Class-Refresh-0.05Revision history for Class-Refresh 0.05 2013-06-25 - revert the previous fix, since it causes issues - add 'track_require' import arg, as a better fix 0.04 2013-06-21 - fix refreshing a module for the first time when it was first loaded after the first call to refresh 0.03 2013-06-21 - fix the case where reloading after a compilation error wouldn't work properly (Michael Reddick) 0.02 2011-04-10 - whoops, can't use Sub::Exporter in tests 0.01 2011-04-06 - Initial release LICENSE100644001750000144 4365312162375271 14341 0ustar00doyusers000000000000Class-Refresh-0.05This software is copyright (c) 2013 by Jesse Luehrs. 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 Jesse Luehrs. 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 Jesse Luehrs. 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 dist.ini100644001750000144 42212162375271 14723 0ustar00doyusers000000000000Class-Refresh-0.05name = Class-Refresh author = Jesse Luehrs license = Perl_5 copyright_holder = Jesse Luehrs [@DOY] :version = 0.08 dist = Class-Refresh repository = github [ContributorsFromGit] [AutoPrereqs] skip = ^(?:Foo|Bar|Baz)(?:$|::) skip = Moose(?:$|::Role) META.yml100644001750000144 1261712162375271 14601 0ustar00doyusers000000000000Class-Refresh-0.05--- abstract: 'refresh your classes during runtime' author: - 'Jesse Luehrs ' build_requires: Exporter: 0 File::Copy: 0 File::Find: 0 File::Temp: 0 Test::Fatal: 0 Test::More: 0.88 Test::Requires: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300034, 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: Class-Refresh requires: B: 0 Class::Load: 0 Class::Unload: 0 Devel::OverrideGlobalRequire: 0 Try::Tiny: 0 strict: 0 warnings: 0 resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Class-Refresh homepage: http://metacpan.org/release/Class-Refresh repository: git://github.com/doy/class-refresh.git version: 0.05 x_Dist_Zilla: perl: version: 5.018000 plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@DOY/TestMoreDoneTesting' version: 4.300034 - class: Dist::Zilla::Plugin::GatherDir name: '@DOY/GatherDir' version: 4.300034 - class: Dist::Zilla::Plugin::PruneCruft name: '@DOY/PruneCruft' version: 4.300034 - class: Dist::Zilla::Plugin::ManifestSkip name: '@DOY/ManifestSkip' version: 4.300034 - class: Dist::Zilla::Plugin::MetaYAML name: '@DOY/MetaYAML' version: 4.300034 - class: Dist::Zilla::Plugin::License name: '@DOY/License' version: 4.300034 - class: Dist::Zilla::Plugin::Readme name: '@DOY/Readme' version: 4.300034 - class: Dist::Zilla::Plugin::RunExtraTests name: '@DOY/RunExtraTests' version: 0.011 - class: Dist::Zilla::Plugin::ExecDir name: '@DOY/ExecDir' version: 4.300034 - class: Dist::Zilla::Plugin::ShareDir name: '@DOY/ShareDir' version: 4.300034 - class: Dist::Zilla::Plugin::MakeMaker name: '@DOY/MakeMaker' version: 4.300034 - class: Dist::Zilla::Plugin::Manifest name: '@DOY/Manifest' version: 4.300034 - class: Dist::Zilla::Plugin::TestRelease name: '@DOY/TestRelease' version: 4.300034 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@DOY/ConfirmRelease' version: 4.300034 - class: Dist::Zilla::Plugin::MetaConfig name: '@DOY/MetaConfig' version: 4.300034 - class: Dist::Zilla::Plugin::MetaJSON name: '@DOY/MetaJSON' version: 4.300034 - class: Dist::Zilla::Plugin::NextRelease name: '@DOY/NextRelease' version: 4.300034 - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@DOY/CheckChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::PkgVersion name: '@DOY/PkgVersion' version: 4.300034 - class: Dist::Zilla::Plugin::Authority name: '@DOY/Authority' version: 1.006 - class: Dist::Zilla::Plugin::PodCoverageTests name: '@DOY/PodCoverageTests' version: 4.300034 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@DOY/PodSyntaxTests' version: 4.300034 - class: Dist::Zilla::Plugin::NoTabsTests name: '@DOY/NoTabsTests' version: 0.01 - class: Dist::Zilla::Plugin::EOLTests name: '@DOY/EOLTests' version: 0.02 - class: Dist::Zilla::Plugin::Test::Compile name: '@DOY/Test::Compile' version: 2.002 - class: Dist::Zilla::Plugin::Metadata name: '@DOY/Metadata' version: 3.03 - class: Dist::Zilla::Plugin::MetaResources name: '@DOY/MetaResources' version: 4.300034 - class: Dist::Zilla::Plugin::Git::Check name: '@DOY/Git::Check' version: 2.013 - class: Dist::Zilla::Plugin::Git::Commit name: '@DOY/Git::Commit' version: 2.013 - class: Dist::Zilla::Plugin::Git::Tag name: '@DOY/Git::Tag' version: 2.013 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@DOY/Git::NextVersion' version: 2.013 - class: Dist::Zilla::Plugin::PodWeaver name: '@DOY/PodWeaver' version: 3.101641 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@DOY/UploadToCPAN' version: 4.300034 - class: Dist::Zilla::Plugin::ContributorsFromGit name: ContributorsFromGit version: 0.006 - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300034 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300034 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300034 x_authority: cpan:DOY x_contributors: - 'Jesse Luehrs ' - 'Michael Reddick ' MANIFEST100644001750000144 331512162375271 14434 0ustar00doyusers000000000000Class-Refresh-0.05Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Class/Refresh.pm t/00-compile.t t/basic.t t/compile-error.t t/data/basic/after/Foo.pm t/data/basic/before/Foo.pm t/data/compile-error/after/Foo.pm t/data/compile-error/before/Foo.pm t/data/compile-error/middle/Foo.pm t/data/moose-basic/after/Foo.pm t/data/moose-basic/after/Foo/Immutable.pm t/data/moose-basic/before/Foo.pm t/data/moose-basic/before/Foo/Immutable.pm t/data/moose-late-load/after/Foo.pm t/data/moose-late-load/after/Foo/Immutable.pm t/data/moose-late-load/before/Foo.pm t/data/moose-late-load/before/Foo/Immutable.pm t/data/moose-late-load/middle/Foo.pm t/data/moose-late-load/middle/Foo/Immutable.pm t/data/moose-metaclasses/after/Foo/Meta/Class.pm t/data/moose-metaclasses/before/Bar.pm t/data/moose-metaclasses/before/Foo.pm t/data/moose-metaclasses/before/Foo/Meta/Class.pm t/data/moose-roles/after/Foo/Role.pm t/data/moose-roles/before/Bar.pm t/data/moose-roles/before/Bar/Role.pm t/data/moose-roles/before/Baz.pm t/data/moose-roles/before/Baz/Role.pm t/data/moose-roles/before/Foo.pm t/data/moose-roles/before/Foo/Role.pm t/data/moose-subclasses/after/Foo.pm t/data/moose-subclasses/before/Foo.pm t/data/moose-subclasses/before/Foo/Sub.pm t/data/new-modules/after/Foo.pm t/data/new-modules/before/Foo.pm t/data/new-modules/middle/Foo.pm t/data/other-api/after/Foo.pm t/data/other-api/after/Foo/Bar.pm t/data/other-api/before/Foo.pm t/data/other-api/before/Foo/Bar.pm t/data/other-api/before/Foo/Baz.pm t/lib/Test/Class/Refresh.pm t/moose-basic.t t/moose-late-load.t t/moose-metaclasses.t t/moose-roles.t t/moose-subclasses.t t/new-modules.t t/other-api.t xt/release/eol.t xt/release/no-tabs.t xt/release/pod-coverage.t xt/release/pod-syntax.t t000755001750000144 012162375271 13404 5ustar00doyusers000000000000Class-Refresh-0.05basic.t100644001750000144 206212162375271 15012 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('basic'); push @INC, $dir->dirname; require Foo; Class::Refresh->refresh; can_ok('Foo', 'meth'); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); is($Foo::FOO, 1, "package global exists"); is($Foo::BAR, 2, "other package global exists"); ok(!defined($Foo::BAZ), "third package global doesn't exist"); sleep 2; update_temp_dir_for('basic', $dir); Class::Refresh->refresh; can_ok('Foo', 'other_meth'); ok(!Foo->can('meth'), "!Foo->can('meth')"); { local $TODO = "hrm, global access like this is resolved at compile time"; is($Foo::FOO, 10, "package global exists with new value"); ok(!defined($Foo::BAR), "other package global doesn't exist"); is($Foo::BAZ, 30, "third package global exists"); } is(eval '$Foo::FOO', 10, "package global exists with new value"); ok(!defined(eval '$Foo::BAR'), "other package global doesn't exist"); is(eval '$Foo::BAZ', 30, "third package global exists"); done_testing; META.json100644001750000144 2110112162375271 14735 0ustar00doyusers000000000000Class-Refresh-0.05{ "abstract" : "refresh your classes during runtime", "author" : [ "Jesse Luehrs " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Class-Refresh", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "B" : "0", "Class::Load" : "0", "Class::Unload" : "0", "Devel::OverrideGlobalRequire" : "0", "Try::Tiny" : "0", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Exporter" : "0", "File::Copy" : "0", "File::Find" : "0", "File::Temp" : "0", "Test::Fatal" : "0", "Test::More" : "0.88", "Test::Requires" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-class-refresh@rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Class-Refresh" }, "homepage" : "http://metacpan.org/release/Class-Refresh", "repository" : { "type" : "git", "url" : "git://github.com/doy/class-refresh.git", "web" : "https://github.com/doy/class-refresh" } }, "version" : "0.05", "x_Dist_Zilla" : { "perl" : { "version" : "5.018000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@DOY/TestMoreDoneTesting", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "@DOY/GatherDir", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@DOY/PruneCruft", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@DOY/ManifestSkip", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@DOY/MetaYAML", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@DOY/License", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@DOY/Readme", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "name" : "@DOY/RunExtraTests", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@DOY/ExecDir", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@DOY/ShareDir", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@DOY/MakeMaker", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@DOY/Manifest", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@DOY/TestRelease", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@DOY/ConfirmRelease", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@DOY/MetaConfig", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@DOY/MetaJSON", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@DOY/NextRelease", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@DOY/CheckChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@DOY/PkgVersion", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@DOY/Authority", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@DOY/PodCoverageTests", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@DOY/PodSyntaxTests", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::NoTabsTests", "name" : "@DOY/NoTabsTests", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "name" : "@DOY/EOLTests", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "name" : "@DOY/Test::Compile", "version" : "2.002" }, { "class" : "Dist::Zilla::Plugin::Metadata", "name" : "@DOY/Metadata", "version" : "3.03" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@DOY/MetaResources", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@DOY/Git::Check", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@DOY/Git::Commit", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@DOY/Git::Tag", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@DOY/Git::NextVersion", "version" : "2.013" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "name" : "@DOY/PodWeaver", "version" : "3.101641" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@DOY/UploadToCPAN", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::ContributorsFromGit", "name" : "ContributorsFromGit", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300034" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300034" } }, "x_authority" : "cpan:DOY", "x_contributors" : [ "Jesse Luehrs ", "Michael Reddick " ] } Makefile.PL100644001750000144 321712162375271 15256 0ustar00doyusers000000000000Class-Refresh-0.05 use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "refresh your classes during runtime", "AUTHOR" => "Jesse Luehrs ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Class-Refresh", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Class::Refresh", "PREREQ_PM" => { "B" => 0, "Class::Load" => 0, "Class::Unload" => 0, "Devel::OverrideGlobalRequire" => 0, "Try::Tiny" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Exporter" => 0, "File::Copy" => 0, "File::Find" => 0, "File::Temp" => 0, "Test::Fatal" => 0, "Test::More" => "0.88", "Test::Requires" => 0 }, "VERSION" => "0.05", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } 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); other-api.t100644001750000144 310512162375271 15620 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Requires 'Moose'; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('other-api'); push @INC, $dir->dirname; require Foo; require Foo::Bar; Class::Refresh->refresh; is_deeply([Class::Refresh->modified_modules], [], "got the right list of modified modules"); sleep 2; update_temp_dir_for('other-api', $dir); is_deeply([sort Class::Refresh->modified_modules], ['Foo', 'Foo::Bar'], "got the right list of modified modules"); Class::Refresh->refresh; ok(Class::Load::is_class_loaded('Foo'), "Foo is loaded"); Class::Refresh->unload_module('Foo'); ok(!Class::Load::is_class_loaded('Foo'), "Foo is not loaded"); ok(!Class::MOP::class_of('Foo'), "Foo no longer has a metaclass"); ok(!exists $INC{'Foo.pm'}, "Foo isn't in \%INC"); is_deeply([Class::Refresh->modified_modules], [], "got the right list of modified modules"); Class::Refresh->load_module('Foo'); ok(Class::Load::is_class_loaded('Foo'), "Foo is loaded"); ok(Class::MOP::class_of('Foo'), "Foo has a metaclass"); ok(exists $INC{'Foo.pm'}, "Foo is in \%INC"); is_deeply([Class::Refresh->modified_modules], [], "got the right list of modified modules"); my $meta = Class::MOP::class_of('Foo'); Class::Refresh->refresh_module('Foo'); ok(Class::Load::is_class_loaded('Foo'), "Foo is loaded"); ok(Class::MOP::class_of('Foo'), "Foo has a metaclass"); ok(exists $INC{'Foo.pm'}, "Foo is in \%INC"); isnt($meta, Class::MOP::class_of('Foo'), "metaclass was reinitialized"); done_testing; 00-compile.t100644001750000144 312612162375271 15600 0ustar00doyusers000000000000Class-Refresh-0.05/t#!perl use strict; use warnings; use Test::More; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); sub _find_scripts { my $dir = shift @_; my @found_scripts = (); find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip open my $FH, '<', $_ or do { note( "Unable to open $found in ( $! ), skipping" ); return; }; my $shebang = <$FH>; return unless $shebang =~ /^#!.*?\bperl\b\s*$/; push @found_scripts, $found; }, $dir, ); return @found_scripts; } my @scripts; do { push @scripts, _find_scripts($_) if -d $_ } for qw{ bin script scripts }; my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } moose-roles.t100644001750000144 314712162375271 16202 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Requires 'Moose'; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('moose-roles'); push @INC, $dir->dirname; our %reloads; require Foo; require Bar; require Baz; Class::Refresh->refresh; is_deeply([sort map { $_->name } Foo->meta->get_all_attributes], ['foo', 'foo_role1'], "correct starting attr list"); is_deeply([sort map { $_->name } Bar->meta->get_all_attributes], ['bar', 'bar_role', 'foo_role1'], "correct starting attr list"); is_deeply([sort map { $_->name } Baz->meta->get_all_attributes], ['bar_role', 'baz', 'baz_role', 'foo_role1'], "correct starting attr list"); is_deeply(\%reloads, { foo => 1, foo_role => 1, bar => 1, bar_role => 1, baz => 1, baz_role => 1 }, "everything loaded"); sleep 2; update_temp_dir_for('moose-roles', $dir); Class::Refresh->refresh; is_deeply([sort map { $_->name } Foo->meta->get_all_attributes], ['foo', 'foo_role2'], "correct starting attr list"); is_deeply([sort map { $_->name } Bar->meta->get_all_attributes], ['bar', 'bar_role', 'foo_role2'], "correct starting attr list"); is_deeply([sort map { $_->name } Baz->meta->get_all_attributes], ['bar_role', 'baz', 'baz_role', 'foo_role2'], "correct starting attr list"); is_deeply(\%reloads, { foo => 2, foo_role => 2, bar => 2, bar_role => 2, baz => 2, baz_role => 1 }, "everything reloaded"); done_testing; moose-basic.t100644001750000144 220412162375271 16130 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Requires 'Moose'; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('moose-basic'); push @INC, $dir->dirname; require Foo; require Foo::Immutable; Class::Refresh->refresh; is_deeply([Foo->meta->get_attribute_list], ['foo'], "correct starting attr list"); can_ok('Foo', 'meth'); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); is_deeply([Foo::Immutable->meta->get_attribute_list], ['foo'], "correct starting attr list"); can_ok('Foo::Immutable', 'meth'); ok(!Foo::Immutable->can('other_meth'), "!Foo::Immutable->can('other_meth')"); sleep 2; update_temp_dir_for('moose-basic', $dir); Class::Refresh->refresh; is_deeply([Foo->meta->get_attribute_list], ['bar'], "correct refreshed attr list"); can_ok('Foo', 'other_meth'); ok(!Foo->can('meth'), "!Foo->can('meth')"); is_deeply([Foo::Immutable->meta->get_attribute_list], ['bar'], "correct refreshed attr list"); can_ok('Foo::Immutable', 'other_meth'); ok(!Foo::Immutable->can('meth'), "!Foo::Immutable->can('meth')"); done_testing; new-modules.t100644001750000144 104212162375271 16165 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh track_require => 1; my $dir = prepare_temp_dir_for('new-modules'); push @INC, $dir->dirname; Class::Refresh->refresh; # load Foo after the first call to refresh require Foo; is(Foo->bar, 1); sleep 2; update_temp_dir_for('new-modules', $dir, 'middle'); Class::Refresh->refresh; is(Foo->bar, 2); sleep 2; update_temp_dir_for('new-modules', $dir, 'after'); Class::Refresh->refresh; is(Foo->bar, 3); done_testing; release000755001750000144 012162375271 15214 5ustar00doyusers000000000000Class-Refresh-0.05/xteol.t100644001750000144 24012162375271 16274 0ustar00doyusers000000000000Class-Refresh-0.05/xt/releaseuse strict; use warnings; use Test::More; eval 'use Test::EOL'; plan skip_all => 'Test::EOL required' if $@; all_perl_files_ok({ trailing_whitespace => 1 }); compile-error.t100644001750000144 230012162375271 16503 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Fatal; use Test::Requires 'Moose'; use lib 't/lib'; use Test::Class::Refresh; use Try::Tiny; use Class::Refresh; my $dir = prepare_temp_dir_for('compile-error'); push @INC, $dir->dirname; require Foo; is(exception { Class::Refresh->refresh }, undef, "loads successfully"); my $foo = Foo->new; my $val; is(exception { $val = $foo->meth }, undef, "\$foo->meth works"); is($val, 1, "got the right value"); sleep 2; update_temp_dir_for('compile-error', $dir, 'middle'); like( exception { Class::Refresh->refresh }, qr/^Global symbol "\$error" requires explicit package name/, "compilation error" ); like( exception { $foo->meth }, qr{^ # 5.18+ (?:Can't\ locate\ object\ method\ "meth"\ via\ package\ "Foo") | # 5.16 and earlier (?:Undefined\ subroutine\ &Foo::meth\ called) }x, "\$foo->meth doesn't work now" ); sleep 2; update_temp_dir_for('compile-error', $dir, 'after'); is(exception { Class::Refresh->refresh }, undef, "loads successfully"); is(exception { $val = $foo->meth }, undef, "\$foo->meth works again"); is($val, 3, "got the right value"); done_testing; moose-late-load.t100644001750000144 351012162375271 16712 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh track_require => 1; my $dir; BEGIN { $dir = prepare_temp_dir_for('moose-late-load'); push @INC, $dir->dirname; Class::Refresh->refresh; } # have to do this later use Test::Requires 'Moose'; require Foo; require Foo::Immutable; is_deeply([Foo->meta->get_attribute_list], ['foo'], "correct starting attr list"); can_ok('Foo', 'meth'); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); is_deeply([Foo::Immutable->meta->get_attribute_list], ['foo'], "correct starting attr list"); can_ok('Foo::Immutable', 'meth'); ok(!Foo::Immutable->can('other_meth'), "!Foo::Immutable->can('other_meth')"); sleep 2; update_temp_dir_for('moose-late-load', $dir, 'middle'); Class::Refresh->refresh; is_deeply([Foo->meta->get_attribute_list], ['bar'], "correct refreshed attr list"); can_ok('Foo', 'other_meth'); ok(!Foo->can('meth'), "!Foo->can('meth')"); is_deeply([Foo::Immutable->meta->get_attribute_list], ['bar'], "correct refreshed attr list"); can_ok('Foo::Immutable', 'other_meth'); ok(!Foo::Immutable->can('meth'), "!Foo::Immutable->can('meth')"); sleep 2; update_temp_dir_for('moose-late-load', $dir, 'after'); Class::Refresh->refresh; is_deeply([Foo->meta->get_attribute_list], ['baz'], "correct refreshed attr list"); can_ok('Foo', 'other_other_meth'); ok(!Foo->can('meth'), "!Foo->can('meth')"); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); is_deeply([Foo::Immutable->meta->get_attribute_list], ['baz'], "correct refreshed attr list"); can_ok('Foo::Immutable', 'other_other_meth'); ok(!Foo::Immutable->can('meth'), "!Foo::Immutable->can('meth')"); ok(!Foo::Immutable->can('other_meth'), "!Foo::Immutable->can('other_meth')"); done_testing; Class000755001750000144 012162375271 14754 5ustar00doyusers000000000000Class-Refresh-0.05/libRefresh.pm100644001750000144 2526512162375271 17102 0ustar00doyusers000000000000Class-Refresh-0.05/lib/Classpackage Class::Refresh; BEGIN { $Class::Refresh::AUTHORITY = 'cpan:DOY'; } { $Class::Refresh::VERSION = '0.05'; } use strict; use warnings; # ABSTRACT: refresh your classes during runtime use Class::Unload; use Class::Load; use Try::Tiny; our %CACHE; sub import { my $package = shift; my %opts = @_; if ($opts{track_require}) { require Devel::OverrideGlobalRequire; require B; Devel::OverrideGlobalRequire::override_global_require(sub { my $next = shift; my ($file) = @_; my $ret = $next->(); $package->_update_cache_for($file) # require v5.8.1; unless ref(\$file) eq 'VSTRING' # require 5.008001; || !(B::svref_2object(\$file)->FLAGS & B::SVf_POK()); return $ret; }); } } sub refresh { my $class = shift; $class->refresh_module($_) for $class->modified_modules; } sub modified_modules { my $class = shift; my @ret; for my $file (keys %CACHE) { # refresh files that are in our # %CACHE but not in %INC push @ret, $class->_file_to_mod($file) if (!$INC{$file}); } for my $file (keys %INC) { if (exists $CACHE{$file}) { push @ret, $class->_file_to_mod($file) if $class->_mtime($file) ne $CACHE{$file}; } else { $class->_update_cache_for($file); } } return @ret; } sub refresh_module { my $class = shift; my ($mod) = @_; $mod = $class->_file_to_mod($mod); my @to_refresh = grep { exists $INC{ $class->_mod_to_file($_) } } $class->_dependent_modules($mod); $class->unload_module($_) for @to_refresh; $class->load_module($_) for @to_refresh; } sub unload_module { my $class = shift; my ($mod) = @_; $mod = $class->_file_to_mod($mod); Class::Unload->unload($mod); if (Class::Load::is_class_loaded('Class::MOP')) { Class::MOP::remove_metaclass_by_name($mod); } $class->_clear_cache_for($mod); } sub load_module { my $class = shift; my ($mod) = @_; $mod = $class->_file_to_mod($mod); try { Class::Load::load_class($mod); } catch { die $_; } finally { $class->_update_cache_for($mod); }; } sub _dependent_modules { my $class = shift; my ($mod) = @_; $mod = $class->_file_to_mod($mod); return ($mod) unless Class::Load::is_class_loaded('Class::MOP'); my $meta = Class::MOP::class_of($mod); return ($mod) unless $meta; if ($meta->isa('Class::MOP::Class')) { # attribute cloning (has '+foo') means that we can't skip refreshing # mutable classes return ( # NOTE: this order is important! $mod, map { $class->_dependent_modules($_) } ($meta->subclasses, # XXX: metacircularity? what if $class is Class::MOP::Class? ($mod->isa('Class::MOP::Class') ? (map { $_->name } grep { $_->isa($mod) } Class::MOP::get_all_metaclass_instances()) : ())), ); } elsif ($meta->isa('Moose::Meta::Role')) { return ( $mod, map { $class->_dependent_modules($_) } $meta->consumers, ); } else { die "Unknown metaclass: $meta"; } } sub _update_cache_for { my $class = shift; my ($file) = @_; $file = $class->_mod_to_file($file); $CACHE{$file} = $class->_mtime($file); } sub _clear_cache_for { my $class = shift; my ($file) = @_; $file = $class->_mod_to_file($file); delete $CACHE{$file}; } sub _mtime { my $class = shift; my ($file) = @_; $file = $class->_mod_to_file($file); return 1 if !$INC{$file}; return join ' ', (stat($INC{$file}))[1, 7, 9]; } sub _file_to_mod { my $class = shift; my ($file) = @_; return $file unless $file =~ /\.pm$/; my $mod = $file; $mod =~ s{\.pm$}{}; $mod =~ s{/}{::}g; return $mod; } sub _mod_to_file { my $class = shift; my ($mod) = @_; return $mod unless $mod =~ /^\w+(?:::\w+)*$/; my $file = $mod; $file =~ s{::}{/}g; $file .= '.pm'; return $file; } 1; __END__ =pod =head1 NAME Class::Refresh - refresh your classes during runtime =head1 VERSION version 0.05 =head1 SYNOPSIS use Class::Refresh; use Foo; Class::Refresh->refresh; # edit Foo.pm Class::Refresh->refresh; # changes in Foo.pm are applied =head1 DESCRIPTION During development, it is fairly common to cycle between writing code and testing that code. Generally the testing happens within the test suite, but frequently it is more convenient to test things by hand when tracking down a bug, or when doing some exploratory coding. In many situations, however, this becomes inconvenient - for instance, in a REPL, or in a stateful web application, restarting from the beginning after every code change can get pretty tedious. This module allows you to reload your application classes on the fly, so that the code/test cycle becomes a lot easier. This module takes a hash of import arguments, which can include: =over 4 =item track_require use Class::Refresh track_require => 1; If set, a C hook will be installed to track modules which are loaded. This will make the list of modules to reload when C is called more accurate, but may cause issues with other modules which hook into C (since the hook is global). =back This module has several limitations, due to reloading modules in this way being an inherently fragile operation. Therefore, this module is recommended for use only in development environments - it should not be used for reloading things in production. It makes several assumptions about how code is structured that simplify the logic involved quite a bit, and make it more reliable when those assumptions hold, but do make it inappropriate for use in certain cases. For instance, this module is named C for a reason: it is only intended for refreshing classes, where each file contains a single namespace, and each namespace corresponds to a single file, and all function calls happen through method dispatch. Unlike L, which makes an effort to track the files where subs were defined, this module assumes that refreshing a class means wiping out everything in the class's namespace, and reloading the file corresponding to that class. If your code includes multiple files that all load things into a common namespace, or defines multiple classes in a single file, this will likely not work. =head1 METHODS =head2 refresh The main entry point to the module. The first call to C populates a cache of modification times for currently loaded modules, and subsequent calls will refresh any classes which have changed since the previous call. =head2 modified_modules Returns a list of modules which have changed since the last call to C. =head2 refresh_module $mod This method calls C and C on C<$mod>, as well as on any classes that depend on C<$mod> (for instance, subclasses if C<$mod> is a class, or classes that consume C<$mod> if C<$mod> is a role). This ensures that all of your classes are consistent, even when dealing with things like immutable L classes. =head2 unload_module $mod Unloads C<$mod>, using L. =head2 load_module $mod Loads C<$mod>, using L. =head1 CAVEATS =over 4 =item Refreshing modules may miss modules which have been externally loaded since the last call to refresh This is because it's not easily possible to tell if a module has been modified since it was loaded, if we haven't seen it so far. A workaround for this may be to set the C option in the import arguments (see above), although this comes with its own set of caveats (since it is global behavior). =item Global variable accesses and function calls may not work as expected Perl resolves accesses to global variables and functions in other packages at compile time, so if the package is later reloaded, changes to those will not be noticed. As mentioned above, this module is intended for refreshing B. =item File modification times have a granularity of one second If you modify a file and then immediately call C and then immediately modify it again, the modification may not be seen on the next call to C. Note however that file size and inode number are also compared, so it still may be seen, depending on if either of those two things changed. =item Tracking modules which C a given module isn't possible For instance, modifying a L module which is used in a class won't cause the class to be refreshed, even if the change to the exporter would cause a change in the class's metaclass. =item Classes which build themselves differently based on the state of other classes may not work properly This module attempts to handle several cases of this sort for L classes (modifying a class will refresh all of its subclasses, modifying a role will refresh all classes and roles which consume that role, modifying a metaclass will refresh all classes whose metaclass is an instance of that metaclass), but it's not a problem that's solvable in the general case. =back =head1 BUGS =over 4 =item Reloading classes when their metaclass is modified doesn't quite work yet This will require modifications to Moose to support properly. =item Tracking changes to metaclasses other than the class metaclass isn't implemented yet =item Metacircularity probably has issues Refreshing a class which is its own metaclass will likely break. =back Please report any bugs through RT: email C, or browse to L. =head1 SEE ALSO L =head1 SUPPORT You can find this documentation for this module with the perldoc command. perldoc Class::Refresh You can also look for information at: =over 4 =item * MetaCPAN L =item * RT: CPAN's request tracker L =item * Github L =item * CPAN Ratings L =back =head1 CREDITS This module was based in large part on L by Jesse Vincent. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Jesse Luehrs. 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 moose-subclasses.t100644001750000144 267212162375271 17227 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Requires 'Moose'; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('moose-subclasses'); push @INC, $dir->dirname; our ($superclass_reloads, $subclass_reloads) = (0, 0); require Foo; require Foo::Sub; Class::Refresh->refresh; is($superclass_reloads, 1, "superclass loaded"); is($subclass_reloads, 1, "subclass loaded"); is_deeply([sort map { $_->name } Foo->meta->get_all_attributes], ['foo'], "correct starting attr list"); can_ok('Foo', 'meth'); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); is_deeply([sort map { $_->name } Foo::Sub->meta->get_all_attributes], ['baz', 'foo'], "correct starting attr list"); can_ok('Foo::Sub', 'meth'); ok(!Foo::Sub->can('other_meth'), "!Foo::Sub->can('other_meth')"); sleep 2; update_temp_dir_for('moose-subclasses', $dir); Class::Refresh->refresh; is($superclass_reloads, 2, "superclass reloaded"); is($subclass_reloads, 2, "subclass reloaded"); is_deeply([sort map { $_->name } Foo->meta->get_all_attributes], ['bar'], "correct new attr list"); ok(!Foo->can('meth'), "!Foo->can('meth')"); can_ok('Foo', 'other_meth'); is_deeply([sort map { $_->name } Foo::Sub->meta->get_all_attributes], ['bar', 'baz'], "correct new attr list"); can_ok('Foo::Sub', 'meth'); can_ok('Foo::Sub', 'other_meth'); done_testing; no-tabs.t100644001750000144 21212162375271 17057 0ustar00doyusers000000000000Class-Refresh-0.05/xt/releaseuse strict; use warnings; use Test::More; eval 'use Test::NoTabs'; plan skip_all => 'Test::NoTabs required' if $@; all_perl_files_ok(); moose-metaclasses.t100644001750000144 272512162375271 17363 0ustar00doyusers000000000000Class-Refresh-0.05/t#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Requires 'Moose', 'Test::Moose'; use lib 't/lib'; use Test::Class::Refresh; use Class::Refresh; my $dir = prepare_temp_dir_for('moose-metaclasses'); push @INC, $dir->dirname; our %reloaded; require Foo; require Bar; Class::Refresh->refresh; my $metaclass = Scalar::Util::blessed(Foo->meta); does_ok(Foo->meta, 'Foo::Meta::Class'); ok(!Moose::Util::does_role(Bar->meta, 'Foo::Meta::Class'), "!Bar->meta->does('Foo::Meta::Class')"); ok(Foo->meta->meta->find_attribute_by_name('meta_attr'), "has meta attribute"); ok(!Foo->meta->meta->find_attribute_by_name('meta_attr2'), "doesn't have other meta attribute"); is_deeply(\%reloaded, { foo => 1, foo_meta_class => 1, bar => 1 }, "everything loaded"); sleep 2; update_temp_dir_for('moose-metaclasses', $dir); Class::Refresh->refresh; does_ok(Foo->meta, 'Foo::Meta::Class'); ok(!Moose::Util::does_role(Bar->meta, 'Foo::Meta::Class'), "!Bar->meta->does('Foo::Meta::Class')"); { local $TODO = "moose needs a way to clear out its anon class cache"; ok(!Foo->meta->meta->find_attribute_by_name('meta_attr'), "doesn't have meta attribute"); ok(Foo->meta->meta->find_attribute_by_name('meta_attr2'), "has other meta attribute"); isnt(Scalar::Util::blessed(Foo->meta), $metaclass, "Foo got a new metaclass"); } is_deeply(\%reloaded, { foo => 2, foo_meta_class => 2, bar => 1 }, "everything loaded"); done_testing; pod-syntax.t100644001750000144 21212162375271 17622 0ustar00doyusers000000000000Class-Refresh-0.05/xt/release#!perl 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(); after000755001750000144 012162375271 16477 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/basicFoo.pm100644001750000144 10412162375271 17673 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/basic/afterpackage Foo; our $FOO = 10; our $BAZ = 30; sub other_meth { } 1; pod-coverage.t100644001750000144 52712162375271 20100 0ustar00doyusers000000000000Class-Refresh-0.05/xt/release#!perl 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' }); before000755001750000144 012162375271 16640 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/basicFoo.pm100644001750000144 7412162375271 20022 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/basic/beforepackage Foo; our $FOO = 1; our $BAR = 2; sub meth { } 1; Class000755001750000144 012162375271 16136 5ustar00doyusers000000000000Class-Refresh-0.05/t/lib/TestRefresh.pm100644001750000144 255212162375271 20236 0ustar00doyusers000000000000Class-Refresh-0.05/t/lib/Test/Classpackage Test::Class::Refresh; use strict; use warnings; use File::Copy; use File::Find; use File::Temp; use Exporter 'import'; our @EXPORT = qw(prepare_temp_dir_for update_temp_dir_for); sub rcopy { my ($from_dir, $to_dir) = @_; find( { no_chdir => 1, wanted => sub { my $from = $File::Find::name; (my $base = $from) =~ s/^$from_dir//; return unless length $base; my $to = $to_dir . $base; if (-d) { if (!-d $to) { mkdir $to or die "Couldn't create dir $to: $!"; } } else { copy($from, $to) or die "Couldn't copy $from to $to: $!"; utime(undef, undef, $to) or die "Couldn't set modification time for $to: $!"; } }, }, $from_dir ); } sub prepare_temp_dir_for { my ($test_id, $subdir) = @_; $subdir ||= 'before'; my $from_dir = 't/data/' . $test_id . "/$subdir"; my $to_dir = File::Temp->newdir; rcopy($from_dir, $to_dir); return $to_dir; } sub update_temp_dir_for { my ($test_id, $to_dir, $subdir) = @_; $subdir ||= 'after'; my $from_dir = 't/data/' . $test_id . "/$subdir"; rcopy($from_dir, $to_dir); } 1; after000755001750000144 012162375271 17306 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-apiFoo.pm100644001750000144 7312162375271 20467 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/afterpackage Foo; use Moose; sub other_meth { } no Moose; 1; before000755001750000144 012162375271 17447 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-apiFoo.pm100644001750000144 6512162375271 20631 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/beforepackage Foo; use Moose; sub meth { } no Moose; 1; after000755001750000144 012162375271 17655 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modulesFoo.pm100644001750000144 7212162375271 21035 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modules/afterpackage Foo; use strict; use warnings; sub bar { 3 } 1; after000755001750000144 012162375271 17617 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basicFoo.pm100644001750000144 12512162375271 21016 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/afterpackage Foo; use Moose; has bar => (is => 'ro'); sub other_meth { } no Moose; 1; before000755001750000144 012162375271 20023 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-rolesBar.pm100644001750000144 24512162375271 21206 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforepackage Bar; use Moose; $::reloads{bar}++; with 'Bar::Role'; has bar => ( is => 'ro', isa => 'Str', ); __PACKAGE__->meta->make_immutable; no Moose; 1; Baz.pm100644001750000144 26212162375271 21215 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforepackage Baz; use Moose; $::reloads{baz}++; with 'Bar::Role', 'Baz::Role'; has baz => ( is => 'ro', isa => 'Str', ); __PACKAGE__->meta->make_immutable; no Moose; 1; Foo.pm100644001750000144 24512162375271 21225 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforepackage Foo; use Moose; $::reloads{foo}++; with 'Foo::Role'; has foo => ( is => 'ro', isa => 'Str', ); __PACKAGE__->meta->make_immutable; no Moose; 1; before000755001750000144 012162375271 20016 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modulesFoo.pm100644001750000144 7212162375271 21176 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modules/beforepackage Foo; use strict; use warnings; sub bar { 1 } 1; middle000755001750000144 012162375271 20012 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modulesFoo.pm100644001750000144 7212162375271 21172 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/new-modules/middlepackage Foo; use strict; use warnings; sub bar { 2 } 1; before000755001750000144 012162375271 17760 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basicFoo.pm100644001750000144 11712162375271 21160 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/beforepackage Foo; use Moose; has foo => (is => 'ro'); sub meth { } no Moose; 1; after000755001750000144 012162375271 20175 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-errorFoo.pm100644001750000144 13412162375271 21374 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-error/afterpackage Foo; use Moose; has bar => (is => 'ro'); sub meth { my $error; 3 } no Moose; 1; Foo000755001750000144 012162375271 20031 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/afterBar.pm100644001750000144 14312162375271 21211 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/after/Foopackage Foo::Bar; use Moose; sub other_meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; before000755001750000144 012162375271 20336 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-errorFoo.pm100644001750000144 12112162375271 21531 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-error/beforepackage Foo; use Moose; has foo => (is => 'ro'); sub meth { 1 } no Moose; 1; middle000755001750000144 012162375271 20332 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-errorFoo.pm100644001750000144 13112162375271 21526 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/compile-error/middlepackage Foo; use Moose; has bar => (is => 'ro'); sub meth { $error; 2 } no Moose; 1; Foo000755001750000144 012162375271 20172 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/beforeBar.pm100644001750000144 7212162375271 21333 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/before/Foopackage Foo::Bar; use Moose; sub meth { } no Moose; 1; Baz.pm100644001750000144 7212162375271 21343 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/other-api/before/Foopackage Foo::Baz; use Moose; sub meth { } no Moose; 1; after000755001750000144 012162375271 20400 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-loadFoo.pm100644001750000144 13312162375271 21576 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/afterpackage Foo; use Moose; has baz => (is => 'ro'); sub other_other_meth { } no Moose; 1; Foo000755001750000144 012162375271 20405 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/afterRole.pm100644001750000144 21412162375271 21761 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/after/Foopackage Foo::Role; use Moose::Role; $::reloads{foo_role}++; has foo_role2 => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1; after000755001750000144 012162375271 20705 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclassesFoo.pm100644001750000144 22212162375271 22102 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclasses/afterpackage Foo; use Moose; $::superclass_reloads++; has bar => (is => 'ro'); sub other_meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; before000755001750000144 012162375271 20541 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-loadFoo.pm100644001750000144 11712162375271 21741 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/beforepackage Foo; use Moose; has foo => (is => 'ro'); sub meth { } no Moose; 1; middle000755001750000144 012162375271 20535 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-loadFoo.pm100644001750000144 12512162375271 21734 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/middlepackage Foo; use Moose; has bar => (is => 'ro'); sub other_meth { } no Moose; 1; Baz000755001750000144 012162375271 20537 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforeRole.pm100644001750000144 21312162375271 22112 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/before/Bazpackage Baz::Role; use Moose::Role; $::reloads{baz_role}++; has baz_role => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1; Bar000755001750000144 012162375271 20527 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforeRole.pm100644001750000144 23612162375271 22107 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/before/Barpackage Bar::Role; use Moose::Role; $::reloads{bar_role}++; with 'Foo::Role'; has bar_role => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1; Foo000755001750000144 012162375271 20546 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/beforeRole.pm100644001750000144 21412162375271 22122 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-roles/before/Foopackage Foo::Role; use Moose::Role; $::reloads{foo_role}++; has foo_role1 => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1; before000755001750000144 012162375271 21046 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclassesFoo.pm100644001750000144 21412162375271 22244 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclasses/beforepackage Foo; use Moose; $::superclass_reloads++; has foo => (is => 'ro'); sub meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; before000755001750000144 012162375271 21203 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclassesBar.pm100644001750000144 14012162375271 22360 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/beforepackage Bar; use Moose; $::reloaded{bar}++; __PACKAGE__->meta->make_immutable; no Moose; 1; Foo.pm100644001750000144 35112162375271 22403 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/beforepackage Foo; use Moose; $::reloaded{foo}++; Moose::Util::MetaRole::apply_metaroles( for => __PACKAGE__, class_metaroles => { class => ['Foo::Meta::Class'] }, ); __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 21571 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclasses/beforeSub.pm100644001750000144 23712162375271 23002 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-subclasses/before/Foopackage Foo::Sub; use Moose; $::subclass_reloads++; extends 'Foo'; has baz => (is => 'ro'); sub meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 20342 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/afterImmutable.pm100644001750000144 20312162375271 22732 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/after/Foopackage Foo::Immutable; use Moose; has bar => (is => 'ro'); sub other_meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 20503 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/beforeImmutable.pm100644001750000144 17512162375271 23103 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-basic/before/Foopackage Foo::Immutable; use Moose; has foo => (is => 'ro'); sub meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 21123 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/afterImmutable.pm100644001750000144 21112162375271 23512 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/after/Foopackage Foo::Immutable; use Moose; has baz => (is => 'ro'); sub other_other_meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 21264 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/beforeImmutable.pm100644001750000144 17512162375271 23664 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/before/Foopackage Foo::Immutable; use Moose; has foo => (is => 'ro'); sub meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Foo000755001750000144 012162375271 21260 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/middleImmutable.pm100644001750000144 20312162375271 23650 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-late-load/middle/Foopackage Foo::Immutable; use Moose; has bar => (is => 'ro'); sub other_meth { } __PACKAGE__->meta->make_immutable; no Moose; 1; Meta000755001750000144 012162375271 22453 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/after/FooClass.pm100644001750000144 23312162375271 24174 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/after/Foo/Metapackage Foo::Meta::Class; use Moose::Role; $::reloaded{foo_meta_class}++; has meta_attr2 => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1; Meta000755001750000144 012162375271 22614 5ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/before/FooClass.pm100644001750000144 23212162375271 24334 0ustar00doyusers000000000000Class-Refresh-0.05/t/data/moose-metaclasses/before/Foo/Metapackage Foo::Meta::Class; use Moose::Role; $::reloaded{foo_meta_class}++; has meta_attr => ( is => 'ro', isa => 'Str', ); no Moose::Role; 1;