Hello community, here is the log from the commit of package perl-Safe-Isa for openSUSE:Factory checked in at 2018-04-26 13:37:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Safe-Isa (Old) and /work/SRC/openSUSE:Factory/.perl-Safe-Isa.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "perl-Safe-Isa" Thu Apr 26 13:37:59 2018 rev:7 rq:599890 version:1.000009 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Safe-Isa/perl-Safe-Isa.changes 2017-10-09 19:48:11.387666603 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Safe-Isa.new/perl-Safe-Isa.changes 2018-04-26 13:38:01.200105167 +0200 @@ -1,0 +2,10 @@ +Sun Apr 22 05:56:36 UTC 2018 - coolo@suse.com + +- updated to 1.000009 + see /usr/share/doc/packages/perl-Safe-Isa/Changes + + 1.000009 - 2018-04-21 + - Fix handling of DOES and does (they no longer fall back to isa in most + situations outside of Moo/Moose) + +------------------------------------------------------------------- Old: ---- Safe-Isa-1.000008.tar.gz New: ---- Safe-Isa-1.000009.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Safe-Isa.spec ++++++ --- /var/tmp/diff_new_pack.vn19P8/_old 2018-04-26 13:38:01.740085376 +0200 +++ /var/tmp/diff_new_pack.vn19P8/_new 2018-04-26 13:38:01.740085376 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Safe-Isa # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,11 @@ Name: perl-Safe-Isa -Version: 1.000008 +Version: 1.000009 Release: 0 %define cpan_name Safe-Isa Summary: Call isa, can, does and DOES safely on things that may not be objects -License: Artistic-1.0 or GPL-1.0+ +License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Safe-Isa/ Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz ++++++ Safe-Isa-1.000008.tar.gz -> Safe-Isa-1.000009.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/Changes new/Safe-Isa-1.000009/Changes --- old/Safe-Isa-1.000008/Changes 2017-10-03 03:12:06.000000000 +0200 +++ new/Safe-Isa-1.000009/Changes 2018-04-21 19:13:44.000000000 +0200 @@ -1,5 +1,9 @@ Revision history for Safe-Isa +1.000009 - 2018-04-21 + - Fix handling of DOES and does (they no longer fall back to isa in most + situations outside of Moo/Moose) + 1.000008 - 2017-10-03 - fix scalar/list context handling for $_call_if_can diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/META.json new/Safe-Isa-1.000009/META.json --- old/Safe-Isa-1.000008/META.json 2017-10-03 03:12:18.000000000 +0200 +++ new/Safe-Isa-1.000009/META.json 2018-04-21 19:13:55.000000000 +0200 @@ -4,7 +4,7 @@ "mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 7.3103, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.3501, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -46,10 +46,16 @@ }, "repository" : { "type" : "git", - "url" : "git://git.shadowcat.co.uk/p5sagit/Safe-Isa.git", - "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Safe-Isa.git" + "url" : "https://github.com/p5sagit/Safe-Isa.git", + "web" : "https://github.com/p5sagit/Safe-Isa" } }, - "version" : "1.000008", - "x_serialization_backend" : "JSON::MaybeXS version 1.003009" + "version" : "1.000009", + "x_contributors" : [ + "Karen Etheridge <ether@cpan.org>", + "Matt S Trout <mst@shadowcat.co.uk>", + "Graham Knop <haarg@haarg.org>", + "David Steinbrunner <dsteinbrunner@pobox.com>" + ], + "x_serialization_backend" : "JSON::MaybeXS version 1.004" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/META.yml new/Safe-Isa-1.000009/META.yml --- old/Safe-Isa-1.000008/META.yml 2017-10-03 03:12:18.000000000 +0200 +++ new/Safe-Isa-1.000009/META.yml 2018-04-21 19:13:54.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 7.3103, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.3501, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -23,6 +23,11 @@ perl: '5.006' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Safe-Isa - repository: git://git.shadowcat.co.uk/p5sagit/Safe-Isa.git -version: '1.000008' + repository: https://github.com/p5sagit/Safe-Isa.git +version: '1.000009' +x_contributors: + - 'Karen Etheridge <ether@cpan.org>' + - 'Matt S Trout <mst@shadowcat.co.uk>' + - 'Graham Knop <haarg@haarg.org>' + - 'David Steinbrunner <dsteinbrunner@pobox.com>' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/Makefile.PL new/Safe-Isa-1.000009/Makefile.PL --- old/Safe-Isa-1.000008/Makefile.PL 2017-09-22 01:48:05.000000000 +0200 +++ new/Safe-Isa-1.000009/Makefile.PL 2018-04-21 17:40:34.000000000 +0200 @@ -11,12 +11,15 @@ META_MERGE => { 'meta-spec' => { version => 2 }, dynamic_config => 0, - resources => { + # GitHub mirrors from Shadowcat. We list it so we can get pull requests. + # The canonical repo is: + # r/o: git://git.shadowcat.co.uk/p5sagit/Safe-Isa.git # r/w: p5sagit@git.shadowcat.co.uk:Safe-Isa.git + # web: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Safe-Isa.git repository => { - url => 'git://git.shadowcat.co.uk/p5sagit/Safe-Isa.git', - web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Safe-Isa.git', + url => 'https://github.com/p5sagit/Safe-Isa.git', + web => 'https://github.com/p5sagit/Safe-Isa', type => 'git', }, bugtracker => { @@ -24,6 +27,12 @@ web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Safe-Isa', }, }, + x_contributors => [ # manually added, from git shortlog -e -s -n + 'Karen Etheridge <ether@cpan.org>', + 'Matt S Trout <mst@shadowcat.co.uk>', + 'Graham Knop <haarg@haarg.org>', + 'David Steinbrunner <dsteinbrunner@pobox.com>', + ], }, META_ADD => { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/README new/Safe-Isa-1.000009/README --- old/Safe-Isa-1.000008/README 2017-10-03 03:12:18.000000000 +0200 +++ new/Safe-Isa-1.000009/README 2018-04-21 19:13:55.000000000 +0200 @@ -106,13 +106,16 @@ $maybe_an_object->$_does('Foo'); If called on an object, calls "does" on it and returns the result, - otherwise returns nothing. + otherwise returns nothing. If the "does" method does not exist, returns + nothing rather than failing. $_DOES $maybe_an_object->$_DOES('Foo'); If called on an object, calls "DOES" on it and returns the result, - otherwise returns nothing. + otherwise returns nothing. On perl versions prior to 5.10.0, the built + in core "DOES" method doesn't exist. If the method doesn't exist, this + will fall back to calling "isa" just like the core "DOES" method. $_call_if_object $maybe_an_object->$_call_if_object(method_name => @args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/lib/Safe/Isa.pm new/Safe-Isa-1.000009/lib/Safe/Isa.pm --- old/Safe-Isa-1.000008/lib/Safe/Isa.pm 2017-10-03 03:11:43.000000000 +0200 +++ new/Safe-Isa-1.000009/lib/Safe/Isa.pm 2018-04-21 19:13:19.000000000 +0200 @@ -5,7 +5,7 @@ use Scalar::Util (); use Exporter 5.57 qw(import); -our $VERSION = '1.000008'; +our $VERSION = '1.000009'; our @EXPORT = qw($_call_if_object $_isa $_can $_does $_DOES $_call_if_can); @@ -15,14 +15,13 @@ # we gratuitously break modules like Scalar::Defer, which would be # un-perlish. return unless Scalar::Util::blessed($obj); - return $obj->isa(@_) if lc($method) eq 'does' and not $obj->can($method); return $obj->$method(@_); }; -our ($_isa, $_can, $_does, $_DOES) = map { +our ($_isa, $_can) = map { my $method = $_; sub { my $obj = shift; $obj->$_call_if_object($method => @_) } -} qw(isa can does DOES); +} qw(isa can); our $_call_if_can = sub { my ($obj, $method) = (shift, shift); @@ -30,6 +29,19 @@ return $obj->$method(@_); }; +our $_does = sub { + my $obj = shift; + $obj->$_call_if_can(does => @_); +}; + +our $_DOES = sub { + my $obj = shift; + return unless Scalar::Util::blessed($obj); + return $obj->DOES(@_) + if $obj->can('DOES'); + return $obj->isa(@_); +}; + 1; __END__ @@ -148,14 +160,17 @@ $maybe_an_object->$_does('Foo'); If called on an object, calls C<does> on it and returns the result, otherwise -returns nothing. +returns nothing. If the C<does> method does not exist, returns nothing rather +than failing. =head2 $_DOES $maybe_an_object->$_DOES('Foo'); If called on an object, calls C<DOES> on it and returns the result, otherwise -returns nothing. +returns nothing. On perl versions prior to 5.10.0, the built in core C<DOES> +method doesn't exist. If the method doesn't exist, this will fall back to +calling C<isa> just like the core C<DOES> method. =head2 $_call_if_object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000008/t/safe_does.t new/Safe-Isa-1.000009/t/safe_does.t --- old/Safe-Isa-1.000008/t/safe_does.t 2015-03-15 02:12:50.000000000 +0100 +++ new/Safe-Isa-1.000009/t/safe_does.t 2018-04-21 17:42:41.000000000 +0200 @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 20; { package Foo; sub new { bless({}, $_[0]) } } { package Bar; our @ISA = qw(Foo); sub bar { 1 } sub does { $_[0]->isa($_[1]) } } @@ -36,9 +36,16 @@ ok(eval { $blam->$_DOES('Foo'); 1 }, 'no boom today'); ok(eval { $undef->$_DOES('Foo'); 1 }, 'nor tomorrow either'); +# does should not fall back to isa +ok(!$foo->$_does('Foo'), 'foo !$_does Foo'); +ok($bar->$_does('Foo'), 'bar $_does Foo'); +ok(eval { $blam->$_does('Foo'); 1 }, 'no boom today'); +ok(eval { $undef->$_does('Foo'); 1 }, 'nor tomorrow either'); ok($foo->$_call_if_object(DOES => 'Foo'), 'foo $_call_if_object(DOES => Foo)'); ok($bar->$_call_if_object(DOES => 'Foo'), 'bar $_call_if_object(DOES => Foo)'); ok(eval { $blam->$_call_if_object(DOES => 'Foo'); 1 }, 'no boom today'); ok(eval { $undef->$_call_if_object(DOES => 'Foo'); 1 }, 'nor tomorrow either'); +ok(!eval { $foo->$_call_if_object(does => 'Foo'); 1 }, 'no special DOES handling built into _call_if_object'); +ok(!eval { $foo->$_call_if_object(Does => 'Foo'); 1 }, 'and no handling for wrong case');