r2934 - in /packages/libversion-perl/branches/upstream/current:
Changes
META.yml README lib/version.pm lib/version.pod t/02derived.t t/coretests.pm
vperl/vpp.pm vutil/vxs.pm
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Mon Jun 12 10:39:45 UTC 2006
Author: eloy
Date: Mon Jun 12 10:39:44 2006
New Revision: 2934
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=2934
Log:
Load /tmp/tmp.hNvYZ14403/libversion-perl-0.64 into
packages/libversion-perl/branches/upstream/current.
Modified:
packages/libversion-perl/branches/upstream/current/Changes
packages/libversion-perl/branches/upstream/current/META.yml
packages/libversion-perl/branches/upstream/current/README
packages/libversion-perl/branches/upstream/current/lib/version.pm
packages/libversion-perl/branches/upstream/current/lib/version.pod
packages/libversion-perl/branches/upstream/current/t/02derived.t
packages/libversion-perl/branches/upstream/current/t/coretests.pm
packages/libversion-perl/branches/upstream/current/vperl/vpp.pm
packages/libversion-perl/branches/upstream/current/vutil/vxs.pm
Modified: packages/libversion-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/Changes?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/Changes (original)
+++ packages/libversion-perl/branches/upstream/current/Changes Mon Jun 12 10:39:44 2006
@@ -1,3 +1,22 @@
+jpeacock r6491):
+
+ Bump version in preparation for release to CPAN as 0.64.
+
+jpeacock r6430):
+
+ As it turns out, the import() method *can* be inherited and DTRT.
+ POD adjusted to reflect the current reality.
+
+jpeacock r6429):
+
+ Based on a suggestion by David Wheeler, test for already exported qv() in a
+ more inheritance friendly fashion.
+
+ Create a way to call the base import() from a subclass and have it DTRT and
+ provide documentation for doing so.
+
+ Ready to release to CPAN as 0.63_01.
+
jpeacock r6370):
Release to CPAN as 0.63 (no really!).
Modified: packages/libversion-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/META.yml?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/META.yml (original)
+++ packages/libversion-perl/branches/upstream/current/META.yml Mon Jun 12 10:39:44 2006
@@ -1,6 +1,6 @@
---
name: version
-version: 0.63
+version: 0.64
author: ~
abstract: ~
license: perl
@@ -10,8 +10,8 @@
provides:
version:
file: lib/version.pm
- version: 0.63
+ version: 0.64
version::vxs:
file: vutil/vxs.pm
- version: 0.63
+ version: 0.64
generated_by: Module::Build version 0.2611
Modified: packages/libversion-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/README?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/README (original)
+++ packages/libversion-perl/branches/upstream/current/README Mon Jun 12 10:39:44 2006
@@ -1,4 +1,4 @@
-version 0.63
+version 0.64
==================================
Provides the same version objects as included in Perl v5.9.x (and hopefully in
@@ -10,16 +10,17 @@
order to get the current changes (the CPAN release has no effect in
bleadperl).
+Major changes in 0.64 - 2006-06-08
+=====================================
+Change test for already-exported qv() to work better under inheritance.
+Test and document that import() can be inherited by subclasses of version
+and still export qv() to the caller appropriately.
+
Major changes in 0.63 - 2006-05-27
=====================================
Fix RT#19517 - need to special case the string 'undef' as being equivalent
to an undef version (0.000), so that EU::MM doesn't freak out. Prevent
warnings when initializing with undef or no initializer at all.
-
-Major changes in 0.61 - 2006-05-23
-=====================================
-Include better ppperl.h as well as avoid re-exporting qv() if version.pm
-use'd more than once.
Please read the POD documentation for usage/details. See the CHANGES file
for full details of all changes to the module behavior.
Modified: packages/libversion-perl/branches/upstream/current/lib/version.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/lib/version.pm?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/lib/version.pm (original)
+++ packages/libversion-perl/branches/upstream/current/lib/version.pm Mon Jun 12 10:39:44 2006
@@ -6,7 +6,7 @@
use vars qw(@ISA $VERSION $CLASS *qv);
-$VERSION = 0.63;
+$VERSION = 0.64;
$CLASS = 'version';
@@ -24,13 +24,13 @@
# Preloaded methods go here.
sub import {
- my ($class, @args) = @_;
+ my ($class) = @_;
my $callpkg = caller();
no strict 'refs';
*{$callpkg."::qv"} =
sub {return bless version::qv(shift), $class }
- unless $callpkg->can('qv');
+ unless defined(&{"$callpkg\::qv"});
}
Modified: packages/libversion-perl/branches/upstream/current/lib/version.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/lib/version.pod?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/lib/version.pod (original)
+++ packages/libversion-perl/branches/upstream/current/lib/version.pod Mon Jun 12 10:39:44 2006
@@ -314,6 +314,19 @@
must be quoted to be converted properly. For this reason, it is strongly
recommended that all initializers to qv() be quoted strings instead of
bare numbers.
+
+To prevent the C<qv()> function from being exported to the caller's namespace,
+either use version with a null parameter:
+
+ use version ();
+
+or just require version, like this:
+
+ require version;
+
+Both methods will prevent the import() method from firing and exporting the
+C<qv()> sub. This is true of subclasses of version as well, see
+L<SUBCLASSING> for details.
=back
@@ -626,14 +639,10 @@
See also L<version::AlphaBeta> on CPAN for an alternate representation of
version strings.
-B<NOTE:> the L<qv> operator is not a class method and will not be inherited
-in the same way as the other methods. L<qv> will always return an object of
-type L<version> and not an object in the derived class. If you need to
-have L<qv> return an object in your derived class, add something like this:
-
- *::qv = sub { return bless version::qv(shift), __PACKAGE__ };
-
-as seen in the test file F<t/02derived.t>.
+B<NOTE:> Although the L<qv> operator is not a true class method, but rather a
+function exported into the caller's namespace, a subclass of version will
+inherit an import() function which will perform the correct magic on behalf
+of the subclass.
=head1 EXPORT
Modified: packages/libversion-perl/branches/upstream/current/t/02derived.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/t/02derived.t?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/t/02derived.t (original)
+++ packages/libversion-perl/branches/upstream/current/t/02derived.t Mon Jun 12 10:39:44 2006
@@ -18,8 +18,10 @@
package version::Empty;
use base 'version';
{
+ # have to do this because import() will not get called
local $^W;
- *main::qv = sub {return bless version::qv(shift), __PACKAGE__};
+ *{caller()."\::qv"} =
+ sub {return bless version::qv(shift), __PACKAGE__};
}
package version::Bad;
Modified: packages/libversion-perl/branches/upstream/current/t/coretests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/t/coretests.pm?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/t/coretests.pm (original)
+++ packages/libversion-perl/branches/upstream/current/t/coretests.pm Mon Jun 12 10:39:44 2006
@@ -400,6 +400,20 @@
unlink 'www.pm';
}
+ open F, ">vvv.pm" or die "Cannot open vvv.pm: $!\n";
+ print F <<"EOF";
+package vvv;
+use base qw(version);
+1;
+EOF
+ close F;
+ # need to eliminate any other qv()'s
+ undef *main::qv;
+ ok(!defined(&{"main\::qv"}), "make sure we cleared qv() properly");
+ eval "use lib '.'; use vvv;";
+ ok(defined(&{"main\::qv"}), "make sure we exported qv() properly");
+ isa_ok( qv(1.2), "vvv");
+ unlink 'vvv.pm';
}
1;
Modified: packages/libversion-perl/branches/upstream/current/vperl/vpp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vperl/vpp.pm?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vperl/vpp.pm (original)
+++ packages/libversion-perl/branches/upstream/current/vperl/vpp.pm Mon Jun 12 10:39:44 2006
@@ -4,7 +4,7 @@
use Scalar::Util;
use vars qw ($VERSION @ISA @REGEXS);
-$VERSION = 0.63;
+$VERSION = 0.64;
push @REGEXS, qr/
^v? # optional leading 'v'
@@ -27,7 +27,7 @@
if ( not defined $value or $value =~ /^undef$/ ) {
# RT #19517 - special case for undef comparison
- # oops, someone forgot to pass a value (shouldn't happen)
+ # or someone forgot to pass a value
push @{$self->{version}}, 0;
return ($self);
}
Modified: packages/libversion-perl/branches/upstream/current/vutil/vxs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vutil/vxs.pm?rev=2934&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vutil/vxs.pm (original)
+++ packages/libversion-perl/branches/upstream/current/vutil/vxs.pm Mon Jun 12 10:39:44 2006
@@ -9,7 +9,7 @@
@ISA = qw(DynaLoader);
-$VERSION = 0.63;
+$VERSION = 0.64;
$CLASS = 'version::vxs';
More information about the Pkg-perl-cvs-commits
mailing list