Try-Tiny-0.24/000700 000766 000024 00000000000 12632456415 013407 5ustar00etherstaff000000 000000 Try-Tiny-0.24/Changes000600 000766 000024 00000005505 12632456415 014711 0ustar00etherstaff000000 000000 Revision history for Try-Tiny 0.24 2015-12-11 05:20:09Z - fix prereq errors in 0.23 0.23 2015-12-11 04:04:35Z - fix syntax of example code (Rudolf Leermakers, PR#22) - 'perl' removed from prerequisite recommendations, to avoid tripping up CPAN clients (Graham Knop) - Sub::Util is used preferentially to Sub::Name in most cases (Graham Knop, PR#27) 0.22 2014-04-29 - add optional test deps as recommended prereqs (Karen Etheridge, #18) 0.21 2014-04-15 - also skip the test if Capture::Tiny is too old (Martin Popel, #17) 0.20 2014-03-21 - documentation updates (Flimm, #15) 0.19 2014-01-22 - fix an obscure issue with loading modules during global destruction (ilmari, #11) - documentation updates (anaxagoras, #12) 0.18 2013-08-17 - fix tests for pre-Test-More-0.88 (Paul Howarth, #10) 0.17 2013-08-16 - work around [rt.perl #119311] which was causing incorrect error messages in some cases during global destruction (Graham Knop, #9) 0.16 2013-07-10 - remove accidental Sub::Name test dep 0.15 2013-07-08 - optionally use Sub::Name to name the try/catch/finally blocks, if available (Mark Fowler) 0.14 2013-07-05 - also throw an exception for catch/finally in scalar context (RT#81070) 0.13 2013-07-04 - fix tests failing on 5.6.x due to differing DESTROY semantics - excise superfluous local($@) call - 7% speedup - fix (fsvo) broken URLs (RT#55659) - proper exception on erroneous usage of bare catch/finally (RT#81070) - proper exception on erroneous use of multiple catch{} blocks - clarify exception occuring on unterminated try block (RT#75712) - fix the prototypes shown in docs to match code (RT#79590; thanks, Pushtaev Vadim) - warn loudly on exceptions in finally() blocks - dzilify 0.12 2013-01-02 - doc fixes 0.11 2011-08-30 - fix broken dist 0.10 2011-04-27 - clarify some docs 0.09 2010-11-28 - don't index Try::Tiny::ScopeGuard 0.08 2010-11-28 - fix require vs use issue in blead (RT63410) 0.07 2010-10-21 - allow multiple finally blocks - pass the error, if any, to finally blocks when called 0.06 2010-05-27 - in t/given_when.t use a plan instead of done_testing for more backwards compatibility 0.05 2010-05-26 - Documentation fixes and clarifications 0.04 2010-01-22 - Restore list context propagation for catch blocks - Fix a bug where finally blocks weren't always invoked 0.03 2010-01-22 - Support for 'finally' blocks (Andy Yates) - More documentation and tests (many people) - Sets $@ to the previous value at the beginning of the eval, to allow the capture of an error stack when calling die. 0.02 2009-09-02 - Doc fixes from chromatic - Various minor fixes from Adam Kennedy - Additional documentation and code clarifications - 5.005_04 compatibility 0.01 2009-08-31 - Initial release Try-Tiny-0.24/CONTRIBUTING000644 000766 000024 00000007027 12632456415 015261 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficent for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/Try-Tiny If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends Try::Tiny Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm You should then also install any additional requirements not needed by the dzil build but may be needed by tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends Try::Tiny Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is hosted at GitHub. The repository is: https://github.com/karenetheridge/Try-Tiny You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://rt.cpan.org/Public/Dist/Display.html?Name=Try-Tiny or via email: bug-Try-Tiny@rt.cpan.org This is a good place to send your questions about the usage of this distribution. If you send me a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.009 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.109. Try-Tiny-0.24/dist.ini000600 000766 000024 00000001505 12632456415 015056 0ustar00etherstaff000000 000000 name = Try-Tiny author = יובל קוג'מן (Yuval Kogman) author = Jesse Luehrs license = MIT copyright_holder = יובל קוג'מן (Yuval Kogman) copyright_year = 2009 [@Author::ETHER] installer = MakeMaker Authority.authority = cpan:NUFFIN ; tests optionally require 5.010 AutoPrereqs.skip[0] = ^perl$ ; tests for optional Sub::Name stuff AutoPrereqs.skip[1] = ^Sub::Name$ AutoPrereqs.skip[2] = ^Sub::Util$ ; tests optionally require Capture::Tiny AutoPrereqs.skip[3] = ^Capture::Tiny$ -remove = Test::MinimumVersion ; t/given_when.t implies needing 5.010 -remove = Test::CleanNamespaces [RemovePrereqs] remove = perl ; 5.010 prereq found in t/*when.t [Prereqs] perl = 5.006 [Prereqs / TestRecommends] Capture::Tiny = 0.12 ; capture_stderr [Prereqs / TestSuggests] Sub::Util = 0 Try-Tiny-0.24/INSTALL000644 000766 000024 00000001635 12632456415 014457 0ustar00etherstaff000000 000000 This is the Perl distribution Try-Tiny. Installing Try-Tiny is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Try::Tiny If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Try::Tiny ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Try::Tiny ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation Try-Tiny documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Try::Tiny Try-Tiny-0.24/lib/000700 000766 000024 00000000000 12632456415 014155 5ustar00etherstaff000000 000000 Try-Tiny-0.24/LICENCE000644 000766 000024 00000002236 12632456415 014411 0ustar00etherstaff000000 000000 This software is Copyright (c) 2009 by יובל קוג'מן (Yuval Kogman). This is free software, licensed under: The MIT (X11) License The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Try-Tiny-0.24/maint/000700 000766 000024 00000000000 12632456415 014517 5ustar00etherstaff000000 000000 Try-Tiny-0.24/Makefile.PL000644 000766 000024 00000002633 12632456415 015377 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.042. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "minimal try/catch with proper preservation of \$\@", "AUTHOR" => "\x{5d9}\x{5d5}\x{5d1}\x{5dc} \x{5e7}\x{5d5}\x{5d2}'\x{5de}\x{5df} (Yuval Kogman) , Jesse Luehrs ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Try-Tiny", "LICENSE" => "mit", "MIN_PERL_VERSION" => "5.006", "NAME" => "Try::Tiny", "PREREQ_PM" => { "Carp" => 0, "Exporter" => "5.57", "constant" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => 0, "if" => 0 }, "VERSION" => "0.24", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Exporter" => "5.57", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => 0, "constant" => 0, "if" => 0, "strict" => 0, "warnings" => 0 ); 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); Try-Tiny-0.24/MANIFEST000644 000766 000024 00000001312 12632456415 014547 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.042. CONTRIBUTING Changes INSTALL LICENCE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Try/Tiny.pm maint/bench.pl t/00-report-prereqs.dd t/00-report-prereqs.t t/basic.t t/context.t t/erroneous_usage.t t/finally.t t/given_when.t t/global_destruction_forked.t t/global_destruction_load.t t/lib/TryUser.pm t/named.t t/when.t xt/author/00-compile.t xt/author/eol.t xt/author/kwalitee.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/release/changes_has_content.t xt/release/cpan-changes.t xt/release/distmeta.t xt/release/pod-no404s.t xt/release/portability.t Try-Tiny-0.24/META.json000644 000766 000024 00000121704 12632456415 015047 0ustar00etherstaff000000 000000 { "abstract" : "minimal try/catch with proper preservation of $@", "author" : [ "יובל קוג'מן (Yuval Kogman) ", "Jesse Luehrs " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.042, CPAN::Meta::Converter version 2.150005", "license" : [ "mit" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Try-Tiny", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.109" }, "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AuthorityFromModule" : "0.002", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", "Dist::Zilla::Plugin::Git::Commit" : "2.020", "Dist::Zilla::Plugin::Git::Contributors" : "0.004", "Dist::Zilla::Plugin::Git::Describe" : "0.004", "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Remote::Check" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0.40", "Dist::Zilla::Plugin::GithubMeta" : "0.54", "Dist::Zilla::Plugin::InstallGuide" : "1.200005", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker" : "0", "Dist::Zilla::Plugin::Manifest" : "0", "Dist::Zilla::Plugin::MetaConfig" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::MetaNoIndex" : "0", "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", "Dist::Zilla::Plugin::MetaTests" : "0", "Dist::Zilla::Plugin::MetaYAML" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "1.006", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::PodWeaver" : "4.005", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RemovePrereqs" : "0", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.004", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.038", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.008", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::EOL" : "0.17", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.002", "Dist::Zilla::Plugin::Test::PodSpelling" : "2.006003", "Dist::Zilla::Plugin::Test::Portability" : "0", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.019", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Software::License::MIT" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::No404s" : "0", "Test::Spelling" : "0.12", "blib" : "1.01" } }, "runtime" : { "requires" : { "Carp" : "0", "Exporter" : "5.57", "constant" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900", "Capture::Tiny" : "0.12" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0", "if" : "0" }, "suggests" : { "Sub::Util" : "0" } } }, "provides" : { "Try::Tiny" : { "file" : "lib/Try/Tiny.pm", "version" : "0.24" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-Try-Tiny@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Try-Tiny" }, "homepage" : "https://github.com/karenetheridge/Try-Tiny", "repository" : { "type" : "git", "url" : "https://github.com/karenetheridge/Try-Tiny.git", "web" : "https://github.com/karenetheridge/Try-Tiny" } }, "version" : "0.24", "x_Dist_Zilla" : { "perl" : { "version" : "5.023005" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/bundle_plugins", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/RewriteVersion::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.047" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.047" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "README.pod" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.005" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@Author::ETHER/InstallGuide", "version" : "1.200006" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : "1", "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles", "@Author::ETHER/Examples" ], "skips" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.054" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", ":ExtraTestFiles" ] } }, "name" : "@Author::ETHER/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", ":ExtraTestFiles" ], "trailing_whitespace" : "1" } }, "name" : "@Author::ETHER/Test::EOL", "version" : "0.18" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [], "spell_cmd" : "", "stopwords" : [ "irc" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.007000" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.002" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/author/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.021" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "name" : "@Author::ETHER/Test::Portability", "version" : "2.000006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@Author::ETHER" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::ETHER/SingleEncoding", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/List", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/Verbatim", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/header", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::ETHER/Name", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::ETHER/Version", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/prelude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::ETHER/Leftovers", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/postlude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@Author::ETHER/generate SUPPORT", "version" : "1.01" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override SUPPORT", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::ETHER/Authors", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::ETHER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::ETHER/Legal", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/footer", "version" : "4.012" } ] } }, "name" : "@Author::ETHER/PodWeaver", "version" : "4.006" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::AuthorityFromModule", "config" : { "Dist::Zilla::Plugin::AuthorityFromModule" : { "module" : "Try::Tiny" }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000031", "version" : "0.003" } }, "name" : "@Author::ETHER/AuthorityFromModule", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.042" } ] }, "Dist::Zilla::Role::MetaProvider::Provider" : { "Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.001010", "inherit_missing" : "0", "inherit_version" : "0", "meta_noindex" : "1" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.003001" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [ "." ] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle_version", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/MakeMaker", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 1, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000031", "version" : "0.003" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ] } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" ], "fatal_errors" : 1, "quiet" : 1 } }, "name" : "@Author::ETHER/.latest", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.2.0" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.017" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.150250" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "." ], "commit_msg" : "%N-%v%t%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENCE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/release snapshot", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.24", "tag_format" : "v%v", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/Git::Tag", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.41" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/BumpVersionAfterRelease::Transitional", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/NextRelease", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/post-release commit", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ] } }, "name" : "@Author::ETHER/install release", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1 } }, "name" : "@Author::ETHER/release complete", "version" : "0.042" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::RemovePrereqs", "config" : { "Dist::Zilla::Plugin::RemovePrereqs" : { "modules_to_remove" : [ "perl" ] } }, "name" : "RemovePrereqs", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "recommends" } }, "name" : "TestRecommends", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "suggests" } }, "name" : "TestSuggests", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.042" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.013" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.042" } }, "x_authority" : "cpan:NUFFIN", "x_authority_from_module" : "Try::Tiny", "x_contributors" : [ "Karen Etheridge ", "Peter Rabbitson ", "Ricardo Signes ", "Mark Fowler ", "Graham Knop ", "Dagfinn Ilmari Mannsåker ", "Paul Howarth ", "Rudolf Leermakers ", "anaxagoras ", "awalker ", "chromatic ", "Alex ", "cm-perl ", "Andrew Yates ", "David Lowe ", "Glenn Fowler ", "Hans Dieter Pearcey ", "Jonathan Yu ", "Marc Mims ", "Mark Stosberg " ], "x_permissions_from_module" : "Try::Tiny" } Try-Tiny-0.24/META.yml000644 000766 000024 00000057444 12632456415 014710 0ustar00etherstaff000000 000000 --- abstract: 'minimal try/catch with proper preservation of $@' author: - "יובל קוג'מן (Yuval Kogman) " - 'Jesse Luehrs ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0' if: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.042, CPAN::Meta::Converter version 2.150005' license: mit meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Try-Tiny no_index: directory: - t - xt provides: Try::Tiny: file: lib/Try/Tiny.pm version: '0.24' requires: Carp: '0' Exporter: '5.57' constant: '0' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Try-Tiny homepage: https://github.com/karenetheridge/Try-Tiny repository: https://github.com/karenetheridge/Try-Tiny.git version: '0.24' x_Dist_Zilla: perl: version: '5.023005' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/bundle_plugins' version: '5.042' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/RewriteVersion::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build skip: [] name: '@Author::ETHER/stale modules, build' version: '0.047' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release skip: [] name: '@Author::ETHER/stale modules, release' version: '0.047' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '5.042' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - INSTALL - LICENCE - README.pod exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::ETHER/Git::GatherDir' version: '2.036' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '5.042' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '5.042' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '5.042' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '5.042' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '5.042' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.005' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.009' - class: Dist::Zilla::Plugin::InstallGuide name: '@Author::ETHER/InstallGuide' version: '1.200006' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '1' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' - '@Author::ETHER/Examples' skips: [] name: '@Author::ETHER/Test::Compile' version: '2.054' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - ':ExtraTestFiles' name: '@Author::ETHER/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - ':ExtraTestFiles' trailing_whitespace: '1' name: '@Author::ETHER/Test::EOL' version: '0.18' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '5.042' - class: Dist::Zilla::Plugin::Test::CPAN::Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.009' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.008' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '5.042' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: '5.042' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: [] spell_cmd: '' stopwords: - irc wordlist: Pod::Wordlist name: '@Author::ETHER/Test::PodSpelling' version: '2.007000' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.002' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/author/kwalitee.t skiptest: [] name: '@Author::ETHER/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: '0.021' - class: Dist::Zilla::Plugin::Test::Portability name: '@Author::ETHER/Test::Portability' version: '2.000006' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: '0.006' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@Author::ETHER' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.012' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.012' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::ETHER/SingleEncoding' version: '4.012' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/List' version: '4.012' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/Verbatim' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/header' version: '4.012' - class: Pod::Weaver::Section::Name name: '@Author::ETHER/Name' version: '4.012' - class: Pod::Weaver::Section::Version name: '@Author::ETHER/Version' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/prelude' version: '4.012' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.012' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.012' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.012' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.012' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.012' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.012' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.012' - class: Pod::Weaver::Section::Leftovers name: '@Author::ETHER/Leftovers' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/postlude' version: '4.012' - class: Pod::Weaver::Section::GenerateSection name: '@Author::ETHER/generate SUPPORT' version: '1.01' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override SUPPORT' version: '0.05' - class: Pod::Weaver::Section::Authors name: '@Author::ETHER/Authors' version: '4.012' - class: Pod::Weaver::Section::Contributors name: '@Author::ETHER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::ETHER/Legal' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/footer' version: '4.012' name: '@Author::ETHER/PodWeaver' version: '4.006' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.54' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::AuthorityFromModule config: Dist::Zilla::Plugin::AuthorityFromModule: module: Try::Tiny Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000031' version: '0.003' name: '@Author::ETHER/AuthorityFromModule' version: '0.006' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '5.042' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.042' Dist::Zilla::Role::MetaProvider::Provider: Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.001010' inherit_missing: '0' inherit_version: '0' meta_noindex: '1' name: '@Author::ETHER/MetaProvides::Package' version: '2.003001' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '5.042' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: [] name: '@Author::ETHER/Keywords' version: '0.006' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: include_authors: 0 include_releaser: 1 order_by: commits paths: - . name: '@Author::ETHER/Git::Contributors' version: '0.015' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '5.042' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.005' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle_version' version: '5.042' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/MakeMaker' version: '5.042' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 1 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.008' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.028' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000031' version: '0.003' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" name: '@Author::ETHER/.ackrc' version: '0.042' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" fatal_errors: 1 quiet: 1 name: '@Author::ETHER/.latest' version: '0.042' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/initial check' version: '2.036' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.013' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.013' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.2.0 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.017' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '5.042' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/after tests' version: '2.036' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.009' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '5.042' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - Changes - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.150250' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - . commit_msg: '%N-%v%t%n%n%c' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING - Changes - INSTALL - LICENCE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/release snapshot' version: '2.036' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.24 tag_format: v%v tag_message: v%v%t Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/Git::Tag' version: '2.036' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.41' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/BumpVersionAfterRelease::Transitional' version: '0.007' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/NextRelease' version: '5.042' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/post-release commit' version: '2.036' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: repo_root: . name: '@Author::ETHER/Git::Push' version: '2.036' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED name: '@Author::ETHER/install release' version: '0.042' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 name: '@Author::ETHER/release complete' version: '0.042' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '5.042' - class: Dist::Zilla::Plugin::RemovePrereqs config: Dist::Zilla::Plugin::RemovePrereqs: modules_to_remove: - perl name: RemovePrereqs version: '5.042' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '5.042' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: recommends name: TestRecommends version: '5.042' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: suggests name: TestSuggests version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '5.042' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '5.042' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.013' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '5.042' x_authority: cpan:NUFFIN x_authority_from_module: Try::Tiny x_contributors: - 'Karen Etheridge ' - 'Peter Rabbitson ' - 'Ricardo Signes ' - 'Mark Fowler ' - 'Graham Knop ' - 'Dagfinn Ilmari Mannsåker ' - 'Paul Howarth ' - 'Rudolf Leermakers ' - 'anaxagoras ' - 'awalker ' - 'chromatic ' - 'Alex ' - 'cm-perl ' - 'Andrew Yates ' - 'David Lowe ' - 'Glenn Fowler ' - 'Hans Dieter Pearcey ' - 'Jonathan Yu ' - 'Marc Mims ' - 'Mark Stosberg ' x_permissions_from_module: Try::Tiny Try-Tiny-0.24/README000644 000766 000024 00000000514 12632456415 014301 0ustar00etherstaff000000 000000 This archive contains the distribution Try-Tiny, version 0.24: minimal try/catch with proper preservation of $@ This software is Copyright (c) 2009 by יובל קוג'מן (Yuval Kogman). This is free software, licensed under: The MIT (X11) License This README file was generated by Dist::Zilla::Plugin::Readme v5.042. Try-Tiny-0.24/t/000700 000766 000024 00000000000 12632456415 013652 5ustar00etherstaff000000 000000 Try-Tiny-0.24/xt/000700 000766 000024 00000000000 12632456415 014042 5ustar00etherstaff000000 000000 Try-Tiny-0.24/xt/author/000700 000766 000024 00000000000 12632456415 015344 5ustar00etherstaff000000 000000 Try-Tiny-0.24/xt/release/000700 000766 000024 00000000000 12632456415 015462 5ustar00etherstaff000000 000000 Try-Tiny-0.24/xt/release/changes_has_content.t000644 000766 000024 00000002010 12632456415 021647 0ustar00etherstaff000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.24'; 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; } Try-Tiny-0.24/xt/release/cpan-changes.t000644 000766 000024 00000000263 12632456415 020211 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); Try-Tiny-0.24/xt/release/distmeta.t000644 000766 000024 00000000172 12632456415 017473 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Try-Tiny-0.24/xt/release/pod-no404s.t000644 000766 000024 00000000527 12632456415 017474 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_NO404S AUTOMATED_TESTING ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::No404s"; if ( $@ ) { plan skip_all => 'Test::Pod::No404s required for testing POD'; } else { all_pod_files_ok(); } Try-Tiny-0.24/xt/release/portability.t000644 000766 000024 00000000277 12632456415 020231 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); Try-Tiny-0.24/xt/author/00-compile.t000644 000766 000024 00000002235 12632456415 017412 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More 0.94; plan tests => 2; my @module_files = ( 'Try/Tiny.pm' ); # no fake home requested my $inc_switch = -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; 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"); 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: ', explain(\@warnings); BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; Try-Tiny-0.24/xt/author/eol.t000644 000766 000024 00000001644 12632456415 016327 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Try/Tiny.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/basic.t', 't/context.t', 't/erroneous_usage.t', 't/finally.t', 't/given_when.t', 't/global_destruction_forked.t', 't/global_destruction_load.t', 't/lib/TryUser.pm', 't/named.t', 't/when.t', 'xt/author/00-compile.t', 'xt/author/eol.t', 'xt/author/kwalitee.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/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/pod-no404s.t', 'xt/release/portability.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Try-Tiny-0.24/xt/author/kwalitee.t000644 000766 000024 00000000275 12632456415 017354 0ustar00etherstaff000000 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; Try-Tiny-0.24/xt/author/mojibake.t000644 000766 000024 00000000151 12632456415 017321 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); Try-Tiny-0.24/xt/author/no-tabs.t000644 000766 000024 00000001612 12632456415 017106 0ustar00etherstaff000000 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/Try/Tiny.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/basic.t', 't/context.t', 't/erroneous_usage.t', 't/finally.t', 't/given_when.t', 't/global_destruction_forked.t', 't/global_destruction_load.t', 't/lib/TryUser.pm', 't/named.t', 't/when.t', 'xt/author/00-compile.t', 'xt/author/eol.t', 'xt/author/kwalitee.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/release/changes_has_content.t', 'xt/release/cpan-changes.t', 'xt/release/distmeta.t', 'xt/release/pod-no404s.t', 'xt/release/portability.t' ); notabs_ok($_) foreach @files; done_testing; Try-Tiny-0.24/xt/author/pod-coverage.t000644 000766 000024 00000000334 12632456415 020116 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Try-Tiny-0.24/xt/author/pod-spell.t000644 000766 000024 00000001215 12632456415 017441 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ irc יובל קוג Yuval Kogman nothingmuch Jesse Luehrs doy Karen Etheridge ether Peter Rabbitson ribasushi Ricardo Signes rjbs Mark Fowler mark Graham Knop haarg Dagfinn Ilmari Mannsåker ilmari Paul Howarth paul Rudolf Leermakers rudolf anaxagoras walkeraj awalker chromatic Alex alex cm Andrew Yates ayates David Lowe davidl Glenn cebjyre Hans Dieter Pearcey hdp Jonathan Yu JAWNSY Marc Mims marc Stosberg lib Try Tiny Try-Tiny-0.24/xt/author/pod-syntax.t000644 000766 000024 00000000252 12632456415 017650 0ustar00etherstaff000000 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(); Try-Tiny-0.24/t/00-report-prereqs.dd000644 000766 000024 00000020610 12632456415 017403 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.109' }, 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '1.009', 'Dist::Zilla::Plugin::AuthorityFromModule' => '0.002', 'Dist::Zilla::Plugin::AutoMetaResources' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '5.038', 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', 'Dist::Zilla::Plugin::CheckIssues' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0', 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', 'Dist::Zilla::Plugin::GenerateFile::FromShareDir' => '0', 'Dist::Zilla::Plugin::Git::Check' => '0', 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0.004', 'Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts' => '0', 'Dist::Zilla::Plugin::Git::Commit' => '2.020', 'Dist::Zilla::Plugin::Git::Contributors' => '0.004', 'Dist::Zilla::Plugin::Git::Describe' => '0.004', 'Dist::Zilla::Plugin::Git::GatherDir' => '2.016', 'Dist::Zilla::Plugin::Git::Push' => '0', 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', 'Dist::Zilla::Plugin::Git::Tag' => '0', 'Dist::Zilla::Plugin::GitHub::Update' => '0.40', 'Dist::Zilla::Plugin::GithubMeta' => '0.54', 'Dist::Zilla::Plugin::InstallGuide' => '1.200005', 'Dist::Zilla::Plugin::Keywords' => '0.004', 'Dist::Zilla::Plugin::License' => '5.038', 'Dist::Zilla::Plugin::MakeMaker' => '0', 'Dist::Zilla::Plugin::Manifest' => '0', 'Dist::Zilla::Plugin::MetaConfig' => '0', 'Dist::Zilla::Plugin::MetaJSON' => '0', 'Dist::Zilla::Plugin::MetaNoIndex' => '0', 'Dist::Zilla::Plugin::MetaProvides::Package' => '1.15000002', 'Dist::Zilla::Plugin::MetaTests' => '0', 'Dist::Zilla::Plugin::MetaYAML' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '1.006', 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', 'Dist::Zilla::Plugin::NextRelease' => '5.033', 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', 'Dist::Zilla::Plugin::PodWeaver' => '4.005', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::Readme' => '0', 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', 'Dist::Zilla::Plugin::RemovePrereqs' => '0', 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.004', 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.038', 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', 'Dist::Zilla::Plugin::StaticInstall' => '0.005', 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.008', 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', 'Dist::Zilla::Plugin::Test::Compile' => '2.039', 'Dist::Zilla::Plugin::Test::EOL' => '0.17', 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.10', 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.002', 'Dist::Zilla::Plugin::Test::PodSpelling' => '2.006003', 'Dist::Zilla::Plugin::Test::Portability' => '0', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.019', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Software::License::MIT' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::No404s' => '0', 'Test::Spelling' => '0.12', 'blib' => '1.01' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Exporter' => '5.57', 'constant' => '0', 'perl' => '5.006', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900', 'Capture::Tiny' => '0.12' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0', 'if' => '0' }, 'suggests' => { 'Sub::Util' => '0' } } }; $x; }Try-Tiny-0.24/t/00-report-prereqs.t000644 000766 000024 00000012750 12632456415 017265 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021 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( Pod::Coverage ); 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'; if ( $source && $HAS_CPAN_META ) { if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } } else { $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 $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; 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 ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: Try-Tiny-0.24/t/basic.t000600 000766 000024 00000006013 12632456415 015122 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 25; use Try::Tiny; sub _eval { local $@; local $Test::Builder::Level = $Test::Builder::Level + 2; return ( scalar(eval { $_[0]->(); 1 }), $@ ); } sub lives_ok (&$) { my ( $code, $desc ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $ok, $error ) = _eval($code); ok($ok, $desc ); diag "error: $@" unless $ok; } sub throws_ok (&$$) { my ( $code, $regex, $desc ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $ok, $error ) = _eval($code); if ( $ok ) { fail($desc); } else { like($error || '', $regex, $desc ); } } my $prev; lives_ok { try { die "foo"; }; } "basic try"; throws_ok { try { die "foo"; } catch { die $_ }; } qr/foo/, "rethrow"; { local $@ = "magic"; is( try { 42 }, 42, "try block evaluated" ); is( $@, "magic", '$@ untouched' ); } { local $@ = "magic"; is( try { die "foo" }, undef, "try block died" ); is( $@, "magic", '$@ untouched' ); } { local $@ = "magic"; like( (try { die "foo" } catch { $_ }), qr/foo/, "catch block evaluated" ); is( $@, "magic", '$@ untouched' ); } is( scalar(try { "foo", "bar", "gorch" }), "gorch", "scalar context try" ); is_deeply( [ try {qw(foo bar gorch)} ], [qw(foo bar gorch)], "list context try" ); is( scalar(try { die } catch { "foo", "bar", "gorch" }), "gorch", "scalar context catch" ); is_deeply( [ try { die } catch {qw(foo bar gorch)} ], [qw(foo bar gorch)], "list context catch" ); { my ($sub) = catch { my $a = $_; }; is(ref($sub), 'Try::Tiny::Catch', 'Checking catch subroutine scalar reference is correctly blessed'); } { my ($sub) = finally { my $a = $_; }; is(ref($sub), 'Try::Tiny::Finally', 'Checking finally subroutine scalar reference is correctly blessed'); } lives_ok { try { die "foo"; } catch { my $err = shift; try { like $err, qr/foo/; } catch { fail("shouldn't happen"); }; pass "got here"; } } "try in try catch block"; throws_ok { try { die "foo"; } catch { my $err = shift; try { } catch { }; die "rethrowing $err"; } } qr/rethrowing foo/, "rethrow with try in catch block"; sub Evil::DESTROY { eval { "oh noes" }; } sub Evil::new { bless { }, $_[0] } { local $@ = "magic"; local $_ = "other magic"; try { my $object = Evil->new; die "foo"; } catch { pass("catch invoked"); local $TODO = "i don't think we can ever make this work sanely, maybe with SIG{__DIE__}" if $] < 5.014; like($_, qr/foo/); }; is( $@, "magic", '$@ untouched' ); is( $_, "other magic", '$_ untouched' ); } { my ( $caught, $prev ); { local $@; eval { die "bar\n" }; is( $@, "bar\n", 'previous value of $@' ); try { die { prev => $@, } } catch { $caught = $_; $prev = $@; } } is_deeply( $caught, { prev => "bar\n" }, 'previous value of $@ available for capture' ); is( $prev, "bar\n", 'previous value of $@ also available in catch block' ); } Try-Tiny-0.24/t/context.t000600 000766 000024 00000002606 12632456415 015531 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Try::Tiny; plan tests => (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply + 4 # void with exception + (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply + 3 # void no exception ; my $ctx_index = { VOID => undef, LIST => 1, SCALAR => '', }; my ($ctx, $die); for (sort keys %$ctx_index) { $ctx = $_; for (0,1) { $die = $_; if ($ctx_index->{$ctx}) { is_deeply( [ run() ], [ $die ? 'catch' : 'try' ], ); } elsif (defined $ctx_index->{$ctx}) { is_deeply( [ scalar run() ], [ $die ? 'catch' : 'try' ], ); } else { run(); 1; } } } sub run { try { is (wantarray, $ctx_index->{$ctx}, "Proper context $ctx in try{}"); die if $die; return 'try'; } catch { is (wantarray, $ctx_index->{$ctx}, "Proper context $ctx in catch{}"); return 'catch'; } finally { SKIP: { skip "DESTROY() not called in void context on perl $]", 1 if $] < '5.008'; is (wantarray, undef, "Proper VOID context in finally{} 1"); } return 'finally'; } finally { SKIP: { skip "DESTROY() not called in void context on perl $]", 1 if $] < '5.008'; is (wantarray, undef, "Proper VOID context in finally{} 2"); } return 'finally'; }; } Try-Tiny-0.24/t/erroneous_usage.t000600 000766 000024 00000003025 12632456415 017246 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 8; use Try::Tiny; sub _eval { local $@; local $Test::Builder::Level = $Test::Builder::Level + 2; return ( scalar(eval { $_[0]->(); 1 }), $@ ); } sub throws_ok (&$$) { my ( $code, $regex, $desc ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $ok, $error ) = _eval($code); if ( $ok ) { fail($desc); } else { like($error || '', $regex, $desc ); } } throws_ok { try { 1 }; catch { 2 }; } qr/\QUseless bare catch()/, 'Bare catch() detected'; throws_ok { try { 1 }; finally { 2 }; } qr/\QUseless bare finally()/, 'Bare finally() detected'; throws_ok { try { 1 }; catch { 2 } finally { 2 }; } qr/\QUseless bare catch()/, 'Bare catch()/finally() detected'; throws_ok { try { 1 }; finally { 2 } catch { 2 }; } qr/\QUseless bare finally()/, 'Bare finally()/catch() detected'; throws_ok { try { 1 } catch { 2 } catch { 3 } finally { 4 } finally { 5 } } qr/\QA try() may not be followed by multiple catch() blocks/, 'Multi-catch detected'; throws_ok { try { 1 } catch { 2 } do { 2 } } qr/\Qtry() encountered an unexpected argument (2) - perhaps a missing semi-colon before or at/, 'Unterminated try detected'; sub foo { try { 0 }; catch { 2 } } throws_ok { if (foo()) { # ... } } qr/\QUseless bare catch/, 'Bare catch at the end of a function call'; sub bar { try { 0 }; finally { 2 } } throws_ok { if (bar()) { # ... } } qr/\QUseless bare finally/, 'Bare finally at the end of a function call'; Try-Tiny-0.24/t/finally.t000600 000766 000024 00000004520 12632456415 015500 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 27; use Try::Tiny; try { my $a = 1+1; } catch { fail('Cannot go into catch block because we did not throw an exception') } finally { pass('Moved into finally from try'); }; try { die('Die'); } catch { ok($_ =~ /Die/, 'Error text as expected'); pass('Into catch block as we died in try'); } finally { pass('Moved into finally from catch'); }; try { die('Die'); } finally { pass('Moved into finally from catch'); } catch { ok($_ =~ /Die/, 'Error text as expected'); }; try { die('Die'); } finally { pass('Moved into finally block when try throws an exception and we have no catch block'); }; try { die('Die'); } finally { pass('First finally clause run'); } finally { pass('Second finally clause run'); }; try { # do not die } finally { if (@_) { fail("errors reported: @_"); } else { pass("no error reported") ; } }; try { die("Die\n"); } finally { is_deeply(\@_, [ "Die\n" ], "finally got passed the exception"); }; try { try { die "foo"; } catch { die "bar"; } finally { pass("finally called"); }; }; $_ = "foo"; try { is($_, "foo", "not localized in try"); } catch { } finally { is(scalar(@_), 0, "nothing in \@_ (finally)"); is($_, "foo", "\$_ not localized (finally)"); }; is($_, "foo", "same afterwards"); $_ = "foo"; try { is($_, "foo", "not localized in try"); die "bar\n"; } catch { is($_[0], "bar\n", "error in \@_ (catch)"); is($_, "bar\n", "error in \$_ (catch)"); } finally { is(scalar(@_), 1, "error in \@_ (finally)"); is($_[0], "bar\n", "error in \@_ (finally)"); is($_, "foo", "\$_ not localized (finally)"); }; is($_, "foo", "same afterwards"); { my @warnings; local $SIG{__WARN__} = sub { $_[0] =~ /\QExecution of finally() block CODE(0x\E.+\Q) resulted in an exception/ ? push @warnings, @_ : warn @_ }; try { die 'tring' } finally { die 'fin 1' } finally { pass('fin 2 called') } finally { die 'fin 3' }; is( scalar @warnings, 2, 'warnings from both fatal finally blocks' ); my @originals = sort map { $_ =~ /Original exception text follows:\n\n(.+)/s } @warnings; like $originals[0], qr/fin 1 at/, 'First warning contains original exception'; like $originals[1], qr/fin 3 at/, 'Second warning contains original exception'; } 1; Try-Tiny-0.24/t/given_when.t000600 000766 000024 00000001126 12632456415 016172 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More; BEGIN { plan skip_all => "Perl 5.10 is required" unless eval { require 5.010 }; plan tests => 2; } use Try::Tiny; use 5.010; no if $] >= 5.017011, warnings => 'experimental::smartmatch'; my ( $error, $topic ); given ("foo") { when (qr/./) { try { die "blah\n"; } catch { $topic = $_; $error = $_[0]; } }; } is( $error, "blah\n", "error caught" ); { local $TODO = "perhaps a workaround can be found" if $] < 5.017003; is( $topic, $error, 'error is also in $_' ); } # ex: set sw=4 et: Try-Tiny-0.24/t/global_destruction_forked.t000600 000766 000024 00000001616 12632456415 021262 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 3; use Try::Tiny; { package WithCatch; use Try::Tiny; sub DESTROY { try {} catch {}; return; } } { package WithFinally; use Try::Tiny; sub DESTROY { try {} finally {}; return; } } my $parent = $$; try { my $pid = fork; unless ($pid) { my $o = bless {}, 'WithCatch'; $SIG{__DIE__} = sub { exit 1 if $_[0] =~ /A try\(\) may not be followed by multiple catch\(\) blocks/; exit 2; }; exit 0; } waitpid $pid, 0; is $?, 0, 'nested try in cleanup after fork does not maintain outer catch block'; } catch {}; try { my $pid = fork; unless ($pid) { my $o = bless {}, 'WithFinally'; exit 0; } waitpid $pid, 0; is $?, 0, 'nested try in cleanup after fork does not maintain outer finally block'; } finally { exit 1 if $parent != $$ }; pass("Didn't just exit"); Try-Tiny-0.24/t/global_destruction_load.t000600 000766 000024 00000001045 12632456415 020723 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; BEGIN { plan skip_all => 'Capture::Tiny 0.12 required' unless eval { require Capture::Tiny; Capture::Tiny->VERSION(0.12); 1 }; plan tests => 3; Capture::Tiny->import(qw(capture_stderr)); } for my $func (qw(try catch finally)) { is capture_stderr { system $^X, qw(-It/lib -we), qq{sub DESTROY { require TryUser; TryUser->test_$func }} . q{our $o; $o = bless []}; }, '', "$func gets installed when loading Try::Tiny during global destruction"; } Try-Tiny-0.24/t/lib/000700 000766 000024 00000000000 12632456415 014420 5ustar00etherstaff000000 000000 Try-Tiny-0.24/t/named.t000600 000766 000024 00000001277 12632456415 015134 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More; BEGIN { plan skip_all => "Sub::Util or Sub::Name required" unless eval { require Sub::Util; defined &Sub::Util::set_subname; } || eval { require Sub::Name; Sub::Name->VERSION(0.08) }; plan tests => 3; } use Try::Tiny; my $name; try { $name = (caller(0))[3]; }; is $name, "main::try {...} ", "try name"; # note extra space try { die "Boom"; } catch { $name = (caller(0))[3]; }; is $name, "main::catch {...} ", "catch name"; # note extra space try { die "Boom"; } catch { # noop } finally { $name = (caller(0))[3]; }; is $name, "main::finally {...} ", "finally name"; # note extra space Try-Tiny-0.24/t/when.t000600 000766 000024 00000001076 12632456415 015006 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More; BEGIN { plan skip_all => "Perl 5.10 required" unless eval { require 5.010; 1 }; plan tests => 5; } use Try::Tiny; use 5.010; no if $] >= 5.017011, warnings => 'experimental::smartmatch'; my ( $foo, $bar, $other ); $_ = "magic"; try { die "foo"; } catch { like( $_, qr/foo/ ); when (/bar/) { $bar++ }; when (/foo/) { $foo++ }; default { $other++ }; }; is( $_, "magic", '$_ not clobbered' ); ok( !$bar, "bar didn't match" ); ok( $foo, "foo matched" ); ok( !$other, "fallback didn't match" ); Try-Tiny-0.24/t/lib/TryUser.pm000600 000766 000024 00000000215 12632456415 016373 0ustar00etherstaff000000 000000 package TryUser; use Try::Tiny; sub test_try { try { } } sub test_catch { try { } catch { } } sub test_finally { try { } finally { } } 1; Try-Tiny-0.24/maint/bench.pl000600 000766 000024 00000000405 12632456415 016134 0ustar00etherstaff000000 000000 #!/usr/bin/env perl use warnings; use strict; use Benchmark::Dumb ':all'; use Try::Tiny; my $max = 10_000; cmpthese('0.003', { eval => sub { do { local $@; eval { die 'foo' } } for (1..$max) }, try => sub { do { try { die 'foo' } } for (1..$max) }, }); Try-Tiny-0.24/lib/Try/000700 000766 000024 00000000000 12632456415 014733 5ustar00etherstaff000000 000000 Try-Tiny-0.24/lib/Try/Tiny.pm000600 000766 000024 00000047227 12632456415 016232 0ustar00etherstaff000000 000000 package Try::Tiny; # git description: v0.23-3-g5ee27f1 use 5.006; # ABSTRACT: minimal try/catch with proper preservation of $@ our $VERSION = '0.24'; use strict; use warnings; use Exporter 5.57 'import'; our @EXPORT = our @EXPORT_OK = qw(try catch finally); use Carp; $Carp::Internal{+__PACKAGE__}++; BEGIN { my $su = $INC{'Sub/Util.pm'} && defined &Sub::Util::set_subname; my $sn = $INC{'Sub/Name.pm'} && eval { Sub::Name->VERSION(0.08) }; unless ($su || $sn) { $su = eval { require Sub::Util; } && defined &Sub::Util::set_subname; unless ($su) { $sn = eval { require Sub::Name; Sub::Name->VERSION(0.08) }; } } *_subname = $su ? \&Sub::Util::set_subname : $sn ? \&Sub::Name::subname : sub { $_[1] }; *_HAS_SUBNAME = ($su || $sn) ? sub(){1} : sub(){0}; } # Need to prototype as @ not $$ because of the way Perl evaluates the prototype. # Keeping it at $$ means you only ever get 1 sub because we need to eval in a list # context & not a scalar one sub try (&;@) { my ( $try, @code_refs ) = @_; # we need to save this here, the eval block will be in scalar context due # to $failed my $wantarray = wantarray; # work around perl bug by explicitly initializing these, due to the likelyhood # this will be used in global destruction (perl rt#119311) my ( $catch, @finally ) = (); # find labeled blocks in the argument list. # catch and finally tag the blocks by blessing a scalar reference to them. foreach my $code_ref (@code_refs) { if ( ref($code_ref) eq 'Try::Tiny::Catch' ) { croak 'A try() may not be followed by multiple catch() blocks' if $catch; $catch = ${$code_ref}; } elsif ( ref($code_ref) eq 'Try::Tiny::Finally' ) { push @finally, ${$code_ref}; } else { croak( 'try() encountered an unexpected argument (' . ( defined $code_ref ? $code_ref : 'undef' ) . ') - perhaps a missing semi-colon before or' ); } } # FIXME consider using local $SIG{__DIE__} to accumulate all errors. It's # not perfect, but we could provide a list of additional errors for # $catch->(); # name the blocks if we have Sub::Name installed my $caller = caller; _subname("${caller}::try {...} " => $try) if _HAS_SUBNAME; # save the value of $@ so we can set $@ back to it in the beginning of the eval # and restore $@ after the eval finishes my $prev_error = $@; my ( @ret, $error ); # failed will be true if the eval dies, because 1 will not be returned # from the eval body my $failed = not eval { $@ = $prev_error; # evaluate the try block in the correct context if ( $wantarray ) { @ret = $try->(); } elsif ( defined $wantarray ) { $ret[0] = $try->(); } else { $try->(); }; return 1; # properly set $failed to false }; # preserve the current error and reset the original value of $@ $error = $@; $@ = $prev_error; # set up a scope guard to invoke the finally block at the end my @guards = map { Try::Tiny::ScopeGuard->_new($_, $failed ? $error : ()) } @finally; # at this point $failed contains a true value if the eval died, even if some # destructor overwrote $@ as the eval was unwinding. if ( $failed ) { # if we got an error, invoke the catch block. if ( $catch ) { # This works like given($error), but is backwards compatible and # sets $_ in the dynamic scope for the body of C<$catch> for ($error) { return $catch->($error); } # in case when() was used without an explicit return, the C # loop will be aborted and there's no useful return value } return; } else { # no failure, $@ is back to what it was, everything is fine return $wantarray ? @ret : $ret[0]; } } sub catch (&;@) { my ( $block, @rest ) = @_; croak 'Useless bare catch()' unless wantarray; my $caller = caller; _subname("${caller}::catch {...} " => $block) if _HAS_SUBNAME; return ( bless(\$block, 'Try::Tiny::Catch'), @rest, ); } sub finally (&;@) { my ( $block, @rest ) = @_; croak 'Useless bare finally()' unless wantarray; my $caller = caller; _subname("${caller}::finally {...} " => $block) if _HAS_SUBNAME; return ( bless(\$block, 'Try::Tiny::Finally'), @rest, ); } { package # hide from PAUSE Try::Tiny::ScopeGuard; use constant UNSTABLE_DOLLARAT => ($] < '5.013002') ? 1 : 0; sub _new { shift; bless [ @_ ]; } sub DESTROY { my ($code, @args) = @{ $_[0] }; local $@ if UNSTABLE_DOLLARAT; eval { $code->(@args); 1; } or do { warn "Execution of finally() block $code resulted in an exception, which " . '*CAN NOT BE PROPAGATED* due to fundamental limitations of Perl. ' . 'Your program will continue as if this event never took place. ' . "Original exception text follows:\n\n" . (defined $@ ? $@ : '$@ left undefined...') . "\n" ; } } } __PACKAGE__ __END__ =pod =encoding UTF-8 =head1 NAME Try::Tiny - minimal try/catch with proper preservation of $@ =head1 VERSION version 0.24 =head1 SYNOPSIS You can use Try::Tiny's C and C to expect and handle exceptional conditions, avoiding quirks in Perl and common mistakes: # handle errors with a catch handler try { die "foo"; } catch { warn "caught error: $_"; # not $@ }; You can also use it like a standalone C to catch and ignore any error conditions. Obviously, this is an extreme measure not to be undertaken lightly: # just silence errors try { die "foo"; }; =head1 DESCRIPTION This module provides bare bones C/C/C statements that are designed to minimize common mistakes with eval blocks, and NOTHING else. This is unlike L which provides a nice syntax and avoids adding another call stack layer, and supports calling C from the C block to return from the parent subroutine. These extra features come at a cost of a few dependencies, namely L and L which are occasionally problematic, and the additional catch filtering uses L type constraints which may not be desirable either. The main focus of this module is to provide simple and reliable error handling for those having a hard time installing L, but who still want to write correct C blocks without 5 lines of boilerplate each time. It's designed to work as correctly as possible in light of the various pathological edge cases (see L) and to be compatible with any style of error values (simple strings, references, objects, overloaded objects, etc). If the C block dies, it returns the value of the last statement executed in the C block, if there is one. Otherwise, it returns C in scalar context or the empty list in list context. The following examples all assign C<"bar"> to C<$x>: my $x = try { die "foo" } catch { "bar" }; my $x = try { die "foo" } || "bar"; my $x = (try { die "foo" }) // "bar"; my $x = eval { die "foo" } || "bar"; You can add C blocks, yielding the following: my $x; try { die 'foo' } finally { $x = 'bar' }; try { die 'foo' } catch { warn "Got a die: $_" } finally { $x = 'bar' }; C blocks are always executed making them suitable for cleanup code which cannot be handled using local. You can add as many C blocks to a given C block as you like. Note that adding a C block without a preceding C block suppresses any errors. This behaviour is consistent with using a standalone C, but it is not consistent with C/C patterns found in other programming languages, such as Java, Python, Javascript or C#. If you learnt the C/C pattern from one of these languages, watch out for this. =head1 EXPORTS All functions are exported by default using L. If you need to rename the C, C or C keyword consider using L to get L's flexibility. =over 4 =item try (&;@) Takes one mandatory C subroutine, an optional C subroutine and C subroutine. The mandatory subroutine is evaluated in the context of an C block. If no error occurred the value from the first block is returned, preserving list/scalar context. If there was an error and the second subroutine was given it will be invoked with the error in C<$_> (localized) and as that block's first and only argument. C<$@> does B contain the error. Inside the C block it has the same value it had before the C block was executed. Note that the error may be false, but if that happens the C block will still be invoked. Once all execution is finished then the C block, if given, will execute. =item catch (&;@) Intended to be used in the second argument position of C. Returns a reference to the subroutine it was given but blessed as C which allows try to decode correctly what to do with this code reference. catch { ... } Inside the C block the caught error is stored in C<$_>, while previous value of C<$@> is still available for use. This value may or may not be meaningful depending on what happened before the C, but it might be a good idea to preserve it in an error stack. For code that captures C<$@> when throwing new errors (i.e. L), you'll need to do: local $@ = $_; =item finally (&;@) try { ... } catch { ... } finally { ... }; Or try { ... } finally { ... }; Or even try { ... } finally { ... } catch { ... }; Intended to be the second or third element of C. C blocks are always executed in the event of a successful C or if C is run. This allows you to locate cleanup code which cannot be done via C e.g. closing a file handle. When invoked, the C block is passed the error that was caught. If no error was caught, it is passed nothing. (Note that the C block does not localize C<$_> with the error, since unlike in a C block, there is no way to know if C<$_ == undef> implies that there were no errors.) In other words, the following code does just what you would expect: try { die_sometimes(); } catch { # ...code run in case of error } finally { if (@_) { print "The try block died with: @_\n"; } else { print "The try block ran without error.\n"; } }; B block>. C will not do anything about handling possible errors coming from code located in these blocks. Furthermore B blocks are not trappable and are unable to influence the execution of your program>. This is due to limitation of C-based scope guards, which C is implemented on top of. This may change in a future version of Try::Tiny. In the same way C blesses the code reference this subroutine does the same except it bless them as C. =back =head1 BACKGROUND There are a number of issues with C. =head2 Clobbering $@ When you run an C block and it succeeds, C<$@> will be cleared, potentially clobbering an error that is currently being caught. This causes action at a distance, clearing previous errors your caller may have not yet handled. C<$@> must be properly localized before invoking C in order to avoid this issue. More specifically, C<$@> is clobbered at the beginning of the C, which also makes it impossible to capture the previous error before you die (for instance when making exception objects with error stacks). For this reason C will actually set C<$@> to its previous value (the one available before entering the C block) in the beginning of the C block. =head2 Localizing $@ silently masks errors Inside an C block, C behaves sort of like: sub die { $@ = $_[0]; return_undef_from_eval(); } This means that if you were polite and localized C<$@> you can't die in that scope, or your error will be discarded (printing "Something's wrong" instead). The workaround is very ugly: my $error = do { local $@; eval { ... }; $@; }; ... die $error; =head2 $@ might not be a true value This code is wrong: if ( $@ ) { ... } because due to the previous caveats it may have been unset. C<$@> could also be an overloaded error object that evaluates to false, but that's asking for trouble anyway. The classic failure mode is: sub Object::DESTROY { eval { ... } } eval { my $obj = Object->new; die "foo"; }; if ( $@ ) { } In this case since C is not localizing C<$@> but still uses C, it will set C<$@> to C<"">. The destructor is called when the stack is unwound, after C sets C<$@> to C<"foo at Foo.pm line 42\n">, so by the time C is evaluated it has been cleared by C in the destructor. The workaround for this is even uglier than the previous ones. Even though we can't save the value of C<$@> from code that doesn't localize, we can at least be sure the C was aborted due to an error: my $failed = not eval { ... return 1; }; This is because an C that caught a C will always return a false value. =head1 SHINY SYNTAX Using Perl 5.10 you can use L. =for stopwords topicalizer The C block is invoked in a topicalizer context (like a C block), but note that you can't return a useful value from C using the C blocks without an explicit C. This is somewhat similar to Perl 6's C blocks. You can use it to concisely match errors: try { require Foo; } catch { when (/^Can't locate .*?\.pm in \@INC/) { } # ignore default { die $_ } }; =head1 CAVEATS =over 4 =item * C<@_> is not available within the C block, so you need to copy your argument list. In case you want to work with argument values directly via C<@_> aliasing (i.e. allow C<$_[1] = "foo">), you need to pass C<@_> by reference: sub foo { my ( $self, @args ) = @_; try { $self->bar(@args) } } or sub bar_in_place { my $self = shift; my $args = \@_; try { $_ = $self->bar($_) for @$args } } =item * C returns from the C block, not from the parent sub (note that this is also how C works, but not how L works): sub parent_sub { try { die; } catch { return; }; say "this text WILL be displayed, even though an exception is thrown"; } Instead, you should capture the return value: sub parent_sub { my $success = try { die; 1; }; return unless $success; say "This text WILL NEVER appear!"; } # OR sub parent_sub_with_catch { my $success = try { die; 1; } catch { # do something with $_ return undef; #see note }; return unless $success; say "This text WILL NEVER appear!"; } Note that if you have a C block, it must return C for this to work, since if a C block exists, its return value is returned in place of C when an exception is thrown. =item * C introduces another caller stack frame. L is not used. L will not report this when using full stack traces, though, because C<%Carp::Internal> is used. This lack of magic is considered a feature. =for stopwords unhygienically =item * The value of C<$_> in the C block is not guaranteed to be the value of the exception thrown (C<$@>) in the C block. There is no safe way to ensure this, since C may be used unhygienically in destructors. The only guarantee is that the C will be called if an exception is thrown. =item * The return value of the C block is not ignored, so if testing the result of the expression for truth on success, be sure to return a false value from the C block: my $obj = try { MightFail->new; } catch { ... return; # avoid returning a true value; }; return unless $obj; =item * C<$SIG{__DIE__}> is still in effect. Though it can be argued that C<$SIG{__DIE__}> should be disabled inside of C blocks, since it isn't people have grown to rely on it. Therefore in the interests of compatibility, C does not disable C<$SIG{__DIE__}> for the scope of the error throwing code. =item * Lexical C<$_> may override the one set by C. For example Perl 5.10's C form uses a lexical C<$_>, creating some confusing behavior: given ($foo) { when (...) { try { ... } catch { warn $_; # will print $foo, not the error warn $_[0]; # instead, get the error like this } } } Note that this behavior was changed once again in L. However, since the entirety of lexical C<$_> is now L, it is unclear whether the new version 18 behavior is final. =back =head1 SEE ALSO =over 4 =item L Much more feature complete, more convenient semantics, but at the cost of implementation complexity. =item L Automatic error throwing for builtin functions and more. Also designed to work well with C/C. =item L A lightweight role for rolling your own exception classes. =item L Exception object implementation with a C statement. Does not localize C<$@>. =item L Provides a C statement, but properly calling C is your responsibility. The C keyword pushes C<$@> onto an error stack, avoiding some of the issues with C<$@>, but you still need to localize to prevent clobbering. =back =head1 LIGHTNING TALK I gave a lightning talk about this module, you can see the slides (Firefox only): L Or read the source: L =head1 VERSION CONTROL L =head1 SUPPORT Bugs may be submitted through L (or L). =head1 AUTHORS =over 4 =item * יובל קוג'מן (Yuval Kogman) =item * Jesse Luehrs =back =head1 CONTRIBUTORS =for stopwords Karen Etheridge Peter Rabbitson Ricardo Signes Mark Fowler Graham Knop Dagfinn Ilmari Mannsåker Paul Howarth Rudolf Leermakers anaxagoras awalker chromatic Alex cm-perl Andrew Yates David Lowe Glenn Hans Dieter Pearcey Jonathan Yu Marc Mims Stosberg =over 4 =item * Karen Etheridge =item * Peter Rabbitson =item * Ricardo Signes =item * Mark Fowler =item * Graham Knop =item * Dagfinn Ilmari Mannsåker =item * Paul Howarth =item * Rudolf Leermakers =item * anaxagoras =item * awalker =item * chromatic =item * Alex =item * cm-perl =item * Andrew Yates =item * David Lowe =item * Glenn Fowler =item * Hans Dieter Pearcey =item * Jonathan Yu =item * Marc Mims =item * Mark Stosberg =back =head1 COPYRIGHT AND LICENCE This software is Copyright (c) 2009 by יובל קוג'מן (Yuval Kogman). This is free software, licensed under: The MIT (X11) License =cut