Catalyst-Action-RenderView-0.17/000755 000766 000024 00000000000 14702556541 017003 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/LICENSE000644 000766 000024 00000046556 14702556541 020030 0ustar00gknopstaff000000 000000 This software is copyright (c) 2006 - 2009 by Marcus Ramberg and Florian Ragwitz. 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) 2006 - 2009 by Marcus Ramberg and Florian Ragwitz. 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 Perl Artistic License 1.0 --- This software is Copyright (c) 2006 - 2009 by Marcus Ramberg and Florian Ragwitz. This is free software, licensed under: The Perl 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 as specified below. "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 uunet.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) give non-standard executables non-standard names, and clearly document 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. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 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 whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Catalyst-Action-RenderView-0.17/Changes000644 000766 000024 00000003616 14702556541 020304 0ustar00gknopstaff000000 000000 Revision history for Perl extension Catalyst-Action-RenderView 0.17 2024-10-12 - fix Makefile.PL to work without PERL_USE_UNSAFE_INC - revised packaging to use Dist::Zilla - drop unused prereq HTTP::Request::AsCGI 0.16 2011-01-05 19:28:00 GMT - Fix bug accidentally introduced in the last version with response 3xx statuses. 0.15 2011-01-04 14:19:36 CET - Don't delegate to a view if the response body is set to `undef'. - Make sure a Test::More with done_testing support is available. 0.14 2009-12-03 03:13:23 GMT - Remove warnings from tests about actions in the app root 0.13 2009-10-24 04:48:03 PDT - Re-release 0.12 without changes for reindexing by CPAN/PAUSE. 0.12 2009-10-18 19:10:00 BST - Fixup copyright information 0.11 2009-06-28 19:29:16 - Update Module::Install to 0.87 to unbreak auto_install. No functional changes. 0.10 2009-04-29 18:24:50 - Depend on Data::Visitor 0.24 to avoid Class::MOP deprecation warnings. (Florian Ragwitz) 0.09 2009-02-18 21:32:00 - Store config in $c->config->{'Action::RenderView'} instead of $c->config->{debug}. Config from $c->config->{debug} is deprecated, but still supported. - Switch from NEXT to next::method 0.08 2008-05-02 19:40:00 - Add AsCGI to list of test requirements. - Check for defined()ness of $c->res->body so "0" is valid. (RT #30564) 0.07 2007-09-01 11:03:00 - Add DateTime to default list of scrubbed objects - Stringify rather than ref by default , more explicit message 0.06 2007-08-29 16:35:00 - Add support for scrubbing stash objects. - Remove undef warning 0.05 2007-04-26 - switch to Module::Install 0.04 2006-07-04 09:21:00 - That debug code wasn't quite production ready : / 0.03 2006-07-02 11:26:00 - Forgot to update use test as well, silly git. 0.02 2006-06-29 14:59:00 - Oops, moved content check ending brace up. 0.01 2006-06-26 17:14:00 - Initial release Catalyst-Action-RenderView-0.17/prereqs.yml000644 000766 000024 00000000231 14702556541 021203 0ustar00gknopstaff000000 000000 runtime: requires: perl: 5.008005 Catalyst::Runtime: 5.80030 Data::Visitor: 0.24 MRO::Compat: 0 test: requires: Test::More: 0.88 Catalyst-Action-RenderView-0.17/MANIFEST000644 000766 000024 00000001323 14702556541 020133 0ustar00gknopstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.032. .perlcriticrc Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README dist.ini lib/Catalyst/Action/RenderView.pm prereqs.yml t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/01use.t t/04live.t t/lib/TestApp.pm t/lib/TestApp/Controller/Root.pm t/lib/TestApp/View/TestView.pm weaver.ini xt/author/cpan-changes.t xt/author/critic.t xt/author/distmeta.t xt/author/eol.t xt/author/kwalitee.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t xt/release/changes_has_content.t Catalyst-Action-RenderView-0.17/t/000755 000766 000024 00000000000 14702556541 017246 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/xt/000755 000766 000024 00000000000 14702556541 017436 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/README000644 000766 000024 00000006071 14702556541 017667 0ustar00gknopstaff000000 000000 NAME Catalyst::Action::RenderView - Sensible default end action. SYNOPSIS sub end : ActionClass('RenderView') {} DESCRIPTION This action implements a sensible default end action, which will forward to the first available view, unless "$c->res->status" is a 3xx code (redirection, not modified, etc.), 204 (no content), or "$c->res->body" has already been set. It also allows you to pass "dump_info=1" to the url in order to force a debug screen, while in debug mode. If you have more than one view, you can specify which one to use with the "default_view" config setting and the "current_view" and "current_view_instance" stash keys (see Catalyst's "$c->view($name)" method -- this module simply calls "$c->view" with no argument). METHODS end The default "end" action. You can override this as required in your application class; normal inheritance applies. INTERNAL METHODS execute Dispatches control to superclasses, then forwards to the default View. See "METHODS/action" in Catalyst::Action. SCRUBBING OUTPUT When you force debug with dump_info=1, RenderView is capable of removing classes from the objects in your stash. By default it will replace any DBIx::Class ResultSource objects with the class name, which cleans up the debug output considerably, but you can change what gets scrubbed by setting a list of classes in $c->config->{'Action::RenderView'}->{ignore_classes}. For instance: $c->config->{'Action::RenderView'}->{ignore_classes} = []; To disable the functionality. You can also set config->{'Action::RenderView'}->{scrubber_func} to change what it does with the classes. For instance, this will undef it instead of putting in the class name: $c->config->{'Action::RenderView'}->{scrubber_func} = sub { undef $_ }; Deprecation notice This plugin used to be configured by setting "$c->config->{debug}". That configuration key is still supported in this release, but is deprecated, please use the 'Action::RenderView' namespace as shown above for configuration in new code. EXTENDING To add something to an "end" action that is called before rendering, simply place it in the "end" method: sub end : ActionClass('RenderView') { my ( $self, $c ) = @_; # do stuff here; the RenderView action is called afterwards } To add things to an "end" action that are called *after* rendering, you can set it up like this: sub render : ActionClass('RenderView') { } sub end : Private { my ( $self, $c ) = @_; $c->forward('render'); # do stuff here } AUTHORS * Marcus Ramberg * Florian Ragwitz CONTRIBUTOR Graham Knop COPYRIGHT AND LICENSE This software is copyright (c) 2006 - 2009 by Marcus Ramberg and Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Catalyst-Action-RenderView-0.17/MANIFEST.SKIP000644 000766 000024 00000000614 14702556541 020702 0ustar00gknopstaff000000 000000 \bCatalyst-Action-RenderView # Avoid version control files. \bRCS\b \bCVS\b ,v$ \B\.svn\b \B\.git\b # Avoid Makemaker generated and utility files. \bMakefile$ \bblib \bMakeMaker-\d \bpm_to_blib$ \bblibdirs$ ^MANIFEST\.SKIP$ # Avoid Module::Build generated and utility files. \bBuild$ \b_build # Avoid temp and backup files. ~$ \.tmp$ \.old$ \.bak$ \#$ \b\.# \.DS_Store$ # No tarballs! \.gz$ Catalyst-Action-RenderView-0.17/META.yml000644 000766 000024 00000002072 14702556541 020255 0ustar00gknopstaff000000 000000 --- abstract: 'Sensible default end action.' author: - 'Marcus Ramberg ' - 'Florian Ragwitz ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0.88' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.032, 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: Catalyst-Action-RenderView provides: Catalyst::Action::RenderView: file: lib/Catalyst/Action/RenderView.pm version: '0.17' requires: Catalyst::Runtime: '5.80030' Data::Visitor: '0.24' MRO::Compat: '0' perl: '5.008005' resources: repository: https://github.com/perl-catalyst/Catalyst-Action-RenderView.git version: '0.17' x_contributors: - 'Graham Knop ' x_generated_by_perl: v5.38.2 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_static_install: 1 x_use_unsafe_inc: 0 Catalyst-Action-RenderView-0.17/lib/000755 000766 000024 00000000000 14702556541 017551 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/Makefile.PL000644 000766 000024 00000002642 14702556541 020761 0ustar00gknopstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.032. use strict; use warnings; use 5.008005; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Sensible default end action.", "AUTHOR" => "Marcus Ramberg , Florian Ragwitz ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Catalyst-Action-RenderView", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008005", "NAME" => "Catalyst::Action::RenderView", "PREREQ_PM" => { "Catalyst::Runtime" => "5.80030", "Data::Visitor" => "0.24", "MRO::Compat" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.88" }, "VERSION" => "0.17", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Catalyst::Runtime" => "5.80030", "Data::Visitor" => "0.24", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "MRO::Compat" => 0, "Test::More" => "0.88" ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Catalyst-Action-RenderView-0.17/weaver.ini000644 000766 000024 00000000163 14702556541 020775 0ustar00gknopstaff000000 000000 [@CorePrep] [-SingleEncoding] [-StopWords] [Generic / NAME] [Leftovers] [Bugs] [Authors] [Contributors] [Legal] Catalyst-Action-RenderView-0.17/.perlcriticrc000644 000766 000024 00000006251 14702556541 021475 0ustar00gknopstaff000000 000000 severity = 1 verbose = 9 only = 1 [BuiltinFunctions::ProhibitLvalueSubstr] [BuiltinFunctions::ProhibitShiftRef] [BuiltinFunctions::ProhibitSleepViaSelect] [BuiltinFunctions::ProhibitStringyEval] [BuiltinFunctions::ProhibitUniversalCan] [BuiltinFunctions::ProhibitUniversalIsa] [BuiltinFunctions::ProhibitVoidGrep] [BuiltinFunctions::ProhibitVoidMap] [BuiltinFunctions::RequireGlobFunction] [BuiltinFunctions::RequireSimpleSortBlock] [ClassHierarchies::ProhibitOneArgBless] [CodeLayout::ProhibitHardTabs] [CodeLayout::RequireConsistentNewlines] [ControlStructures::ProhibitCascadingIfElse] [ControlStructures::ProhibitDeepNests] [ControlStructures::ProhibitLabelsWithSpecialBlockNames] [ControlStructures::ProhibitMutatingListFunctions] [ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions] [ControlStructures::ProhibitUnreachableCode] [ControlStructures::ProhibitYadaOperator] [ErrorHandling::RequireCheckingReturnValueOfEval] [InputOutput::ProhibitBacktickOperators] [InputOutput::ProhibitBarewordFileHandles] [InputOutput::ProhibitExplicitStdin] [InputOutput::ProhibitInteractiveTest] [InputOutput::ProhibitJoinedReadline] [InputOutput::ProhibitOneArgSelect] [InputOutput::ProhibitReadlineInForLoop] [InputOutput::ProhibitTwoArgOpen] [InputOutput::RequireCheckedOpen] [InputOutput::RequireEncodingWithUTF8Layer] [Miscellanea::ProhibitFormats] [Miscellanea::ProhibitUnrestrictedNoCritic] [Modules::ProhibitAutomaticExportation] [Modules::ProhibitConditionalUseStatements] [Modules::ProhibitEvilModules] [Modules::ProhibitExcessMainComplexity] [Modules::RequireBarewordIncludes] [Modules::RequireEndWithOne] [Modules::RequireFilenameMatchesPackage] [NamingConventions::ProhibitAmbiguousNames] [Objects::ProhibitIndirectSyntax] [RegularExpressions::ProhibitCaptureWithoutTest] [RegularExpressions::ProhibitComplexRegexes] [RegularExpressions::ProhibitUnusedCapture] [Subroutines::ProhibitBuiltinHomonyms] [Subroutines::ProhibitExcessComplexity] max_mccabe = 30 [Subroutines::ProhibitExplicitReturnUndef] [Subroutines::ProhibitManyArgs] [Subroutines::ProhibitNestedSubs] [Subroutines::ProhibitReturnSort] [Subroutines::ProhibitUnusedPrivateSubroutines] [Subroutines::ProtectPrivateSubs] [TestingAndDebugging::ProhibitProlongedStrictureOverride] [TestingAndDebugging::RequireTestLabels] [TestingAndDebugging::RequireUseStrict] [TestingAndDebugging::RequireUseWarnings] [ValuesAndExpressions::ProhibitCommaSeparatedStatements] [ValuesAndExpressions::ProhibitComplexVersion] [ValuesAndExpressions::ProhibitImplicitNewlines] [ValuesAndExpressions::ProhibitLeadingZeros] [ValuesAndExpressions::ProhibitMismatchedOperators] [ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters] [ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator] [ValuesAndExpressions::RequireQuotedHeredocTerminator] [Variables::ProhibitAugmentedAssignmentInDeclaration] allow_our = 1 [Variables::ProhibitConditionalDeclarations] [Variables::ProhibitMatchVars] [Variables::ProhibitReusedNames] [Variables::ProhibitUnusedVariables] [Variables::ProtectPrivateVars] [Variables::RequireInitializationForLocalVars] [Variables::RequireLexicalLoopIterators] [Variables::RequireLocalizedPunctuationVars] [Variables::RequireNegativeIndices] Catalyst-Action-RenderView-0.17/META.json000644 000766 000024 00000005027 14702556541 020430 0ustar00gknopstaff000000 000000 { "abstract" : "Sensible default end action.", "author" : [ "Marcus Ramberg ", "Florian Ragwitz " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Catalyst-Action-RenderView", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage::TrustMe" : "0", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Version" : "1" } }, "runtime" : { "requires" : { "Catalyst::Runtime" : "5.80030", "Data::Visitor" : "0.24", "MRO::Compat" : "0", "perl" : "5.008005" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.88" } } }, "provides" : { "Catalyst::Action::RenderView" : { "file" : "lib/Catalyst/Action/RenderView.pm", "version" : "0.17" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "x_url" : "https://github.com/perl-catalyst/Catalyst-Action-RenderView/issues" }, "repository" : { "type" : "git", "url" : "https://github.com/perl-catalyst/Catalyst-Action-RenderView.git", "web" : "https://github.com/perl-catalyst/Catalyst-Action-RenderView" } }, "version" : "0.17", "x_contributors" : [ "Graham Knop " ], "x_generated_by_perl" : "v5.38.2", "x_serialization_backend" : "Cpanel::JSON::XS version 4.37", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_static_install" : 1, "x_use_unsafe_inc" : 0 } Catalyst-Action-RenderView-0.17/dist.ini000644 000766 000024 00000004477 14702556541 020463 0ustar00gknopstaff000000 000000 name = Catalyst-Action-RenderView copyright_year = 2006 - 2009 license = Perl_5 author = Marcus Ramberg author = Florian Ragwitz copyright_holder = Marcus Ramberg and Florian Ragwitz ;;; Gather [Git::GatherDir] exclude_filename = Makefile.PL exclude_filename = META.json exclude_filename = LICENSE exclude_filename = README.md [GatherFile] filename = .perlcriticrc ;;; Metadata [Git::Contributors] [MetaProvides::Package] [MetaResources] bugtracker.url = https://github.com/perl-catalyst/Catalyst-Action-RenderView/issues repository.url = https://github.com/perl-catalyst/Catalyst-Action-RenderView.git repository.web = https://github.com/perl-catalyst/Catalyst-Action-RenderView repository.type = git [PrereqsFile] [UseUnsafeInc] dot_in_INC = 0 ;;; Modification [PodWeaver] ; authordep Pod::Weaver::Section::Contributors ; authordep Pod::Weaver::Plugin::StopWords ;;; Extra Files [License] [MetaJSON] [MetaYAML] [Manifest] [Pod2Readme] ;;; Installer [MakeMaker] [StaticInstall] mode = on ;;; Tests [MetaTests] [MojibakeTests] [PodSyntaxTests] [Test::CPAN::Changes] [Substitute / RenameTestCPANChanges] -version = 0.008 file = xt/release/cpan-changes.t filename_code = s{release}{author}; [Test::ChangesHasContent] [Test::Compile] [Test::EOL] [Test::Kwalitee] filename = xt/author/kwalitee.t [Test::MinimumVersion] [Test::NoTabs] [Test::Perl::Critic] critic_config = .perlcriticrc [Substitute / VerboseCritic] file = xt/author/critic.t code = s/ x!!.*;/;/; s/(-profile)/-verbose => 8, $1/; [Test::Pod::Coverage::TrustMe] [Test::PodSpelling] [Test::Portability] options = test_one_dot = 0 [Test::ReportPrereqs] [Test::Version] ;;; Repo files [CopyFilesFromRelease] filename = Makefile.PL filename = META.json filename = LICENSE [ReadmeAnyFromPod / ReadmeGFMInRoot] phase = release [Regenerate::AfterReleasers] plugin = CopyFilesFromRelease plugin = ReadmeGFMInRoot ;;; Release [TestRelease] [RunExtraTests] [ConfirmRelease] [UploadToCPAN] [Git::Check] [Git::Remote::Check] branch = master [@Git::VersionManager] -remove = Prereqs commit_files_after_release = Makefile.PL commit_files_after_release = META.json commit_files_after_release = LICENSE commit_files_after_release = README.md NextRelease.format = %-6v %{yyyy-MM-dd}d%{ (TRIAL RELEASE)}T [Git::Push] Catalyst-Action-RenderView-0.17/lib/Catalyst/000755 000766 000024 00000000000 14702556541 021335 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/lib/Catalyst/Action/000755 000766 000024 00000000000 14702556541 022552 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/lib/Catalyst/Action/RenderView.pm000644 000766 000024 00000012151 14702556541 025162 0ustar00gknopstaff000000 000000 package Catalyst::Action::RenderView; use strict; use warnings; our $VERSION = '0.17'; use base 'Catalyst::Action'; use MRO::Compat; use Data::Visitor::Callback; my %ignore_classes = (); sub execute { my $self = shift; my ($controller, $c ) = @_; $self->next::method( @_ ); $c->config->{'Action::RenderView'}->{ignore_classes} = ( ref($c->config->{'debug'}) eq 'HASH' ? $c->config->{'debug'}->{ignore_classes} : undef ) || [ qw/ DBIx::Class::ResultSource::Table DBIx::Class::ResultSourceHandle DateTime / ] unless exists $c->config->{'Action::RenderView'}->{ignore_classes}; $c->config->{'Action::RenderView'}->{scrubber_func} = ( ref($c->config->{'debug'}) eq 'HASH' ? $c->config->{'debug'}->{scrubber_func} : undef ) || sub { $_='[stringified to: ' . $_ . ']' } unless exists $c->config->{'Action::RenderView'}->{scrubber_func}; if ($c->debug && $c->req->params->{dump_info}) { unless ( keys %ignore_classes ) { foreach my $class (@{$c->config->{'Action::RenderView'}->{ignore_classes}}) { $ignore_classes{$class} = $c->config->{'Action::RenderView'}->{scrubber_func}; } } my $scrubber=Data::Visitor::Callback->new( "ignore_return_values" => 1, "object" => "visit_ref", %ignore_classes, ); $scrubber->visit( $c->stash ); die('Forced debug - Scrubbed output'); } if(! $c->response->content_type ) { $c->response->content_type( 'text/html; charset=utf-8' ); } return 1 if $c->req->method eq 'HEAD'; return 1 if defined $c->response->body; return 1 if scalar @{ $c->error } && !$c->stash->{template}; return 1 if $c->response->status =~ /^(?:204|3\d\d)$/; my $view = $c->view() || die "Catalyst::Action::RenderView could not find a view to forward to.\n"; $c->forward( $view ); }; 1; __END__ =pod =encoding UTF-8 =for :stopwords Marcus Ramberg Florian Ragwitz and 3xx ResultSource =head1 NAME Catalyst::Action::RenderView - Sensible default end action. =head1 SYNOPSIS sub end : ActionClass('RenderView') {} =head1 DESCRIPTION This action implements a sensible default end action, which will forward to the first available view, unless C<< $c->res->status >> is a 3xx code (redirection, not modified, etc.), 204 (no content), or C<< $c->res->body >> has already been set. It also allows you to pass C to the url in order to force a debug screen, while in debug mode. If you have more than one view, you can specify which one to use with the C config setting and the C and C stash keys (see L's C<$c-Eview($name)> method -- this module simply calls C<< $c->view >> with no argument). =head1 METHODS =head2 end The default C action. You can override this as required in your application class; normal inheritance applies. =head1 INTERNAL METHODS =head2 execute Dispatches control to superclasses, then forwards to the default View. See L. =head1 SCRUBBING OUTPUT When you force debug with dump_info=1, RenderView is capable of removing classes from the objects in your stash. By default it will replace any DBIx::Class ResultSource objects with the class name, which cleans up the debug output considerably, but you can change what gets scrubbed by setting a list of classes in $c->config->{'Action::RenderView'}->{ignore_classes}. For instance: $c->config->{'Action::RenderView'}->{ignore_classes} = []; To disable the functionality. You can also set config->{'Action::RenderView'}->{scrubber_func} to change what it does with the classes. For instance, this will undef it instead of putting in the class name: $c->config->{'Action::RenderView'}->{scrubber_func} = sub { undef $_ }; =head2 Deprecation notice This plugin used to be configured by setting C<< $c->config->{debug} >>. That configuration key is still supported in this release, but is deprecated, please use the C< 'Action::RenderView' > namespace as shown above for configuration in new code. =head1 EXTENDING To add something to an C action that is called before rendering, simply place it in the C method: sub end : ActionClass('RenderView') { my ( $self, $c ) = @_; # do stuff here; the RenderView action is called afterwards } To add things to an C action that are called I rendering, you can set it up like this: sub render : ActionClass('RenderView') { } sub end : Private { my ( $self, $c ) = @_; $c->forward('render'); # do stuff here } =head1 AUTHORS =over 4 =item * Marcus Ramberg =item * Florian Ragwitz =back =head1 CONTRIBUTOR =for stopwords Graham Knop Graham Knop =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2006 - 2009 by Marcus Ramberg and Florian Ragwitz. 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 Catalyst-Action-RenderView-0.17/xt/author/000755 000766 000024 00000000000 14702556541 020740 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/xt/release/000755 000766 000024 00000000000 14702556541 021056 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/xt/release/changes_has_content.t000644 000766 000024 00000002100 14702556541 025231 0ustar00gknopstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.17'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Catalyst-Action-RenderView-0.17/xt/author/mojibake.t000644 000766 000024 00000000151 14702556541 022703 0ustar00gknopstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); Catalyst-Action-RenderView-0.17/xt/author/kwalitee.t000644 000766 000024 00000000275 14702556541 022736 0ustar00gknopstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; Catalyst-Action-RenderView-0.17/xt/author/no-tabs.t000644 000766 000024 00000000712 14702556541 022470 0ustar00gknopstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Catalyst/Action/RenderView.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01use.t', 't/04live.t', 't/lib/TestApp.pm', 't/lib/TestApp/Controller/Root.pm', 't/lib/TestApp/View/TestView.pm' ); notabs_ok($_) foreach @files; done_testing; Catalyst-Action-RenderView-0.17/xt/author/critic.t000644 000766 000024 00000000171 14702556541 022401 0ustar00gknopstaff000000 000000 #!perl use strict; use warnings; use Test::Perl::Critic (-verbose => 8, -profile => ".perlcriticrc"); all_critic_ok(); Catalyst-Action-RenderView-0.17/xt/author/minimum-version.t000644 000766 000024 00000000154 14702556541 024263 0ustar00gknopstaff000000 000000 use strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_from_metayml_ok(); Catalyst-Action-RenderView-0.17/xt/author/test-version.t000644 000766 000024 00000000637 14702556541 023575 0ustar00gknopstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; Catalyst-Action-RenderView-0.17/xt/author/eol.t000644 000766 000024 00000000744 14702556541 021711 0ustar00gknopstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Catalyst/Action/RenderView.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01use.t', 't/04live.t', 't/lib/TestApp.pm', 't/lib/TestApp/Controller/Root.pm', 't/lib/TestApp/View/TestView.pm' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Catalyst-Action-RenderView-0.17/xt/author/pod-syntax.t000644 000766 000024 00000000252 14702556541 023232 0ustar00gknopstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Catalyst-Action-RenderView-0.17/xt/author/portability.t000644 000766 000024 00000000163 14702556541 023467 0ustar00gknopstaff000000 000000 use strict; use warnings; use Test::More; use Test::Portability::Files; options(test_one_dot => 0); run_tests(); Catalyst-Action-RenderView-0.17/xt/author/distmeta.t000644 000766 000024 00000000223 14702556541 022734 0ustar00gknopstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use strict; use warnings; use Test::CPAN::Meta; meta_yaml_ok(); Catalyst-Action-RenderView-0.17/xt/author/pod-spell.t000644 000766 000024 00000000504 14702556541 023023 0ustar00gknopstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Action Catalyst Florian Graham Knop Marcus Ragwitz Ramberg RenderView and haarg lib marcus rafl Catalyst-Action-RenderView-0.17/xt/author/cpan-changes.t000644 000766 000024 00000000344 14702556541 023455 0ustar00gknopstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.013 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; Catalyst-Action-RenderView-0.17/xt/author/pod-coverage.t000644 000766 000024 00000000556 14702556541 023506 0ustar00gknopstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::TrustMe v1.0.0 use strict; use warnings; use Test::More; use Test::Pod::Coverage::TrustMe; my $config = {}; my $modules = [ "Catalyst::Action::RenderView", ]; plan tests => scalar @$modules; for my $module (@$modules) { pod_coverage_ok($module, $config); } done_testing; Catalyst-Action-RenderView-0.17/t/01use.t000644 000766 000024 00000000131 14702556541 020363 0ustar00gknopstaff000000 000000 use strict; use Test::More tests => 1; BEGIN { use_ok('Catalyst::Action::RenderView') } Catalyst-Action-RenderView-0.17/t/00-compile.t000644 000766 000024 00000002653 14702556541 021306 0ustar00gknopstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Catalyst/Action/RenderView.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Catalyst-Action-RenderView-0.17/t/00-report-prereqs.t000644 000766 000024 00000013601 14702556541 022643 0ustar00gknopstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if grep { $_ eq $mod } @exclude; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; if ($mod eq 'perl') { push @reports, ['perl', $want, $]]; next; } my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: Catalyst-Action-RenderView-0.17/t/lib/000755 000766 000024 00000000000 14702556541 020014 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/t/00-report-prereqs.dd000644 000766 000024 00000004211 14702556541 022764 0ustar00gknopstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.88', 'Test::NoTabs' => '0', 'Test::Perl::Critic' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage::TrustMe' => '0', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Version' => '1' } }, 'runtime' => { 'requires' => { 'Catalyst::Runtime' => '5.80030', 'Data::Visitor' => '0.24', 'MRO::Compat' => '0', 'perl' => '5.008005' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Test::More' => '0.88' } } }; $x; }Catalyst-Action-RenderView-0.17/t/04live.t000644 000766 000024 00000004317 14702556541 020543 0ustar00gknopstaff000000 000000 #!perl use strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use Test::More 0.88; use Catalyst::Test 'TestApp'; run_tests(); done_testing; sub run_tests { # test first available view { my $expected = 'View'; my $request = HTTP::Request->new( GET => 'http://localhost:3000/test_firstview' ); ok( my $response = request($request), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' ); is( $response->code, 200, 'Response Code' ); is( $response->content, $expected, 'Content OK' ); } # test view { my $expected = 'View'; my $request = HTTP::Request->new( GET => 'http://localhost:3000/test_view' ); ok( my $response = request($request), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' ); is( $response->code, 200, 'Response Code' ); is( $response->content, $expected, 'Content OK' ); } # test skip view { my $expected = 'Skipped View'; my $request = HTTP::Request->new( GET => 'http://localhost:3000/test_skipview' ); ok( my $response = request($request), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' ); is( $response->code, 200, 'Response Code' ); is( $response->content, $expected, 'Content OK' ); } # test X-Sendfile case { my $request = HTTP::Request->new( GET => 'http://localhost:3000/test_definedbody_skipsview' ); ok( my $response = request($request), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' ); is( $response->code, 200, 'Response Code' ); is( $response->content, '', 'Content OK' ); is( $response->header('X-Sendfile'), '/some/file/path', 'X-Sendfile header present' ); } } Catalyst-Action-RenderView-0.17/t/lib/TestApp/000755 000766 000024 00000000000 14702556541 021374 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/t/lib/TestApp.pm000644 000766 000024 00000000252 14702556541 021731 0ustar00gknopstaff000000 000000 package TestApp; use strict; use warnings; use Catalyst; use base qw/Catalyst/; __PACKAGE__->config( name => 'TestApp', root => '/some/dir' ); __PACKAGE__->setup; 1; Catalyst-Action-RenderView-0.17/t/lib/TestApp/Controller/000755 000766 000024 00000000000 14702556541 023517 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/t/lib/TestApp/View/000755 000766 000024 00000000000 14702556541 022306 5ustar00gknopstaff000000 000000 Catalyst-Action-RenderView-0.17/t/lib/TestApp/View/TestView.pm000644 000766 000024 00000000214 14702556541 024413 0ustar00gknopstaff000000 000000 package TestApp::View::TestView; use base qw( Catalyst::View ); sub process { my( $self, $c ) = @_; $c->res->body( 'View' ); } 1;Catalyst-Action-RenderView-0.17/t/lib/TestApp/Controller/Root.pm000644 000766 000024 00000001246 14702556541 025003 0ustar00gknopstaff000000 000000 package TestApp::Controller::Root; use strict; use warnings; use base qw/Catalyst::Controller/; __PACKAGE__->config( namespace => '' ); sub test_view : Global { my( $self, $c ) = @_; $c->config->{ view } = 'TestApp::View::TestView'; return 1; } sub test_firstview : Global { my( $self, $c ) = @_; delete $c->config->{ view }; return 1; } sub test_skipview : Global { my( $self, $c ) = @_; $c->res->body( 'Skipped View' ); } sub test_definedbody_skipsview : Global { my( $self, $c ) = @_; $c->res->header('X-Sendfile', '/some/file/path'); # This is the use-case $c->res->body( '' ); } sub end : ActionClass('RenderView') {} 1;