r2936 - in /packages/libversion-perl/trunk: Changes META.yml README debian/changelog 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:40:46 UTC 2006


Author: eloy
Date: Mon Jun 12 10:40:45 2006
New Revision: 2936

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=2936
Log:
eloy: new upstream version

Modified:
    packages/libversion-perl/trunk/Changes
    packages/libversion-perl/trunk/META.yml
    packages/libversion-perl/trunk/README
    packages/libversion-perl/trunk/debian/changelog
    packages/libversion-perl/trunk/lib/version.pm
    packages/libversion-perl/trunk/lib/version.pod
    packages/libversion-perl/trunk/t/02derived.t
    packages/libversion-perl/trunk/t/coretests.pm
    packages/libversion-perl/trunk/vperl/vpp.pm
    packages/libversion-perl/trunk/vutil/vxs.pm

Modified: packages/libversion-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/Changes?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/Changes (original)
+++ packages/libversion-perl/trunk/Changes Mon Jun 12 10:40:45 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/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/META.yml?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/META.yml (original)
+++ packages/libversion-perl/trunk/META.yml Mon Jun 12 10:40:45 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/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/README?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/README (original)
+++ packages/libversion-perl/trunk/README Mon Jun 12 10:40:45 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/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/debian/changelog?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/debian/changelog (original)
+++ packages/libversion-perl/trunk/debian/changelog Mon Jun 12 10:40:45 2006
@@ -1,3 +1,9 @@
+libversion-perl (0.64-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Mon, 12 Jun 2006 12:40:03 +0200
+
 libversion-perl (0.63-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libversion-perl/trunk/lib/version.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/lib/version.pm?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/lib/version.pm (original)
+++ packages/libversion-perl/trunk/lib/version.pm Mon Jun 12 10:40:45 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/trunk/lib/version.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/lib/version.pod?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/lib/version.pod (original)
+++ packages/libversion-perl/trunk/lib/version.pod Mon Jun 12 10:40:45 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/trunk/t/02derived.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/t/02derived.t?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/t/02derived.t (original)
+++ packages/libversion-perl/trunk/t/02derived.t Mon Jun 12 10:40:45 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/trunk/t/coretests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/t/coretests.pm?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/t/coretests.pm (original)
+++ packages/libversion-perl/trunk/t/coretests.pm Mon Jun 12 10:40:45 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/trunk/vperl/vpp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/vperl/vpp.pm?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/vperl/vpp.pm (original)
+++ packages/libversion-perl/trunk/vperl/vpp.pm Mon Jun 12 10:40:45 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/trunk/vutil/vxs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/trunk/vutil/vxs.pm?rev=2936&op=diff
==============================================================================
--- packages/libversion-perl/trunk/vutil/vxs.pm (original)
+++ packages/libversion-perl/trunk/vutil/vxs.pm Mon Jun 12 10:40:45 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