r74074 - in /branches/upstream/libouch-perl/current: Changes LICENSE MANIFEST META.yml Makefile.PL README dist.ini lib/Ouch.pm t/Ouch.t t/release-pod-coverage.t t/release-pod-syntax.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Fri May 6 21:35:44 UTC 2011
Author: gregoa
Date: Fri May 6 21:35:36 2011
New Revision: 74074
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74074
Log:
[svn-upgrade] new version libouch-perl (0.0401)
Added:
branches/upstream/libouch-perl/current/t/release-pod-coverage.t
branches/upstream/libouch-perl/current/t/release-pod-syntax.t
Modified:
branches/upstream/libouch-perl/current/Changes
branches/upstream/libouch-perl/current/LICENSE
branches/upstream/libouch-perl/current/MANIFEST
branches/upstream/libouch-perl/current/META.yml
branches/upstream/libouch-perl/current/Makefile.PL
branches/upstream/libouch-perl/current/README
branches/upstream/libouch-perl/current/dist.ini
branches/upstream/libouch-perl/current/lib/Ouch.pm
branches/upstream/libouch-perl/current/t/Ouch.t
Modified: branches/upstream/libouch-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/Changes?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/Changes (original)
+++ branches/upstream/libouch-perl/current/Changes Fri May 6 21:35:36 2011
@@ -1,3 +1,10 @@
+0.0401 - April 30, 2011
+ - beppu pointed out there was no $VERSION. Told Dist::Zilla to add that.
+
+0.0400 - April 30, 2011
+ - Merged barf() from William Orr.
+ - Added an export called ":trytiny" which exports throw(), caught(), and caught_all().
+
0.0300 - April 14, 2011
- Added hug() as a catch all.
Modified: branches/upstream/libouch-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/LICENSE?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/LICENSE (original)
+++ branches/upstream/libouch-perl/current/LICENSE Fri May 6 21:35:36 2011
@@ -18,15 +18,16 @@
The GNU General Public License, Version 1, February 1989
- GNU GENERAL PUBLIC LICENSE
- Version 1, February 1989
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
@@ -67,7 +68,7 @@
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
@@ -185,7 +186,7 @@
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -207,9 +208,9 @@
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
@@ -235,8 +236,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+
Also add information on how to contact you by electronic and paper mail.
Modified: branches/upstream/libouch-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/MANIFEST?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/MANIFEST (original)
+++ branches/upstream/libouch-perl/current/MANIFEST Fri May 6 21:35:36 2011
@@ -7,3 +7,5 @@
dist.ini
lib/Ouch.pm
t/Ouch.t
+t/release-pod-coverage.t
+t/release-pod-syntax.t
Modified: branches/upstream/libouch-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/META.yml?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/META.yml (original)
+++ branches/upstream/libouch-perl/current/META.yml Fri May 6 21:35:36 2011
@@ -4,15 +4,18 @@
- 'JT Smith <jt at plainblack.com>'
build_requires: {}
configure_requires:
- ExtUtils::MakeMaker: 6.31
+ ExtUtils::MakeMaker: 6.30
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.101670'
+generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Ouch
+requires:
+ Test::More: 0
+ Test::Trap: 0
resources:
bugtracker: http://github.com/rizen/Ouch/issues
repository: git://github.com/rizen/Ouch.git
-version: 0.0300
+version: 0.0401
Modified: branches/upstream/libouch-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/Makefile.PL?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/Makefile.PL (original)
+++ branches/upstream/libouch-perl/current/Makefile.PL Fri May 6 21:35:36 2011
@@ -4,7 +4,7 @@
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker 6.30;
@@ -13,14 +13,17 @@
'AUTHOR' => 'JT Smith <jt at plainblack.com>',
'BUILD_REQUIRES' => {},
'CONFIGURE_REQUIRES' => {
- 'ExtUtils::MakeMaker' => '6.31'
+ 'ExtUtils::MakeMaker' => '6.30'
},
'DISTNAME' => 'Ouch',
'EXE_FILES' => [],
'LICENSE' => 'perl',
'NAME' => 'Ouch',
- 'PREREQ_PM' => {},
- 'VERSION' => '0.0300',
+ 'PREREQ_PM' => {
+ 'Test::More' => '0',
+ 'Test::Trap' => '0'
+ },
+ 'VERSION' => '0.0401',
'test' => {
'TESTS' => 't/*.t'
}
Modified: branches/upstream/libouch-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/README?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/README (original)
+++ branches/upstream/libouch-perl/current/README Fri May 6 21:35:36 2011
@@ -1,7 +1,7 @@
This archive contains the distribution Ouch,
-version 0.0300:
+version 0.0401:
Exceptions that don't hurt.
Modified: branches/upstream/libouch-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/dist.ini?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/dist.ini (original)
+++ branches/upstream/libouch-perl/current/dist.ini Fri May 6 21:35:36 2011
@@ -4,9 +4,9 @@
copyright_holder = Plain Black Corporation
copyright_year = 2011
-version = 0.0300
+version = 0.0401
-[@Basic]
+[@Classic]
[MetaResources]
bugtracker.web = http://github.com/rizen/Ouch/issues
@@ -14,4 +14,6 @@
repository.web = http://github.com/rizen/Ouch
repository.type = git
-
+[Prereq]
+Test::More = 0
+Test::Trap = 0
Modified: branches/upstream/libouch-perl/current/lib/Ouch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/lib/Ouch.pm?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/lib/Ouch.pm (original)
+++ branches/upstream/libouch-perl/current/lib/Ouch.pm Fri May 6 21:35:36 2011
@@ -1,13 +1,16 @@
use strict;
use warnings;
package Ouch;
+BEGIN {
+ $Ouch::VERSION = '0.0401';
+}
use Carp qw(longmess shortmess);
use parent 'Exporter';
use overload bool => sub {1}, q{""} => 'scalar', fallback => 1;
-our @EXPORT = qw(bleep ouch kiss hug);
-our @EXPORT_OK = qw(try throw catch catch_all);
-our %EXPORT_TAGS = ( traditional => [qw( throw catch try catch_all )] );
+our @EXPORT = qw(bleep ouch kiss hug barf);
+our @EXPORT_OK = qw(try throw catch catch_all caught caught_all);
+our %EXPORT_TAGS = ( traditional => [qw(try throw catch catch_all)], trytiny => [qw( throw caught caught_all )] );
sub new {
my ($class, $code, $message, $data) = @_;
@@ -43,6 +46,10 @@
kiss @_;
}
+sub caught {
+ kiss @_;
+}
+
sub hug {
my ($e) = @_;
$e ||= $@;
@@ -50,6 +57,10 @@
}
sub catch_all {
+ hug @_;
+}
+
+sub caught_all {
hug @_;
}
@@ -70,6 +81,21 @@
}
}
+sub barf {
+ my ($e) = @_;
+ my $code;
+ $e ||= $@;
+ if (ref $e eq 'Ouch') {
+ $code = $e->code;
+ }
+ else {
+ $code = 1;
+ }
+
+ print STDERR bleep($e)."\n";
+ exit $code;
+}
+
sub scalar {
my $self = shift;
return $self->{shortmess};
@@ -107,6 +133,10 @@
=head1 NAME
Ouch - Exceptions that don't hurt.
+
+=head1 VERSION
+
+version 0.0401
=head1 SYNOPSIS
@@ -257,6 +287,18 @@
=back
+=head3
+
+Calls C<bleep>, and then exits with error code
+
+=over
+
+=item exception
+
+Optional. You can pass an exception into C<barf> which then gets passed to C<bleep> otherwise it will use whatever's in C<$@>
+
+=back
+
=head2 Object-Oriented Interface
@@ -308,7 +350,7 @@
=head2 Traditional Interface
-Some people just can't bring themselves to use the sugary cuteness of Ouch. For them there is the traditional interface. Here's how it works:
+Some people just can't bring themselves to use the sugary cuteness of Ouch. For them there is the C<:traditional> interface. Here's how it works:
use Ouch qw(:traditional);
@@ -354,6 +396,26 @@
Works exactly like C<hug>. See C<hug> for details.
+=head2 Try::Tiny
+
+Many Ouch users, like to use Ouch with L<Try::Tiny>, and some of them are sticks in the mud who can't bring themselves to C<ouch> and C<kiss>, and don't like that C<:traditional> walks all over C<try> and C<catch> For them, there is the C<:trytiny> interface. Here's how it works:
+
+ use Try::Tiny;
+ use Ouch qw(:trytiny);
+
+ try {
+ throw(404, 'File not found!';
+ }
+ catch {
+ if (caught($_)) {
+ # do something
+ }
+ else {
+ throw($_); # rethrow
+ }
+ };
+
+
=head1 SUPPORT
=over
@@ -383,4 +445,4 @@
=cut
-1;
+1;
Modified: branches/upstream/libouch-perl/current/t/Ouch.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/t/Ouch.t?rev=74074&op=diff
==============================================================================
--- branches/upstream/libouch-perl/current/t/Ouch.t (original)
+++ branches/upstream/libouch-perl/current/t/Ouch.t Fri May 6 21:35:36 2011
@@ -1,4 +1,5 @@
-use Test::More tests => 23;
+use Test::More tests => 27;
+use Test::Trap;
use lib '../lib';
use_ok 'Ouch';
@@ -45,3 +46,12 @@
is kiss('missing_param'), 1, 'kiss works on strings';
is kiss('foo'), 0, 'kiss gives no false positives';
+# barf
+trap {eval { ouch(100, 'oops') } or barf() };
+is $trap->exit, 100, 'exit code';
+is $trap->stderr, "oops\n", 'stderr err message';
+
+# more barf
+trap { eval { die 'error' } or barf() };
+is $trap->exit, 1, 'default barf exit code';
+is $trap->stderr, "error\n", 'stderr err message w/o ouch';
Added: branches/upstream/libouch-perl/current/t/release-pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/t/release-pod-coverage.t?rev=74074&op=file
==============================================================================
--- branches/upstream/libouch-perl/current/t/release-pod-coverage.t (added)
+++ branches/upstream/libouch-perl/current/t/release-pod-coverage.t Fri May 6 21:35:36 2011
@@ -1,0 +1,21 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
+ if $@;
+
+eval "use Pod::Coverage::TrustPod";
+plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
+ if $@;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
Added: branches/upstream/libouch-perl/current/t/release-pod-syntax.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libouch-perl/current/t/release-pod-syntax.t?rev=74074&op=file
==============================================================================
--- branches/upstream/libouch-perl/current/t/release-pod-syntax.t (added)
+++ branches/upstream/libouch-perl/current/t/release-pod-syntax.t Fri May 6 21:35:36 2011
@@ -1,0 +1,15 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+use Test::More;
+
+eval "use Test::Pod 1.41";
+plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
+
+all_pod_files_ok();
More information about the Pkg-perl-cvs-commits
mailing list