r39012 - in /branches/upstream/libautodie-perl/current: AUTHORS Changes META.yml lib/Fatal.pm lib/autodie.pm lib/autodie/exception.pm lib/autodie/exception/system.pm lib/autodie/hints.pm t/hints.t t/pod-coverage.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Jul 1 04:39:18 UTC 2009


Author: jawnsy-guest
Date: Wed Jul  1 04:39:01 2009
New Revision: 39012

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39012
Log:
[svn-upgrade] Integrating new upstream version, libautodie-perl (2.01)

Modified:
    branches/upstream/libautodie-perl/current/AUTHORS
    branches/upstream/libautodie-perl/current/Changes
    branches/upstream/libautodie-perl/current/META.yml
    branches/upstream/libautodie-perl/current/lib/Fatal.pm
    branches/upstream/libautodie-perl/current/lib/autodie.pm
    branches/upstream/libautodie-perl/current/lib/autodie/exception.pm
    branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm
    branches/upstream/libautodie-perl/current/lib/autodie/hints.pm
    branches/upstream/libautodie-perl/current/t/hints.t
    branches/upstream/libautodie-perl/current/t/pod-coverage.t

Modified: branches/upstream/libautodie-perl/current/AUTHORS
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/AUTHORS?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/AUTHORS (original)
+++ branches/upstream/libautodie-perl/current/AUTHORS Wed Jul  1 04:39:01 2009
@@ -19,9 +19,6 @@
 
 Aristotle Pagaltzis
         - Suggestions and sanity checking on design and interface
-
-Jacinta Richardson
-        - Documentation improvements
 
 Mark Reed and Rolan Giersig
         - Klingon Translators
@@ -78,3 +75,6 @@
         - Documentation review and improvement when I had spent
           so long looking at the autodie::hints documentation I
           wasn't sure if they made sense anymore. ;)
+
+Toby Corkindale
+        - Documentation copyediting and improvements.

Modified: branches/upstream/libautodie-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/Changes?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/Changes (original)
+++ branches/upstream/libautodie-perl/current/Changes Wed Jul  1 04:39:01 2009
@@ -1,4 +1,25 @@
 Revision history for autodie
+
+2.01  Wed Jul  1 01:31:24 AUSEST 2009
+
+        * DOCUMENTATION: General copyediting and tidy-up
+          (Thanks to Toby Corkindale)
+
+        * BUGFIX: Warnings are no longer emitted when undefined values
+          are compared by hinting routines.
+
+        * BUGFIX: Hints for File::Copy now operate correctly under
+          Perl 5.10.1.
+
+        * BUGFIX: Inheritance is now considered sufficient to declare
+          allegiance to the hints provider role under Perl 5.8.x.
+          (Thanks to Glenn Fowler)
+
+        * TEST: hints.t no longer throws failures under Perl 5.10.1.
+
+        * TEST: pod-coverage.t (author test) no longer fails if
+          Sub::Identify is not installed.
+          (Thanks to Jonathan Yu. RT #47437)
 
 2.00  Mon Jun 29 01:24:49 AUSEST 2009
 

Modified: branches/upstream/libautodie-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/META.yml?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/META.yml (original)
+++ branches/upstream/libautodie-perl/current/META.yml Wed Jul  1 04:39:01 2009
@@ -27,4 +27,4 @@
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=autodie
   license: http://dev.perl.org/licenses/
   repository: http://github.com/pfenwick/autodie/tree/master
-version: 2.00
+version: 2.01

Modified: branches/upstream/libautodie-perl/current/lib/Fatal.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/Fatal.pm?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/Fatal.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/Fatal.pm Wed Jul  1 04:39:01 2009
@@ -39,7 +39,7 @@
 use constant MIN_IPC_SYS_SIMPLE_VER => 0.12;
 
 # All the Fatal/autodie modules share the same version number.
-our $VERSION = '2.00';
+our $VERSION = '2.01';
 
 our $Debug ||= 0;
 
@@ -95,6 +95,7 @@
     ':1.999' => [qw(:default)],
     ':1.999_01' => [qw(:default)],
     ':2.00'  => [qw(:default)],
+    ':2.01'  => [qw(:default)],
 
 );
 
@@ -734,8 +735,11 @@
     # the 'unopened' warning class here.  Especially since they
     # then report the wrong line number.
 
+    # Other warnings are disabled because they produce excessive
+    # complaints from smart-match hints under 5.10.1.
+
     my $code = qq[
-        no warnings qw(unopened);
+        no warnings qw(unopened uninitialized numeric);
 
         if (wantarray) {
             my \@results = $call(@argv);

Modified: branches/upstream/libautodie-perl/current/lib/autodie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie.pm?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie.pm Wed Jul  1 04:39:01 2009
@@ -8,7 +8,7 @@
 our $VERSION;
 
 BEGIN {
-    $VERSION = '2.00';
+    $VERSION = '2.01';
 }
 
 use constant ERROR_WRONG_FATAL => q{
@@ -254,7 +254,7 @@
 that no behavorial changes will occur if the C<autodie> module is
 upgraded.
 
-You can enable C<autodie> for all of Perl's built-ins, including
+C<autodie> can be enabled for all of Perl's built-ins, including
 C<system> and C<exec> with:
 
     use autodie qw(:all);
@@ -329,8 +329,8 @@
 =item :void cannot be used with lexical scope
 
 The C<:void> option is supported in L<Fatal>, but not
-C<autodie>.  However you can explicitly disable autodie
-end the end of the current block with C<no autodie>.
+C<autodie>.  To workaround this, C<autodie> may be explicitly disabled until
+the end of the current block with C<no autodie>.
 To disable autodie for only a single function (eg, open)
 use C<no autodie qw(open)>.
 
@@ -348,8 +348,8 @@
 =head1 BUGS
 
 "Used only once" warnings can be generated when C<autodie> or C<Fatal>
-is used with package filehandles (eg, C<FILE>).  It's strongly recommended
-you use scalar filehandles instead.
+is used with package filehandles (eg, C<FILE>).  Scalar filehandles are
+strongly recommended instead.
 
 Under Perl 5.8 only, C<autodie> I<does not> propagate into string C<eval>
 statements, although it can be explicitly enabled inside a string
@@ -402,6 +402,6 @@
 
 See the F<AUTHORS> file for full credits.  The latest version of this
 file can be found at
-L<http://github.com/pfenwick/autodie/tree/AUTHORS> .
+L<http://github.com/pfenwick/autodie/tree/master/AUTHORS> .
 
 =cut

Modified: branches/upstream/libautodie-perl/current/lib/autodie/exception.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/exception.pm?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/exception.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/exception.pm Wed Jul  1 04:39:01 2009
@@ -14,7 +14,7 @@
 
 use if ($] >= 5.010), overload => '~~'  => "matches";
 
-our $VERSION = '2.00';
+our $VERSION = '2.01';
 
 my $PACKAGE = __PACKAGE__;  # Useful to have a scalar for hash keys.
 

Modified: branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm Wed Jul  1 04:39:01 2009
@@ -5,7 +5,7 @@
 use base 'autodie::exception';
 use Carp qw(croak);
 
-our $VERSION = '2.00';
+our $VERSION = '2.01';
 
 my $PACKAGE = __PACKAGE__;
 

Modified: branches/upstream/libautodie-perl/current/lib/autodie/hints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/hints.pm?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/hints.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/hints.pm Wed Jul  1 04:39:01 2009
@@ -3,7 +3,9 @@
 use strict;
 use warnings;
 
-our $VERSION = '2.00';
+use constant PERL58 => ( $] < 5.009 );
+
+our $VERSION = '2.01';
 
 =head1 NAME
 
@@ -79,7 +81,7 @@
 All other return values (including the list of the single zero, and the
 list containing a single empty string) are considered successful.  However,
 real-world code isn't always that easy.  Perhaps the code you're working
-with returns a string containing the word "FAIL" in it upon failure, or a
+with returns a string containing the word "FAIL" upon failure, or a
 two element list containing C<(undef, "human error message")>.  To make
 autodie work with these sorts of subroutines, we have
 the I<hinting interface>.
@@ -94,15 +96,15 @@
 
 A I<hint> is a subroutine or value that is checked against the
 return value of an autodying subroutine.  If the match returns true,
-C<autodie> considers the subroutine have failed.
+C<autodie> considers the subroutine to have failed.
 
 If the hint provided is a subroutine, then C<autodie> will pass
 the complete return value to that subroutine.  If the hint is
 any other value, then C<autodie> will smart-match against the
-value provided.  In Perl 5.8.x, there is no smart-match operator, and as such
+value provided.  In Perl 5.8.x there is no smart-match operator, and as such
 only subroutine hints are supported in these versions.
 
-Hints can be provided for both scalar context and list context.  Note
+Hints can be provided for both scalar and list contexts.  Note
 that an autodying subroutine will never see a void context, as
 C<autodie> always needs to capture the return value for examination.
 Autodying subroutines called in void context act as if they're called
@@ -129,7 +131,7 @@
         # Scalar failures always return zero explicitly:
             {  scalar => '0'  }
 
-        # List failures always return empty list:
+        # List failures always return an empty list:
             {  list => []  }
 
         # List failures return () or (undef) [default expectation]:
@@ -158,7 +160,7 @@
                 scalar => 0,
                 list   => [0],
             }
-	);
+        );
 
 This "in all contexts" construction is very common, and can be
 abbreviated, using the 'fail' key.  This sets both the C<scalar>
@@ -256,7 +258,7 @@
 In addition, you must define a C<AUTODIE_HINTS> subroutine that returns
 a hash-reference containing the hints for your subroutines:
 
-	package Your::Module;
+        package Your::Module;
 
         # We can use the Class::DOES from the CPAN to declare adherence
         # to a role.
@@ -333,11 +335,14 @@
     @_==1 && !$_[0]
 };
 
+use constant SINGLE_TRUE => sub { @_ == 1 and not $_[0] };
+
 use constant DEFAULT_HINTS => {
     scalar => UNDEF_ONLY,
     list   => EMPTY_OR_UNDEF,
 };
 
+
 use constant HINTS_PROVIDER => 'autodie::hints::provider';
 
 use base qw(Exporter);
@@ -347,18 +352,11 @@
 # Only ( undef ) is a strange but possible situation for very
 # badly written code.  It's not supported yet.
 
-# TODO: Ugh, those sub refs look awful!  Give them proper
-# names!
-
 my %Hints = (
-    'File::Copy::copy' => {
-        scalar => sub { not $_[0] },
-        list   => sub { @_ == 1 and not $_[0] }
-    },
-    'File::Copy::move' => {
-        scalar => sub { not $_[0] },
-        list   => sub { @_ == 1 and not $_[0] }
-    },
+    'File::Copy::copy' => { scalar => SINGLE_TRUE, list => SINGLE_TRUE },
+    'File::Copy::move' => { scalar => SINGLE_TRUE, list => SINGLE_TRUE },
+    'File::Copy::cp'   => { scalar => SINGLE_TRUE, list => SINGLE_TRUE },
+    'File::Copy::mv'   => { scalar => SINGLE_TRUE, list => SINGLE_TRUE },
 );
 
 # Start by using Sub::Identify if it exists on this system.
@@ -416,6 +414,9 @@
         no strict 'refs';   ## no critic
 
         if ($package->can('DOES') and $package->DOES(HINTS_PROVIDER) ) {
+            $hints_available = 1;
+        }
+        elsif ( PERL58 and $package->isa(HINTS_PROVIDER) ) {
             $hints_available = 1;
         }
         elsif ( ${"${package}::DOES"}{HINTS_PROVIDER.""} ) {

Modified: branches/upstream/libautodie-perl/current/t/hints.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/hints.t?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/hints.t (original)
+++ branches/upstream/libautodie-perl/current/t/hints.t Wed Jul  1 04:39:01 2009
@@ -13,7 +13,8 @@
 use constant NO_SUCH_FILE  => "this_file_had_better_not_exist";
 use constant NO_SUCH_FILE2 => "this_file_had_better_not_exist_xyzzy";
 
-use constant PERL510 => ( $] >= 5.010 );
+use constant PERL510  => ( $] >= 5.0100 );
+use constant PERL5101 => ( $] >= 5.0101 );
 
 use Hints_test qw(
     fail_on_empty fail_on_false fail_on_undef
@@ -29,14 +30,22 @@
 # Basic hinting tests
 
 is( $hints->sub_fullname(\&copy), 'File::Copy::copy' , "Id: copy" );
-is( $hints->sub_fullname(\&cp),   'File::Copy::copy' , "Id: cp"   );
+is(
+    $hints->sub_fullname(\&cp),
+    PERL5101 ? 'File::Copy::cp' : 'File::Copy::copy' , "Id: cp"
+);
 
 is( $hints->sub_fullname(\&move), 'File::Copy::move' , "Id: move" );
-is( $hints->sub_fullname(\&mv),   'File::Copy::move' , "Id: mv"   );
+is( $hints->sub_fullname(\&mv),
+    PERL5101 ? 'File::Copy::mv' : 'File::Copy::move' , "Id: mv"
+);
 
 if (PERL510) {
     ok( $hints->get_hints_for(\&copy)->{scalar}->(0) ,
         "copy() hints should fail on 0 for scalars."
+    );
+    ok( $hints->get_hints_for(\&copy)->{list}->(0) ,
+        "copy() hints should fail on 0 for lists."
     );
 }
 

Modified: branches/upstream/libautodie-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/pod-coverage.t?rev=39012&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/pod-coverage.t (original)
+++ branches/upstream/libautodie-perl/current/t/pod-coverage.t Wed Jul  1 04:39:01 2009
@@ -34,6 +34,7 @@
                 |load_hints
                 |normalise_hints
                 |sub_fullname
+                |get_code_info
             )$
         }x ],
 });




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