r28560 - in /branches/upstream/libclass-c3-adopt-next-perl/current: Changes MANIFEST META.yml README inc/Module/Install/ExtraTests.pm lib/Class/C3/Adopt/NEXT.pm t/import.t
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Tue Dec 23 11:43:05 UTC 2008
Author: eloy
Date: Tue Dec 23 11:42:56 2008
New Revision: 28560
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28560
Log:
[svn-upgrade] Integrating new upstream version, libclass-c3-adopt-next-perl (0.05)
Added:
branches/upstream/libclass-c3-adopt-next-perl/current/t/import.t
Modified:
branches/upstream/libclass-c3-adopt-next-perl/current/Changes
branches/upstream/libclass-c3-adopt-next-perl/current/MANIFEST
branches/upstream/libclass-c3-adopt-next-perl/current/META.yml
branches/upstream/libclass-c3-adopt-next-perl/current/README
branches/upstream/libclass-c3-adopt-next-perl/current/inc/Module/Install/ExtraTests.pm
branches/upstream/libclass-c3-adopt-next-perl/current/lib/Class/C3/Adopt/NEXT.pm
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/Changes?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/Changes (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/Changes Tue Dec 23 11:42:56 2008
@@ -1,3 +1,10 @@
+0.05 Sat, 20 Dec 2008 16:04:48 +0100
+ * Upgrade Module::Install::ExtraTests to 0.006. This makes things work on
+ Win32 again (closes RT#41817).
+ * Update warning to be more eloquent.
+ * Document warnings.
+ * Implement a -no_warn import switch to turn of warnings locally.
+
0.04 Sun, 07 Dec 2008 01:11:59 +0100
* Install our hacked version of NEXT::AUTOLOAD into NEXT::ACTUAL::AUTOLOAD
too. This makes us work with NEXT 0.61, which doesn't do all of its magic
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/MANIFEST?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/MANIFEST (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/MANIFEST Tue Dec 23 11:42:56 2008
@@ -15,6 +15,7 @@
README
t/basic.t
t/disable.t
+t/import.t
t/incompatible.t
t/lib/C3NT.pm
t/lib/C3NT_nowarn.pm
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/META.yml?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/META.yml (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/META.yml Tue Dec 23 11:42:56 2008
@@ -20,4 +20,4 @@
NEXT: 0
resources:
license: http://dev.perl.org/licenses/
-version: 0.04
+version: 0.05
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/README?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/README (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/README Tue Dec 23 11:42:56 2008
@@ -5,12 +5,15 @@
package MyApp::Plugin::FooBar;
#use NEXT;
use Class::C3::Adopt::NEXT;
+ # or 'use Class::C3::Adopt::NEXT' -no_warn to suppress warning
sub a_method {
my ($self) = @_;
# Do some stuff
# Re-dispatch method
+ # Note that this will generate a warning the _first_ time the package
+ # uses NEXT unless you un comment the 'no warnings' line above.
$self->NEXT::method();
}
@@ -30,6 +33,11 @@
then write new code without "NEXT", and migrate individual source files
to use "Class::C3" or method modifiers as appropriate, at whatever pace
you're comfortable with.
+
+WARNINGS
+ This module will warn once for each package using NEXT. It uses
+ warnings::register, and so can be disabled like by adding "no warnings
+ 'Class::C3::Adopt::NEXT';" to each package which generates a warning.
MIGRATING
There are two main reasons for using NEXT:
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/inc/Module/Install/ExtraTests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/inc/Module/Install/ExtraTests.pm?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/inc/Module/Install/ExtraTests.pm (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/inc/Module/Install/ExtraTests.pm Tue Dec 23 11:42:56 2008
@@ -6,7 +6,7 @@
use Module::Install::Base;
BEGIN {
- our $VERSION = '0.004';
+ our $VERSION = '0.006';
our $ISCORE = 1;
our @ISA = qw{Module::Install::Base};
}
@@ -35,7 +35,7 @@
my $is_author = $Module::Install::AUTHOR ? 1 : 0;
return qq{\t$perl "-Iinc" "-MModule::Install::ExtraTests" }
- . qq["-e" "Module::Install::ExtraTests::__harness('Test::Harness', (exists \\\$\$ENV{AUTHOR_TESTING} ? \\\$\$ENV{AUTHOR_TESTING} : $is_author), '$a_str', '$r_str', '$s_str', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n];
+ . qq{"-e" "Module::Install::ExtraTests::__harness('Test::Harness', $is_author, '$a_str', '$r_str', '$s_str', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
}
sub dist_test {
@@ -66,7 +66,7 @@
# out on the command line can blow over its exec limit.
require ExtUtils::Command;
push @ARGV, __PACKAGE__->_deep_t($author_tests)
- if $author_tests and $is_author;
+ if $author_tests and (exists $ENV{AUTHOR_TESTING} ? $ENV{AUTHOR_TESTING} : $is_author);
push @ARGV, __PACKAGE__->_deep_t($release_tests)
if $release_tests and $ENV{RELEASE_TESTING};
Modified: branches/upstream/libclass-c3-adopt-next-perl/current/lib/Class/C3/Adopt/NEXT.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/lib/Class/C3/Adopt/NEXT.pm?rev=28560&op=diff
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/lib/Class/C3/Adopt/NEXT.pm (original)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/lib/Class/C3/Adopt/NEXT.pm Tue Dec 23 11:42:56 2008
@@ -7,7 +7,7 @@
use MRO::Compat;
use warnings::register;
-our $VERSION = '0.04';
+our $VERSION = '0.05';
{
my %c3_mro_ok;
@@ -38,7 +38,8 @@
if (length $c3_mro_ok{$class} && $c3_mro_ok{$class}) {
unless ($warned_for{$class}) {
- warnings::warnif("${class} is trying to use NEXT, which is crap. use Class::C3 or Moose method modifiers instead.");
+ warnings::warnif("${class} is trying to use NEXT, which is deprecated. "
+ . "Please see the Class::C3::Adopt::NEXT documentation for details");
$warned_for{$class} = 1;
}
}
@@ -55,6 +56,16 @@
*NEXT::ACTUAL::AUTOLOAD = \&NEXT::AUTOLOAD;
}
+ sub import {
+ my ($class, @args) = @_;
+ my $target = caller();
+
+ for my $arg (@args) {
+ $warned_for{$target} = 1
+ if $arg eq '-no_warn';
+ }
+ }
+
sub unimport {
my $class = shift;
@c3_mro_ok{@_} = ('') x @_;
@@ -74,12 +85,15 @@
package MyApp::Plugin::FooBar;
#use NEXT;
use Class::C3::Adopt::NEXT;
+ # or 'use Class::C3::Adopt::NEXT' -no_warn to suppress warning
sub a_method {
my ($self) = @_;
# Do some stuff
# Re-dispatch method
+ # Note that this will generate a warning the _first_ time the package
+ # uses NEXT unless you un comment the 'no warnings' line above.
$self->NEXT::method();
}
@@ -98,6 +112,13 @@
interface, but using L<Class::C3> to do the hard work. You can then write new
code without C<NEXT>, and migrate individual source files to use C<Class::C3> or
method modifiers as appropriate, at whatever pace you're comfortable with.
+
+=head1 WARNINGS
+
+This module will warn once for each package using NEXT. It uses
+L<warnings::register>, and so can be disabled like by adding
+C<no warnings 'Class::C3::Adopt::NEXT';> to each package which generates a
+warning.
=head1 MIGRATING
Added: branches/upstream/libclass-c3-adopt-next-perl/current/t/import.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-c3-adopt-next-perl/current/t/import.t?rev=28560&op=file
==============================================================================
--- branches/upstream/libclass-c3-adopt-next-perl/current/t/import.t (added)
+++ branches/upstream/libclass-c3-adopt-next-perl/current/t/import.t Tue Dec 23 11:42:56 2008
@@ -1,0 +1,28 @@
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+use Class::C3::Adopt::NEXT;
+
+{
+ package BaseClass;
+ sub foo { 42 }
+}
+
+{
+ package Derived;
+
+# no warnings 'Class::C3::Adopt::NEXT';
+ use Class::C3::Adopt::NEXT -no_warn;
+
+ sub foo {
+ return shift->NEXT::foo(@_);
+ }
+}
+
+my @warnings;
+$SIG{__WARN__} = sub { push @warnings, @_ };
+
+Derived->foo;
+
+is(scalar @warnings, 0, '-no_warn disables warnings');
More information about the Pkg-perl-cvs-commits
mailing list