r74076 - in /trunk/libouch-perl: Changes LICENSE MANIFEST META.yml Makefile.PL README debian/changelog 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:39:59 UTC 2011


Author: gregoa
Date: Fri May  6 21:39:47 2011
New Revision: 74076

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74076
Log:
New upstream release.

Added:
    trunk/libouch-perl/t/release-pod-coverage.t
      - copied unchanged from r74075, branches/upstream/libouch-perl/current/t/release-pod-coverage.t
    trunk/libouch-perl/t/release-pod-syntax.t
      - copied unchanged from r74075, branches/upstream/libouch-perl/current/t/release-pod-syntax.t
Modified:
    trunk/libouch-perl/Changes
    trunk/libouch-perl/LICENSE
    trunk/libouch-perl/MANIFEST
    trunk/libouch-perl/META.yml
    trunk/libouch-perl/Makefile.PL
    trunk/libouch-perl/README
    trunk/libouch-perl/debian/changelog
    trunk/libouch-perl/dist.ini
    trunk/libouch-perl/lib/Ouch.pm
    trunk/libouch-perl/t/Ouch.t

Modified: trunk/libouch-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/Changes?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/Changes (original)
+++ trunk/libouch-perl/Changes Fri May  6 21:39:47 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: trunk/libouch-perl/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/LICENSE?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/LICENSE (original)
+++ trunk/libouch-perl/LICENSE Fri May  6 21:39:47 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: trunk/libouch-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/MANIFEST?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/MANIFEST (original)
+++ trunk/libouch-perl/MANIFEST Fri May  6 21:39:47 2011
@@ -7,3 +7,5 @@
 dist.ini
 lib/Ouch.pm
 t/Ouch.t
+t/release-pod-coverage.t
+t/release-pod-syntax.t

Modified: trunk/libouch-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/META.yml?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/META.yml (original)
+++ trunk/libouch-perl/META.yml Fri May  6 21:39:47 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: trunk/libouch-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/Makefile.PL?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/Makefile.PL (original)
+++ trunk/libouch-perl/Makefile.PL Fri May  6 21:39:47 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: trunk/libouch-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/README?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/README (original)
+++ trunk/libouch-perl/README Fri May  6 21:39:47 2011
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Ouch,
-version 0.0300:
+version 0.0401:
 
   Exceptions that don't hurt.
 

Modified: trunk/libouch-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/debian/changelog?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/debian/changelog (original)
+++ trunk/libouch-perl/debian/changelog Fri May  6 21:39:47 2011
@@ -1,3 +1,9 @@
+libouch-perl (0.0401-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Fri, 06 May 2011 23:36:14 +0200
+
 libouch-perl (0.0300-1) unstable; urgency=low
 
   * Initial release (closes: #623530).

Modified: trunk/libouch-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/dist.ini?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/dist.ini (original)
+++ trunk/libouch-perl/dist.ini Fri May  6 21:39:47 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: trunk/libouch-perl/lib/Ouch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/lib/Ouch.pm?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/lib/Ouch.pm (original)
+++ trunk/libouch-perl/lib/Ouch.pm Fri May  6 21:39:47 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: trunk/libouch-perl/t/Ouch.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libouch-perl/t/Ouch.t?rev=74076&op=diff
==============================================================================
--- trunk/libouch-perl/t/Ouch.t (original)
+++ trunk/libouch-perl/t/Ouch.t Fri May  6 21:39:47 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';




More information about the Pkg-perl-cvs-commits mailing list