Hello community,
here is the log from the commit of package perl-Set-Object
checked in at Mon Oct 8 12:28:12 CEST 2007.
--------
--- perl-Set-Object/perl-Set-Object.changes 2007-02-19 11:20:51.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Set-Object/perl-Set-Object.changes 2007-10-08 09:56:57.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Oct 8 09:32:57 CEST 2007 - anicka@suse.cz
+
+- update to 1.22
+ * Sub-classing interface added; it is now much easier to make
+ LSet::Object subclasses that return objects other than more
+ LSet::Objects when subclassing.
+
+-------------------------------------------------------------------
Old:
----
perl-Set-Object-1.21-return_value.diff
Set-Object-1.21.tar.bz2
New:
----
perl-Set-Object-1.22-return_value.diff
Set-Object-1.22.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Set-Object.spec ++++++
--- /var/tmp/diff_new_pack.K13238/_old 2007-10-08 12:28:09.000000000 +0200
+++ /var/tmp/diff_new_pack.K13238/_new 2007-10-08 12:28:09.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package perl-Set-Object (Version 1.21)
+# spec file for package perl-Set-Object (Version 1.22)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,13 +11,13 @@
# norootforbuild
Name: perl-Set-Object
-Version: 1.21
+Version: 1.22
Release: 1
Requires: perl = %{perl_version}
-Autoreqprov: on
+AutoReqProv: on
Group: Development/Libraries/Perl
License: Artistic License
-URL: http://cpan.org/modules/by-module/Set
+Url: http://cpan.org/modules/by-module/Set
Summary: Set of objects
Source0: Set-Object-%{version}.tar.bz2
Patch: %{name}-%{version}-return_value.diff
@@ -56,8 +56,12 @@
%{perl_vendorarch}/Set
%{perl_vendorarch}/auto/Set
/var/adm/perl-modules/%{name}
-
%changelog
+* Mon Oct 08 2007 - anicka@suse.cz
+- update to 1.22
+ * Sub-classing interface added; it is now much easier to make
+ LSet::Object subclasses that return objects other than more
+ LSet::Objects when subclassing.
* Mon Feb 19 2007 - anicka@suse.cz
- update to 1.21
- remove last patch (fixed in upstream, the only change in this
++++++ perl-Set-Object-1.21-return_value.diff -> perl-Set-Object-1.22-return_value.diff ++++++
--- perl-Set-Object/perl-Set-Object-1.21-return_value.diff 2006-07-18 17:40:59.000000000 +0200
+++ /mounts/work_src_done/STABLE/perl-Set-Object/perl-Set-Object-1.22-return_value.diff 2007-10-08 09:55:58.000000000 +0200
@@ -1,6 +1,6 @@
--- Object.xs
+++ Object.xs
-@@ -431,6 +431,7 @@
+@@ -433,6 +433,7 @@
}
i--;
}
++++++ Set-Object-1.21.tar.bz2 -> Set-Object-1.22.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/Changes.pod new/Set-Object-1.22/Changes.pod
--- old/Set-Object-1.21/Changes.pod 2007-02-17 09:01:27.000000000 +0100
+++ new/Set-Object-1.22/Changes.pod 2007-10-08 00:55:33.000000000 +0200
@@ -1,6 +1,20 @@
+=encoding utf8
+
=head1 REVISION HISTORY FOR Set::Object
+=head1 1.22, 8 Oct 2007
+
+=over
+
+=item *
+
+Sub-classing interface added; it is now much easier to make
+LSet::Object subclasses that return objects other than more
+LSet::Objects when subclassing. From Brían Mach Aon Innéirghthe.
+
+=back
+
=head1 1.21, 17 Feb 2007
=over
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/lib/Set/Object/Weak.pm new/Set-Object-1.22/lib/Set/Object/Weak.pm
--- old/Set-Object-1.21/lib/Set/Object/Weak.pm 2007-02-17 08:55:18.000000000 +0100
+++ new/Set-Object-1.22/lib/Set/Object/Weak.pm 2007-10-08 00:49:25.000000000 +0200
@@ -29,6 +29,7 @@
use base qw(Exporter); # my users would hate me otherwise
use vars qw(@ISA @EXPORT_OK);
+use Set::Object qw(blessed);
our @EXPORT_OK = qw(weak_set set);
@@ -79,7 +80,11 @@
=cut
sub set {
- __PACKAGE__->new(@_);
+ my $class = __PACKAGE__;
+ if (blessed $_[0] and $_[0]->isa("Set::Object")) {
+ $class = "Set::Object";
+ }
+ $class->new(@_);
}
1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/lib/Set/Object.pm new/Set-Object-1.22/lib/Set/Object.pm
--- old/Set-Object-1.21/lib/Set/Object.pm 2007-02-17 09:01:40.000000000 +0100
+++ new/Set-Object-1.22/lib/Set/Object.pm 2007-10-08 01:05:34.000000000 +0200
@@ -78,6 +78,13 @@
Return a new CSet::Object filled with C<@members>. You have to
explicitly import this method.
+B: this function is now called as a method
+to return new sets the various methods that return a new set, such as
+C<-E<gt>intersection>, C<-E<gt>union>, etc and their overloaded
+counterparts. The default method always returns CSet::Object
+objects, preserving previous behaviour and not second guessing the
+nature of your derived LSet::Object class.
+
=head2 C
Return a new CSet::Object::Weak, filled with C<@members>. You have
@@ -490,7 +497,7 @@
@EXPORT_OK = qw( ish_int is_int is_string is_double blessed reftype
refaddr is_overloaded is_object is_key set weak_set );
-$VERSION = '1.21';
+$VERSION = '1.22';
bootstrap Set::Object $VERSION;
@@ -505,7 +512,7 @@
croak "Tried to use as_string on something other than a Set::Object"
unless (UNIVERSAL::isa($self, __PACKAGE__));
- 'Set::Object(' . (join ' ', sort { $a cmp $b }
+ ref($self).'(' . (join ' ', sort { $a cmp $b }
$self->members) . ')'
}
@@ -524,7 +531,7 @@
sub union
{
- Set::Object->new
+ $_[0]->set
( map { $_->members() }
grep { UNIVERSAL::isa($_, __PACKAGE__) }
@_ );
@@ -537,7 +544,7 @@
if (ref $_[0]) {
$other = shift;
} else {
- $other = __PACKAGE__->new(shift);
+ $other = $self->set(shift);
}
croak("Tried to form union between Set::Object & "
@@ -551,14 +558,12 @@
sub intersection
{
my $s = shift;
- return Set::Object->new() unless $s;
-
- my $rem = __PACKAGE__->new($s->members);
+ my $rem = $s->set($s->members);
while ($s = shift)
{
if (!ref $s) {
- $s = __PACKAGE__->new($s);
+ $s = $rem->new($s);
}
croak("Tried to form intersection between Set::Object & "
@@ -577,7 +582,7 @@
if (ref $_[0]) {
$s2 = shift;
} else {
- $s2 = __PACKAGE__->new(shift);
+ $s2 = $s1->set(shift);
}
my $r = shift;
if ( $r ) {
@@ -604,9 +609,9 @@
my $s;
if ( $r ) {
- $s = Set::Object->new( grep { !$s1->includes($_) } $s2->members );
+ $s = $s2->set( grep { !$s1->includes($_) } $s2->members );
} else {
- $s = Set::Object->new( grep { !$s2->includes($_) } $s1->members );
+ $s = $s1->set( grep { !$s2->includes($_) } $s1->members );
}
$s;
}
@@ -625,7 +630,7 @@
."`$other'")
if ref $other and not UNIVERSAL::isa($other, __PACKAGE__);
- my $result = Set::Object->new( $self->members() );
+ my $result = $self->set( $self->members() );
$result->invert( $other->members() );
return $result;
@@ -1057,6 +1062,9 @@
}
sub set {
+ if (eval { $_[0]->isa(__PACKAGE__) }) {
+ shift;
+ }
__PACKAGE__->new(@_);
}
sub weak_set {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/MANIFEST new/Set-Object-1.22/MANIFEST
--- old/Set-Object-1.21/MANIFEST 2007-02-17 08:55:18.000000000 +0100
+++ new/Set-Object-1.22/MANIFEST 2007-10-08 00:52:05.000000000 +0200
@@ -25,6 +25,8 @@
t/object/properties.t
t/object/storable.t
t/object/weakref.t
+t/object/SetSubClass.pm
+t/object/set_subclass.t
t/scalar/basic_overload.t
t/scalar/basic.t
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/META.yml new/Set-Object-1.22/META.yml
--- old/Set-Object-1.21/META.yml 2007-02-17 09:05:35.000000000 +0100
+++ new/Set-Object-1.22/META.yml 2007-10-08 01:09:22.000000000 +0200
@@ -1,10 +1,10 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Set-Object
-version: 1.21
+version: 1.22
version_from: lib/Set/Object.pm
installdirs: site
requires:
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30_01
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/t/object/SetSubClass.pm new/Set-Object-1.22/t/object/SetSubClass.pm
--- old/Set-Object-1.21/t/object/SetSubClass.pm 1970-01-01 01:00:00.000000000 +0100
+++ new/Set-Object-1.22/t/object/SetSubClass.pm 2007-10-08 00:52:05.000000000 +0200
@@ -0,0 +1,16 @@
+package SetSubClass;
+use strict;
+use warnings;
+
+use base qw(Set::Object);
+
+sub set {
+ if (eval { $_[0]->isa(__PACKAGE__) }) {
+ shift;
+ }
+ __PACKAGE__->new(@_);
+}
+
+
+
+1; # Magic true value required at end of module
\ No newline at end of file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Set-Object-1.21/t/object/set_subclass.t new/Set-Object-1.22/t/object/set_subclass.t
--- old/Set-Object-1.21/t/object/set_subclass.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Set-Object-1.22/t/object/set_subclass.t 2007-10-08 00:52:05.000000000 +0200
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 4;
+require 't/object/SetSubClass.pm';
+
+
+my $sd1 = SetSubClass::set( 1,2,3,4 );
+my $sd2 = SetSubClass::set(3,4,5,6);
+
+my $union = $sd1->union($sd2);
+isa_ok( $union, 'SetSubClass', "union of SetSubClass with SetSubClass" );
+
+my $intersection = $sd1->intersection($sd2);
+isa_ok( $union, 'SetSubClass', "intersection of SetSubClass with SetSubClass" );
+
+my $difference = $sd1->difference($sd2);
+isa_ok( $difference, 'SetSubClass', "difference of SetSubClass with SetSubClass" );
+
+my $invert = $sd1 / $sd2;
+isa_ok( $invert, 'SetSubClass', "invert of SetSubClass with SetSubClass" );
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org