Return-Value-1.666003000755000766000766 012227372447 13421 5ustar00rjbsrjbs000000000000README100644000766000766 46112227372447 14343 0ustar00rjbsrjbs000000000000Return-Value-1.666003 This archive contains the distribution Return-Value, version 1.666003: (deprecated) polymorphic return values This software is copyright (c) 2005 by Casey West. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Changes100644000766000766 267412227372447 15006 0ustar00rjbsrjbs000000000000Return-Value-1.666003Release history for Return-Value 1.666003 2013-10-15 22:08:36 America/New_York removed warning; I wash my hands of this library forever -- rjbs, 2013-10-15 typo fixes; thanks, David Steinbrunner! 1.666002 2012-12-24 finally started issuing long-promised warnings Merry Christmas! 1.666001 2009-06-08 1.666000 2009-06-08 formally declare Return::Value deprecated 1.303 2007-04-01 fix test to work on 5.5 1.302 2006-11-14 perl-critic tests croak, not die, on invalid constructor input 1.301 2006-07-28 fix typoes in changelog and docs improve test coverage 1.30 2005-09-18 23:30 minor POD cleanup added pod coverage test (kwalitee suckup) 1.28 2004-12-20 16:00 changed bool return to just call ->bool (returning undef crashes 5.6.1, argh! thanks, HDP!) 1.26 2004-12-20 16:00 fixed: properties couldn't be undefined after defining "use warnings" removed from tests to keep 5.005 happy 1.24 2004-09-23 09:00 allow omission of message ...even with other attributes 100% coverage 1.22 2004-08-30 19:25 array and hash dereference will get the return data full test coverage 'type' attribute is key to success/failure POD improved 1.1 2004-07-15 Initial Revision. LICENSE100644000766000766 4364512227372447 14543 0ustar00rjbsrjbs000000000000Return-Value-1.666003This software is copyright (c) 2005 by Casey West. 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) 2005 by Casey West. 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) 2005 by Casey West. 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.ini100644000766000766 24512227372447 15127 0ustar00rjbsrjbs000000000000Return-Value-1.666003name = Return-Value author = Ricardo SIGNES author = Casey West license = Perl_5 copyright_holder = Casey West copyright_year = 2005 [@RJBS] META.yml100644000766000766 1314112227372447 14773 0ustar00rjbsrjbs000000000000Return-Value-1.666003--- abstract: '(deprecated) polymorphic return values' author: - 'Ricardo SIGNES ' - 'Casey West' build_requires: File::Spec: 0 IO::Handle: 0 IPC::Open3: 0 Test::More: 0.96 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132830' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Return-Value requires: Carp: 0 Exporter: 5.57 overload: 0 strict: 0 warnings: 0 resources: bugtracker: https://github.com/rjbs/Return-Value/issues homepage: https://github.com/rjbs/Return-Value repository: https://github.com/rjbs/Return-Value.git version: 1.666003 x_Dist_Zilla: perl: version: 5.019004 plugins: - class: Dist::Zilla::Plugin::Git::GatherDir name: '@RJBS/Git::GatherDir' version: 2.014 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: 0.009 - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: 0.011 - class: Dist::Zilla::Plugin::PromptIfStale name: '@RJBS/RJBS-Outdated' version: 0.008 - class: Dist::Zilla::Plugin::PromptIfStale name: '@RJBS/CPAN-Outdated' version: 0.008 - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: 4.300039 - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: 4.300039 - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: 4.300039 - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: 4.300039 - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: 4.300039 - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: 4.300039 - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: 4.300039 - class: Dist::Zilla::Plugin::MakeMaker name: '@RJBS/@Filter/MakeMaker' version: 4.300039 - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: 4.300039 - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: 4.300039 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: 4.300039 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: 4.300039 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: 4.300039 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RJBS/Git::NextVersion' version: 2.014 - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: 4.300039 - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: 4.300039 - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: 4.300039 - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: 4.300039 - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: 4.300039 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@RJBS/ReportVersions::Tiny' version: 1.10 - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: filename: t/00-compile.t module_finder: - ':InstallModules' script_finder: - ':ExecFiles' name: '@RJBS/Test::Compile' version: 2.036 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: 4.300039 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugin: '@RJBS' finder: - ':InstallModules' - ':ExecFiles' name: '@RJBS/PodWeaver' version: 3.102000 - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: 0.42 - class: Dist::Zilla::Plugin::Git::Check name: '@RJBS/@Git/Check' version: 2.014 - class: Dist::Zilla::Plugin::Git::Commit name: '@RJBS/@Git/Commit' version: 2.014 - class: Dist::Zilla::Plugin::Git::Tag name: '@RJBS/@Git/Tag' version: 2.014 - class: Dist::Zilla::Plugin::Git::Push name: '@RJBS/@Git/Push' version: 2.014 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300039 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300039 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300039 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300039 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300039 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300039 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300039 MANIFEST100644000766000766 36212227372447 14614 0ustar00rjbsrjbs000000000000Return-Value-1.666003Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Return/Value.pm t/00-compile.t t/000-report-versions-tiny.t t/failure.t t/objects.t t/overload.t t/success.t xt/release/changes_has_content.t xt/release/pod-syntax.t META.json100644000766000766 2142112227372447 15143 0ustar00rjbsrjbs000000000000Return-Value-1.666003{ "abstract" : "(deprecated) polymorphic return values", "author" : [ "Ricardo SIGNES ", "Casey West" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132830", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Return-Value", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Test::Pod" : "1.41", "version" : "0.9901" } }, "runtime" : { "requires" : { "Carp" : "0", "Exporter" : "5.57", "overload" : "0", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.96" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Return-Value/issues" }, "homepage" : "https://github.com/rjbs/Return-Value", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Return-Value.git", "web" : "https://github.com/rjbs/Return-Value" } }, "version" : "1.666003", "x_Dist_Zilla" : { "perl" : { "version" : "5.019004" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "name" : "@RJBS/Git::GatherDir", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "name" : "@RJBS/RJBS-Outdated", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "name" : "@RJBS/CPAN-Outdated", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RJBS/@Filter/MakeMaker", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RJBS/Git::NextVersion", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@RJBS/ReportVersions::Tiny", "version" : "1.10" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles" ] } }, "name" : "@RJBS/Test::Compile", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugin" : "@RJBS", "finder" : [ ":InstallModules", ":ExecFiles" ] } }, "name" : "@RJBS/PodWeaver", "version" : "3.102000" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.42" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RJBS/@Git/Check", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RJBS/@Git/Commit", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RJBS/@Git/Tag", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RJBS/@Git/Push", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300039" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300039" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300039" } } } t000755000766000766 012227372447 13605 5ustar00rjbsrjbs000000000000Return-Value-1.666003failure.t100644000766000766 435112227372447 15564 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse Test::More tests => 30; use strict; $^W = 1; my $class = 'Return::Value'; use Return::Value; { my $message = "I've got a bad feelin' about this."; my $value = failure $message; isa_ok($value, $class, "failure value"); ok(not($value), "failure value is false"); ok($value == 0, "failure value is 0"); ok($value eq $message, "failure value has a bad feelin'"); is($value->errno, 1, "failure value errno is default (1)"); } { my $message = "I've got a bad feelin' about this."; my $value = failure $message, errno => 501, data => { cause => 'sunspots' }; isa_ok($value, $class, "failure value"); ok(not($value), "failure value is false"); ok($value == 0, "failure value is 0"); ok($value eq $message, "failure value has a bad feelin'"); is($value->errno, 501, "failure value has 501 errno"); is(ref $value->data, 'HASH', "failure value includes hashref"); is($value->{cause}, 'sunspots', "failure value derefs correctly"); } { my $message = "I've got a bad feelin' about this."; my $value = failure $message, errno => 501, data => [ cause => 'sunspots' ]; isa_ok($value, $class, "failure value"); ok(not($value), "failure value is false"); ok($value == 0, "failure value is 0"); ok($value eq $message, "failure value has a bad feelin'"); is($value->errno, 501, "failure value has 501 errno"); is(ref $value->data, 'ARRAY', "failure value includes hashref"); is($value->[1], 'sunspots', "failure value derefs correctly"); } { my $value = failure errno => 501, data => [ cause => 'sunspots' ]; isa_ok($value, $class, "failure value"); ok(not($value), "failure value is false"); ok($value == 0, "failure value is 0"); ok($value eq 'failure', "failure value has default stringification"); is($value->errno, 501, "failure value has 501 errno"); is(ref $value->data, 'ARRAY', "failure value includes hashref"); is($value->[1], 'sunspots', "failure value derefs correctly"); } { my $value = failure; isa_ok($value, $class, "failure value"); ok(not($value), "failure value is true"); ok($value == 0, "failure value is 0"); ok($value eq 'failure', "failure has default stringification"); } objects.t100644000766000766 241412227372447 15564 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse Test::More tests => 23; use strict; $^W = 1; use Return::Value; my $ret = Return::Value->new; isa_ok $ret, 'Return::Value'; ok ! $ret->bool, 'false'; is $ret->errno, undef, 'errno 0'; is $ret->string, "", 'empty string'; ok ! $ret->data, 'no data'; is scalar(keys %{$ret->prop}), 0, 'no properties'; $ret = Return::Value->new( type => 'success', errno => 128, string => 'string', data => [ 'one' ], prop => { one => 1 }, ); isa_ok $ret, 'Return::Value'; ok $ret->bool, 'true'; is $ret->errno, 128, 'errno 128'; is $ret->errno(undef), undef, 'errno undef'; is $ret->errno, undef, 'errno still undef'; is $ret->string, 'string', 'string is string'; is ref($ret->data), 'ARRAY', 'data array ref'; is scalar(@{$ret->data}), 1, 'one element in data'; is ref($ret->prop), 'HASH', 'hash in prop'; is $ret->prop->{one}, 1, 'one prop set'; $ret->type('failure'); ok ! $ret->bool, 'now false'; is $ret->prop('one'), 1, 'object access for one'; is $ret->prop(two => 2), 2, 'prop create for two'; is $ret->errno(10), 10, 'set errno with method'; is $ret->type(), 'failure', 'type is currently failure'; is $ret->type("success"), 'success', 'set type with method'; eval { $ret->type("top secret"); }; like($@, qr/invalid result type/, "death on unknown type"); success.t100644000766000766 322512227372447 15604 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse Test::More tests => 23; use strict; $^W = 1; my $class = 'Return::Value'; use Return::Value; { my $message = "Feelin' fine."; my $value = success $message; isa_ok($value, $class, "success value"); ok($value, "success value is true"); ok($value == 1, "success value is 1"); ok($value eq $message, "success value is feelin' fine"); is($value->errno, undef, "success value errno is default (undef)"); } { my $message = "Feelin' fine."; my $value = success $message, errno => 200, data => { cause => 'sunshine' }; isa_ok($value, $class, "success value"); ok($value, "success value is true"); ok($value == 1, "success value is 1"); ok($value eq $message, "success value has a bad feelin'"); is($value->errno, 200, "success value has 501 errno"); is(ref $value->data, 'HASH', "success value includes hashref"); is(${$value}->{cause}, 'sunshine', "success value derefs correctly"); } { my $value = success errno => 200, data => { cause => 'sunshine' }; isa_ok($value, $class, "success value"); ok($value, "success value is true"); ok($value == 1, "success value is 1"); ok($value eq 'success', "success value has a bad feelin'"); is($value->errno, 200, "success value has 501 errno"); is(ref $value->data, 'HASH', "success value includes hashref"); is(${$value}->{cause}, 'sunshine', "success value derefs correctly"); } { my $value = success; isa_ok($value, $class, "success value"); ok($value, "success value is true"); ok($value == 1, "success value is 1"); ok($value eq 'success', "success has default stringification"); } Makefile.PL100644000766000766 302612227372447 15455 0ustar00rjbsrjbs000000000000Return-Value-1.666003 use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "(deprecated) polymorphic return values", "AUTHOR" => "Ricardo SIGNES , Casey West", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Return-Value", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Return::Value", "PREREQ_PM" => { "Carp" => 0, "Exporter" => "5.57", "overload" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.96" }, "VERSION" => "1.666003", "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); overload.t100644000766000766 246312227372447 15752 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse Test::More tests => 21; use strict; $^W = 1; use Return::Value; my $success = success; ok $success, 'good'; my $failure = failure; ok ! $failure, 'bad'; is ''.success("Good"), "Good", 'stringified good is good'; ok(success("Good") eq 'Good', 'overloaded "eq"'); ok(success("Good") ne 'Gqqd', 'overloaded "ne"'); ok(success("Good") lt 'Hood', 'overloaded "lt"'); ok(success("Good") gt 'Food', 'overloaded "gt"'); ok failure() < 1 && failure() > -1 && failure() == 0, 'failure is zero'; my $fail = failure; $fail++; ok $fail, 'failure to success (success is true)'; $fail--; ok ! $fail, 'success to failure (failure is false)'; cmp_ok($fail, '==', 0, "failure is == 0"); cmp_ok($fail, '!=', 1, "failure is != 1"); my $error = failure "stringy error message"; cmp_ok($error, 'eq', "stringy error message"); cmp_ok($error, 'ne', "some random string"); cmp_ok($error, 'gt', "aaa"); cmp_ok($error, 'lt', "zzz"); is($$error, undef, "no built-in data"); my $error_array = failure "I died!", data => [qw(array ref)]; my $error_hash = failure "I died!", data => { hash => 'ref' }; ok(@$error_array, "can deref array data as array"); ok(%$error_hash, "can deref hash data as hash"); is_deeply({%$error_array}, {}, "can't deref array data as array"); is_deeply([@$error_hash ], [], "can't deref hash data as hash"); 00-compile.t100644000766000766 165212227372447 16003 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.036 use Test::More 0.94 tests => 1; my @module_files = ( 'Return/Value.pm' ); # no fake home requested my $inc_switch = q[-Mblib]; use File::Spec; use IPC::Open3; use IO::Handle; my @warnings; for my $lib (@module_files) { # see L open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } # no warning checks; BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; Return000755000766000766 012227372447 15367 5ustar00rjbsrjbs000000000000Return-Value-1.666003/libValue.pm100644000766000766 2237012227372447 17165 0ustar00rjbsrjbs000000000000Return-Value-1.666003/lib/Returnuse strict; use warnings; package Return::Value; { $Return::Value::VERSION = '1.666003'; } # vi:et:sw=4 ts=4 use Exporter 5.57 'import'; use Carp (); our @EXPORT = qw[success failure]; # This hack probably impacts performance more than I'd like to know, but it's # needed to have a hashref object that can deref into a different hash. # _ah($self,$key, [$value) sets or returns the value for the given key on the # $self blessed-ref sub _ah { my ($self, $key, $value) = @_; my $class = ref $self; bless $self => "ain't::overloaded"; $self->{$key} = $value if @_ > 2; my $return = $self->{$key}; bless $self => $class; return $return; } sub _builder { my %args = (type => shift); $args{string} = shift if (@_ % 2); %args = (%args, @_); $args{string} = $args{type} unless defined $args{string}; $args{errno} = ($args{type} eq 'success' ? undef : 1) unless defined $args{errno}; __PACKAGE__->new(%args); } sub success { _builder('success', @_) } sub failure { _builder('failure', @_) } sub new { my $class = shift; bless { type => 'failure', string => q{}, prop => {}, @_ } => $class; } sub bool { _ah($_[0],'type') eq 'success' ? 1 : 0 } sub type { my ($self, $value) = @_; return _ah($self, 'type') unless @_ > 1; Carp::croak "invalid result type: $value" unless $value eq 'success' or $value eq 'failure'; return _ah($self, 'type', $value); }; foreach my $name ( qw[errno string data] ) { ## no critic (ProhibitNoStrict) no strict 'refs'; *{$name} = sub { my ($self, $value) = @_; return _ah($self, $name) unless @_ > 1; return _ah($self, $name, $value); }; } sub prop { my ($self, $name, $value) = @_; return _ah($self, 'prop') unless $name; return _ah($self, 'prop')->{$name} unless @_ > 2; return _ah($self, 'prop')->{$name} = $value; } use overload '""' => sub { shift->string }, 'bool' => sub { shift->bool }, '==' => sub { shift->bool == shift }, '!=' => sub { shift->bool != shift }, '>' => sub { shift->bool > shift }, '<' => sub { shift->bool < shift }, 'eq' => sub { shift->string eq shift }, 'ne' => sub { shift->string ne shift }, 'gt' => sub { shift->string gt shift }, 'lt' => sub { shift->string lt shift }, '++' => sub { _ah(shift,'type','success') }, '--' => sub { _ah(shift,'type','failure') }, '${}' => sub { my $data = _ah($_[0],'data'); $data ? \$data : \undef }, '%{}' => sub { ref _ah($_[0],'data') eq 'HASH' ? _ah($_[0],'data') : {} }, '@{}' => sub { ref _ah($_[0],'data') eq 'ARRAY' ? _ah($_[0],'data') : [] }, fallback => 1; "This return value is true."; __END__ =pod =head1 NAME Return::Value =head1 VERSION version 1.666003 =head1 SYNOPSIS Used with basic function-call interface: use Return::Value; sub send_over_network { my ($net, $send) = @_: if ( $net->transport( $send ) ) { return success; } else { return failure "Was not able to transport info."; } } my $result = $net->send_over_network( "Data" ); # boolean unless ( $result ) { # string print $result; } Or, build your Return::Value as an object: sub build_up_return { my $return = failure; if ( ! foo() ) { $return->string("Can't foo!"); return $return; } if ( ! bar() ) { $return->string("Can't bar"); $return->prop(failures => \@bars); return $return; } # we're okay if we made it this far. $return++; return $return; # success! } =head1 DESCRIPTION Polymorphic return values are a horrible idea, but this library was written based on the notion that they were useful. Often, we just want to know if something worked or not. Other times, we'd like to know what the error text was. Still others, we may want to know what the error code was, and what the error properties were. We don't want to handle objects or data structures for every single return value, but we do want to check error conditions in our code because that's what good programmers do. When functions are successful they may return true, or perhaps some useful data. In the quest to provide consistent return values, this gets confusing between complex, informational errors and successful return values. This module provides these features with a simplistic API that should get you what you're looking for in each context a return value is used in. =head2 Attributes All return values have a set of attributes that package up the information returned. All attributes can be accessed or changed via methods of the same name, unless otherwise noted. Many can also be accessed via overloaded operations on the object, as noted below. =over 4 =item type A value's type is either "success" or "failure" and (obviously) reflects whether the value is returning success or failure. =item errno The errno attribute stores the error number of the return value. For success-type results, it is by default undefined. For other results, it defaults to 1. =item string The value's string attribute is a simple message describing the value. =item data The data attribute stores a reference to a hash or array, and can be used as a simple way to return extra data. Data stored in the data attribute can be accessed by dereferencing the return value itself. (See below.) =item prop The most generic attribute of all, prop is a hashref that can be used to pass an arbitrary number of data structures, just like the data attribute. Unlike the data attribute, though, these structures must be retrieved via method calls. =back =head1 NAME Return::Value - (deprecated) polymorphic return values =head1 DO NOT USE THIS LIBRARY Return::Value was a bad idea. I'm sorry that I had it, sorry that I followed through, and sorry that it got used in other useful libraries. Fortunately there are not many things using it. One of those things is L which is also deprecated in favor of L. There's no reason to specify a new module to replace Return::Value. In general, routines should return values of uniform type or throw exceptions. Return::Value tried to be a uniform type for all routines, but has so much weird behavior that it ends up being confusing and not very Perl-like. Objects that are false are just a dreadful idea in almost every circumstance, especially when the object has useful properties. B A release of this library in June 2009 promised that deprecation warnings would start being issued in June 2010. It is now December 2012, and the warnings are now being issued. They can be disabled through means made clear from the source. =head1 FUNCTIONS The functional interface is highly recommended for use within functions that are using C for return values. It's simple and straightforward, and builds the entire return value in one statement. =over 4 =item success The C function returns a C with the type "success". Additional named parameters may be passed to set the returned object's attributes. The first, optional, parameter is the string attribute and does not need to be named. All other parameters must be passed by name. # simplest possible case return success; =item failure C is identical to C, but returns an object with the type "failure" =back =head1 METHODS The object API is useful in code that is catching C objects. =over 4 =item new my $return = Return::Value->new( type => 'failure', string => "YOU FAIL", prop => { failed_objects => \@objects, }, ); Creates a new C object. Named parameters can be used to set the object's attributes. =item bool print "it worked" if $result->bool; Returns the result in boolean context: true for success, false for failure. =item prop printf "%s: %s', $result->string, join ' ', @{$result->prop('strings')} unless $result->bool; Returns the return value's properties. Accepts the name of a property returned, or returns the properties hash reference if given no name. =item other attribute accessors Simple accessors exist for the object's other attributes: C, C, C, and C. =back =head2 Overloading Several operators are overloaded for C objects. They are listed here. =over 4 =item Stringification print "$result\n"; Stringifies to the string attribute. =item Boolean print $result unless $result; Returns the C representation. =item Numeric Also returns the C value. =item Dereference Dereferencing the value as a hash or array will return the value of the data attribute, if it matches that type, or an empty reference otherwise. You can check C<< ref $result->data >> to determine what kind of data (if any) was passed. =back =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2005 by Casey West. 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 release000755000766000766 012227372447 15415 5ustar00rjbsrjbs000000000000Return-Value-1.666003/xtpod-syntax.t100644000766000766 21212227372447 20023 0ustar00rjbsrjbs000000000000Return-Value-1.666003/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(); 000-report-versions-tiny.t100644000766000766 445712227372447 20603 0ustar00rjbsrjbs000000000000Return-Value-1.666003/tuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = "any version"; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Carp','any version') }; eval { $v .= pmver('Exporter','5.57') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('IO::Handle','any version') }; eval { $v .= pmver('IPC::Open3','any version') }; eval { $v .= pmver('Test::More','0.96') }; eval { $v .= pmver('overload','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; changes_has_content.t100644000766000766 201412227372447 21734 0ustar00rjbsrjbs000000000000Return-Value-1.666003/xt/release#!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '1.666003'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; }