r63744 - in /branches/upstream/libpackage-deprecationmanager-perl/current: Changes INSTALL META.json META.yml Makefile.PL README SIGNATURE dist.ini lib/Package/DeprecationManager.pm t/basic.t t/release-eol.t

ansgar at users.alioth.debian.org ansgar at users.alioth.debian.org
Fri Oct 15 10:40:42 UTC 2010


Author: ansgar
Date: Fri Oct 15 10:40:21 2010
New Revision: 63744

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63744
Log:
[svn-upgrade] new version libpackage-deprecationmanager-perl (0.06)

Modified:
    branches/upstream/libpackage-deprecationmanager-perl/current/Changes
    branches/upstream/libpackage-deprecationmanager-perl/current/INSTALL
    branches/upstream/libpackage-deprecationmanager-perl/current/META.json
    branches/upstream/libpackage-deprecationmanager-perl/current/META.yml
    branches/upstream/libpackage-deprecationmanager-perl/current/Makefile.PL
    branches/upstream/libpackage-deprecationmanager-perl/current/README
    branches/upstream/libpackage-deprecationmanager-perl/current/SIGNATURE
    branches/upstream/libpackage-deprecationmanager-perl/current/dist.ini
    branches/upstream/libpackage-deprecationmanager-perl/current/lib/Package/DeprecationManager.pm
    branches/upstream/libpackage-deprecationmanager-perl/current/t/basic.t
    branches/upstream/libpackage-deprecationmanager-perl/current/t/release-eol.t

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/Changes?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/Changes (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/Changes Fri Oct 15 10:40:21 2010
@@ -1,3 +1,17 @@
+0.06    2010-10-14
+
+- The -ignore parameter now accepts regular expressions as well as package
+  names.
+
+
+0.05    2010-10-14
+
+- Fixed what looked like a bug in -ignore handling, although I couldn't seem
+  to write a test that triggered it.
+
+- Removed hard dep on Test::Warn for the benefit of Moose.
+
+
 0.04    2010-07-14
 
 - A single feature will now warn more than once if each warning consists of a

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/INSTALL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/INSTALL?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/INSTALL (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/INSTALL Fri Oct 15 10:40:21 2010
@@ -38,7 +38,7 @@
 
 ## Documentation
 
-Package-DeprecationManager documentation is available as in POD.
+Package-DeprecationManager documentation is available as POD.
 You can run perldoc from a shell to read the documentation:
 
     % perldoc Package::DeprecationManager

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/META.json?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/META.json (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/META.json Fri Oct 15 10:40:21 2010
@@ -4,7 +4,7 @@
       "Dave Rolsky <autarch at urth.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670",
+   "generated_by" : "Dist::Zilla version 4.102341, CPAN::Meta::Converter version 2.101670",
    "license" : [
       "artistic_2"
    ],
@@ -29,8 +29,7 @@
       "test" : {
          "requires" : {
             "Test::Exception" : 0,
-            "Test::More" : "0.88",
-            "Test::Warn" : 0
+            "Test::More" : "0.88"
          }
       }
    },
@@ -46,6 +45,6 @@
          "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Package-DeprecationManager.git;a=summary"
       }
    },
-   "version" : "0.04"
+   "version" : "0.06"
 }
 

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/META.yml?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/META.yml (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/META.yml Fri Oct 15 10:40:21 2010
@@ -5,11 +5,10 @@
 build_requires:
   Test::Exception: 0
   Test::More: 0.88
-  Test::Warn: 0
 configure_requires:
   ExtUtils::MakeMaker: 6.31
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
+generated_by: 'Dist::Zilla version 4.102341, CPAN::Meta::Converter version 2.101670'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,4 +21,4 @@
 resources:
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Package-DeprecationManager
   repository: git://git.moose.perl.org/Package-DeprecationManager.git
-version: 0.04
+version: 0.06

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/Makefile.PL?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/Makefile.PL (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/Makefile.PL Fri Oct 15 10:40:21 2010
@@ -13,8 +13,7 @@
   'AUTHOR' => 'Dave Rolsky <autarch at urth.org>',
   'BUILD_REQUIRES' => {
     'Test::Exception' => '0',
-    'Test::More' => '0.88',
-    'Test::Warn' => '0'
+    'Test::More' => '0.88'
   },
   'CONFIGURE_REQUIRES' => {
     'ExtUtils::MakeMaker' => '6.31'
@@ -28,7 +27,7 @@
     'Params::Util' => '0',
     'Sub::Install' => '0'
   },
-  'VERSION' => '0.04',
+  'VERSION' => '0.06',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/README?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/README (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/README Fri Oct 15 10:40:21 2010
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Package-DeprecationManager,
-version 0.04:
+version 0.06:
 
   Manage deprecation warnings for your distribution
 

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/SIGNATURE?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/SIGNATURE (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/SIGNATURE Fri Oct 15 10:40:21 2010
@@ -14,18 +14,18 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 6642925d2daf0fb21877330229dc13f2a86470aa Changes
-SHA1 28f8a1c551c9dd430041a21d1054144c77aabb4b INSTALL
+SHA1 92856b6360165fb9b2644a62fcbfa9d774d812cd Changes
+SHA1 e605c1369fca70aef0107226cbf4d5250a02f18c INSTALL
 SHA1 23c628b4a8a36738405ccdacaeb912d2e727b4c0 LICENSE
 SHA1 8290538f0bb62f1c05437cbfe29284f47e4fda41 MANIFEST
-SHA1 129fbf6edb56b2f1ad95c4f6360ccc65a17e152f META.json
-SHA1 30fc3eac3602373311bbf80276a9780ba77d9c86 META.yml
-SHA1 1bd0b7c62f37e3558db55d7d685ef199742c20e0 Makefile.PL
-SHA1 218967da13971956286fc575249e82ae1a910ec6 README
-SHA1 73f213e605e407b0a78905dc9a33ff4dcb669563 dist.ini
-SHA1 7f96800b03152ef2ffe3d8b3d39feb28617ec030 lib/Package/DeprecationManager.pm
-SHA1 3ac28f36eab33352fd9f6e98ab587575dd9af65a t/basic.t
-SHA1 24b525e3c18f37f8022a01ec30de757cefb679ff t/release-eol.t
+SHA1 538d32ff9bbc45d61b14c21bf1c1463d0912dbc7 META.json
+SHA1 90a3b0d967bab745d34fc70f56a5a14b8a371281 META.yml
+SHA1 23ed780c17145ab83e8b8ebb11d5cfe3ea068804 Makefile.PL
+SHA1 d4d7c07eaa72ca3f56d5c082efc39e277cc21990 README
+SHA1 3f06fa8928b09dff6f5af69eae807422be798560 dist.ini
+SHA1 ca9da43e3eb587386d2affd6a5925814a1ab6e9b lib/Package/DeprecationManager.pm
+SHA1 fd4115706b6342bb8e4011cec3bc5bb43802ccf2 t/basic.t
+SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t
 SHA1 961a1e2c92d836c8cad2d34b784cbc75345dec63 t/release-kwalitee.t
 SHA1 455d1dd1867212a665ad5ea4126b572411de300c t/release-no-tabs.t
 SHA1 9433c240fe590bc404ab68ff63984df763e347ed t/release-pod-coverage.t
@@ -33,7 +33,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
-iEYEARECAAYFAkw+BH4ACgkQIgMCsV8qvRJA5gCffn7p7UpQs2974EEOxCA2lD2z
-CF0An2c2Pyx19yTYcUgsib4B4COrJSli
-=mNys
+iEYEARECAAYFAky3XsYACgkQIgMCsV8qvRK8fACgic0EUnW9nSxgPZyhijswTIpv
+faUAoIJFe6HvpltlFGHRSjg5IvJGFRMU
+=t+Q5
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/dist.ini?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/dist.ini (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/dist.ini Fri Oct 15 10:40:21 2010
@@ -2,7 +2,7 @@
 author  = Dave Rolsky <autarch at urth.org>
 copyright_year = 2010
 
-version = 0.04
+version = 0.06
 
 [@Basic]
 
@@ -36,6 +36,5 @@
 [Prereqs / TestRequires]
 Test::Exception = 0
 Test::More      = 0.88
-Test::Warn      = 0
 
 [@Git]

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/lib/Package/DeprecationManager.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/lib/Package/DeprecationManager.pm?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/lib/Package/DeprecationManager.pm (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/lib/Package/DeprecationManager.pm Fri Oct 15 10:40:21 2010
@@ -1,12 +1,13 @@
 package Package::DeprecationManager;
 BEGIN {
-  $Package::DeprecationManager::VERSION = '0.04';
+  $Package::DeprecationManager::VERSION = '0.06';
 }
 
 use strict;
 use warnings;
 
 use Carp qw( croak );
+use List::MoreUtils qw( any );
 use Params::Util qw( _HASH );
 use Sub::Install;
 
@@ -65,7 +66,8 @@
     my $deprecated_at = shift;
     my $ignore        = shift;
 
-    my %ignore = map { $_ => 1 } @{ $ignore || [] };
+    my %ignore = map { $_ => 1 } grep { !ref } @{ $ignore || [] };
+    my @ignore_res = grep {ref} @{ $ignore || [] };
 
     my %warned;
 
@@ -74,13 +76,13 @@
 
         my ( $package, undef, undef, $sub ) = caller(1);
 
-        my $skipped = 0;
+        my $skipped = 1;
+
         if ( keys %ignore ) {
-            while ( defined $package && $ignore{$package} ) {
-                # We want to start two levels back, since we already looked
-                # one level back and found an internal package.
-                $package = caller($skipped++ + 2);
-                $skipped++;
+            while ( defined $package
+                && ( $ignore{$package} || any { $package =~ $_ } @ignore_res )
+                ) {
+                $package = caller( $skipped++ );
             }
         }
 
@@ -113,7 +115,9 @@
 
         $warned{$package}{ $args{feature} }{$msg} = 1;
 
-        local $Carp::CarpLevel = $Carp::CarpLevel + 1 + $skipped;
+        # We skip at least two levels. One for this anon sub, and one for the
+        # sub calling it.
+        local $Carp::CarpLevel = $Carp::CarpLevel + $skipped;
 
         Carp::cluck($msg);
     };
@@ -133,7 +137,7 @@
 
 =head1 VERSION
 
-version 0.04
+version 0.06
 
 =head1 SYNOPSIS
 
@@ -190,13 +194,14 @@
 you don't want to deprecate an entire subroutine, just a certain usage.
 
 You can also provide an optional array reference in the C<-ignore>
-parameter. This is a list of package names to ignore when looking at the stack
-to figure out what code used the deprecated feature. This should be packages
-in your distribution that can appear on the call stack when a deprecated
-feature is used.
+parameter.
+
+The values to be ignored can be package names or regular expressions (made
+with C<qr//>).  Use this to ignore packages in your distribution that can
+appear on the call stack when a deprecated feature is used.
 
 As part of the import process, C<Package::DeprecationManager> will export two
-subroutines into its caller. It proves an C<import()> sub for the caller and a
+subroutines into its caller. It provides an C<import()> sub for the caller and a
 C<deprecated()> sub.
 
 The C<import()> sub allows callers of I<your> class to specify an C<-api_version>
@@ -254,7 +259,7 @@
 
 =head1 AUTHOR
 
-  Dave Rolsky <autarch at urth.org>
+Dave Rolsky <autarch at urth.org>
 
 =head1 COPYRIGHT AND LICENSE
 

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/t/basic.t?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/t/basic.t (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/t/basic.t Fri Oct 15 10:40:21 2010
@@ -3,7 +3,10 @@
 
 use Test::Exception;
 use Test::More;
-use Test::Warn;
+
+use Test::Requires {
+    'Test::Warn' => '0.21',
+};
 
 {
     throws_ok {
@@ -144,7 +147,7 @@
     use Package::DeprecationManager -deprecations => {
         'foo' => '1.00',
         },
-        -ignore => [ 'My::Foo', 'My::Bar' ];
+        -ignore => [ 'My::Package1', 'My::Package2' ];
 
     sub foo {
         deprecated('foo is deprecated');
@@ -152,23 +155,61 @@
 }
 
 {
-    package My::Foo;
+    package Dep2;
+
+    use Package::DeprecationManager -deprecations => {
+        'bar' => '1.00',
+        },
+        -ignore => [ 'My::Package2' ];
+
+    sub bar {
+        deprecated('bar is deprecated');
+    }
+}
+
+{
+    package Dep3;
+
+    use Package::DeprecationManager -deprecations => {
+        'baz' => '1.00',
+        },
+        -ignore => [ qr/My::Package[12]/ ];
+
+    sub baz {
+        deprecated('baz is deprecated');
+    }
+}
+
+{
+    package My::Package1;
 
     sub foo { Dep::foo() }
-}
-
-{
-    package My::Bar;
-
-    sub foo { My::Foo::foo() }
+    sub bar { Dep2::bar() }
+    sub baz { Dep3::baz() }
+}
+
+{
+    package My::Package2;
+
+    sub foo { My::Package1::foo() }
+    sub bar { My::Package1::bar() }
+    sub baz { My::Package1::baz() }
 }
 
 {
     package My::Baz;
 
-    ::warning_like{ My::Bar::foo() }
+    ::warning_like{ My::Package1::bar() }
+        qr/^bar is deprecated at t.basic\.t line \d+/,
+        'deprecation warning for call to My::Package1::bar()';
+
+    ::warning_like{ My::Package2::foo() }
         qr/^foo is deprecated at t.basic\.t line \d+/,
-        'deprecation warning for call to My::Bar::foo()';
+        'deprecation warning for call to My::Package2::foo()';
+
+    ::warning_like{ My::Package1::baz() }
+        qr/^baz is deprecated at t.basic\.t line \d+/,
+        'deprecation warning for call to My::Package2::foo()';
 }
 
 {
@@ -176,9 +217,9 @@
 
     Dep->import( -api_version => '0.8' );
 
-    ::warning_is{ My::Bar::foo() }
-        q{},
-        'no wanrning when calling My::Bar::foo()';
+    ::warning_is{ My::Package2::foo() }
+        q{},
+        'no warning when calling My::Package2::foo()';
 }
 
 done_testing();

Modified: branches/upstream/libpackage-deprecationmanager-perl/current/t/release-eol.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpackage-deprecationmanager-perl/current/t/release-eol.t?rev=63744&op=diff
==============================================================================
--- branches/upstream/libpackage-deprecationmanager-perl/current/t/release-eol.t (original)
+++ branches/upstream/libpackage-deprecationmanager-perl/current/t/release-eol.t Fri Oct 15 10:40:21 2010
@@ -13,4 +13,4 @@
 eval 'use Test::EOL';
 plan skip_all => 'Test::EOL required' if $@;
 
-all_perl_files_ok();
+all_perl_files_ok({ trailing_whitespace => 1 });




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