Hello community,
here is the log from the commit of package perl-Role-Tiny for openSUSE:Factory checked in at 2019-11-03 10:37:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Role-Tiny (Old)
and /work/SRC/openSUSE:Factory/.perl-Role-Tiny.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Role-Tiny"
Sun Nov 3 10:37:06 2019 rev:17 rq:743754 version:2.001004
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Role-Tiny/perl-Role-Tiny.changes 2019-10-14 12:32:13.752155107 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Role-Tiny.new.2990/perl-Role-Tiny.changes 2019-11-03 10:37:07.797464736 +0100
@@ -1,0 +2,13 @@
+Mon Oct 28 11:01:38 UTC 2019 -
+
+- updated to 2.001004
+ see /usr/share/doc/packages/perl-Role-Tiny/Changes
+
+ 2.001004 - 2019-10-25
+ - fix methods being excluded from composition if they previously existed in
+ the composing role (RT#130811)
+ - fix role application overwriting subs that are not considered methods
+ - fix helper subs created by a Role::Tiny extension (like Moo::Role)
+ sometimes being teated as methods
+
+-------------------------------------------------------------------
Old:
----
Role-Tiny-2.001003.tar.gz
New:
----
Role-Tiny-2.001004.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Role-Tiny.spec ++++++
--- /var/tmp/diff_new_pack.YvjXri/_old 2019-11-03 10:37:08.249465281 +0100
+++ /var/tmp/diff_new_pack.YvjXri/_new 2019-11-03 10:37:08.249465281 +0100
@@ -17,7 +17,7 @@
Name: perl-Role-Tiny
-Version: 2.001003
+Version: 2.001004
Release: 0
%define cpan_name Role-Tiny
Summary: Roles: a nouvelle cuisine portion size slice of Moose
++++++ Role-Tiny-2.001003.tar.gz -> Role-Tiny-2.001004.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/Changes new/Role-Tiny-2.001004/Changes
--- old/Role-Tiny-2.001003/Changes 2019-10-09 17:39:09.000000000 +0200
+++ new/Role-Tiny-2.001004/Changes 2019-10-25 10:08:58.000000000 +0200
@@ -1,5 +1,12 @@
Revision history for Role-Tiny
+2.001004 - 2019-10-25
+ - fix methods being excluded from composition if they previously existed in
+ the composing role (RT#130811)
+ - fix role application overwriting subs that are not considered methods
+ - fix helper subs created by a Role::Tiny extension (like Moo::Role)
+ sometimes being teated as methods
+
2.001003 - 2019-10-09
- releasing as stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/MANIFEST new/Role-Tiny-2.001004/MANIFEST
--- old/Role-Tiny-2.001003/MANIFEST 2019-10-09 17:39:26.000000000 +0200
+++ new/Role-Tiny-2.001004/MANIFEST 2019-10-25 10:09:14.000000000 +0200
@@ -7,6 +7,7 @@
t/concrete-methods.t
t/create-hook.t
t/does.t
+t/extend-role-tiny.t
t/lib/BrokenModule.pm
t/lib/FalseModule.pm
t/lib/TrackLoad.pm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/META.json new/Role-Tiny-2.001004/META.json
--- old/Role-Tiny-2.001003/META.json 2019-10-09 17:39:25.000000000 +0200
+++ new/Role-Tiny-2.001004/META.json 2019-10-25 10:09:13.000000000 +0200
@@ -60,6 +60,6 @@
},
"x_IRC" : "irc://irc.perl.org/#moose"
},
- "version" : "2.001003",
+ "version" : "2.001004",
"x_serialization_backend" : "JSON::PP version 4.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/META.yml new/Role-Tiny-2.001004/META.yml
--- old/Role-Tiny-2.001003/META.yml 2019-10-09 17:39:25.000000000 +0200
+++ new/Role-Tiny-2.001004/META.yml 2019-10-25 10:09:13.000000000 +0200
@@ -25,5 +25,5 @@
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Role-Tiny
license: http://dev.perl.org/licenses/
repository: git://github.com/moose/Role-Tiny.git
-version: '2.001003'
+version: '2.001004'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/lib/Role/Tiny/With.pm new/Role-Tiny-2.001004/lib/Role/Tiny/With.pm
--- old/Role-Tiny-2.001003/lib/Role/Tiny/With.pm 2019-10-09 17:38:22.000000000 +0200
+++ new/Role-Tiny-2.001004/lib/Role/Tiny/With.pm 2019-10-25 10:08:55.000000000 +0200
@@ -3,7 +3,7 @@
use strict;
use warnings;
-our $VERSION = '2.001003';
+our $VERSION = '2.001004';
$VERSION =~ tr/_//d;
use Role::Tiny ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/lib/Role/Tiny.pm new/Role-Tiny-2.001004/lib/Role/Tiny.pm
--- old/Role-Tiny-2.001003/lib/Role/Tiny.pm 2019-10-09 17:38:22.000000000 +0200
+++ new/Role-Tiny-2.001004/lib/Role/Tiny.pm 2019-10-25 10:08:55.000000000 +0200
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '2.001003';
+our $VERSION = '2.001004';
$VERSION =~ tr/_//d;
our %INFO;
@@ -80,8 +80,26 @@
my $me = shift;
strict->import;
warnings->import;
+ my $non_methods = $me->_non_methods($target);
$me->_install_subs($target, @_);
$me->make_role($target);
+ $me->_mark_new_non_methods($target, $non_methods)
+ if $non_methods && %$non_methods;
+ return;
+}
+
+sub _mark_new_non_methods {
+ my ($me, $target, $old_non_methods) = @_;
+
+ my $non_methods = $INFO{$target}{non_methods};
+
+ my $subs = $me->_all_subs($target);
+ for my $sub (keys %$subs) {
+ if ( exists $old_non_methods->{$sub} && $non_methods->{$sub} != $subs->{$sub} ) {
+ $non_methods->{$sub} = $subs->{$sub};
+ }
+ }
+
return;
}
@@ -330,9 +348,14 @@
};
}
+sub _composable_package_name_for {
+ my ($me, $role) = @_;
+ 'Role::Tiny::_COMPOSABLE::'.$role;
+}
+
sub _composable_package_for {
my ($me, $role) = @_;
- my $composed_name = 'Role::Tiny::_COMPOSABLE::'.$role;
+ my $composed_name = $me->_composable_package_name_for($role);
return $composed_name if $COMPOSED{role}{$composed_name};
$me->_install_methods($composed_name, $role);
my $base_name = $composed_name.'::_BASE';
@@ -433,8 +456,18 @@
my $methods = $me->_concrete_methods_of($role);
my %existing_methods;
- for my $package ($to, grep $_ ne $role, keys %{$APPLIED_TO{$to}}) {
- @existing_methods{keys %{ $me->_concrete_methods_of($package) }} = ();;
+ @existing_methods{keys %{ $me->_all_subs($to) }} = ();
+
+ my $applied_to = $APPLIED_TO{$to};
+ if ($applied_to && %$applied_to) {
+ require(_MRO_MODULE);
+ my %isa = map +($_ => 1), @{mro::get_linear_isa($to)};
+ my @composed =
+ grep $_ ne $role && $isa{$me->_composable_package_name_for($_)},
+ keys %{$APPLIED_TO{$to}};
+ for my $package (@composed) {
+ @existing_methods{keys %{ $me->_concrete_methods_of($package) }} = ();
+ }
}
# _concrete_methods_of caches its result on roles. that cache needs to be
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/t/concrete-methods.t new/Role-Tiny-2.001004/t/concrete-methods.t
--- old/Role-Tiny-2.001003/t/concrete-methods.t 2019-10-06 14:38:51.000000000 +0200
+++ new/Role-Tiny-2.001004/t/concrete-methods.t 2019-10-23 17:01:20.000000000 +0200
@@ -99,4 +99,22 @@
qr/is not a Role::Tiny/,
'methods_provided_by refuses to work on classes';
+{
+ package Look::Out::Here::Comes::A::Role;
+ use Role::Tiny;
+ sub its_a_method { 1 }
+}
+
+{
+ package And::Another::One;
+ sub its_a_method { 2 }
+ use Role::Tiny;
+
+ my @warnings;
+ local $SIG{__WARN__} = sub { push @warnings, @_ };
+ with 'Look::Out::Here::Comes::A::Role';
+ ::is join('', @warnings), '',
+ 'non-methods not overwritten by role composition';
+}
+
done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/t/extend-role-tiny.t new/Role-Tiny-2.001004/t/extend-role-tiny.t
--- old/Role-Tiny-2.001003/t/extend-role-tiny.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Role-Tiny-2.001004/t/extend-role-tiny.t 2019-10-23 17:19:18.000000000 +0200
@@ -0,0 +1,42 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+ package My::Role::Tiny::Extension;
+ $INC{'My/Role/Tiny/Extension.pm'} = __FILE__;
+ use Role::Tiny ();
+ our @ISA = qw(Role::Tiny);
+
+ my %lie;
+
+ sub _install_subs {
+ my $me = shift;
+ my ($role) = @_;
+ local $lie{$role} = 1;
+ $me->SUPER::_install_subs(@_);
+ }
+
+ sub is_role {
+ my ($me, $role) = @_;
+ return 0
+ if $lie{$role};
+ $me->SUPER::is_role($role);
+ }
+}
+
+my @warnings;
+BEGIN {
+ package My::Thing::Using::Extended::Role;
+ My::Role::Tiny::Extension->import;
+ local $SIG{__WARN__} = sub { push @warnings, @_ };
+ My::Role::Tiny::Extension->import;
+}
+
+my $methods = My::Role::Tiny::Extension->_concrete_methods_of('My::Thing::Using::Extended::Role');
+is join(', ', sort keys %$methods), '',
+ 'subs installed when creating a role are not methods';
+
+# there will be warnings but we don't care about them
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/t/role-duplication.t new/Role-Tiny-2.001004/t/role-duplication.t
--- old/Role-Tiny-2.001003/t/role-duplication.t 2017-10-16 17:09:41.000000000 +0200
+++ new/Role-Tiny-2.001004/t/role-duplication.t 2019-10-22 03:07:17.000000000 +0200
@@ -2,15 +2,15 @@
use warnings;
use Test::More;
-{
+BEGIN {
package Role1; use Role::Tiny;
sub foo1 { 1 }
}
-{
+BEGIN {
package Role2; use Role::Tiny;
sub foo2 { 2 }
}
-{
+BEGIN {
package BaseClass;
sub foo { 0 }
}
@@ -25,4 +25,21 @@
like $@, qr/\ADuplicated roles: Role1, Role2 /,
'duplicate roles detected';
+BEGIN {
+ package AnotherRole;
+ use Role::Tiny;
+ with 'Role1';
+}
+
+BEGIN {
+ package AnotherClass;
+ use Role::Tiny::With;
+ with 'AnotherRole';
+ delete $AnotherClass::{foo1};
+ with 'AnotherRole';
+}
+
+ok +AnotherClass->can('foo1'),
+ 'reapplying roles re-adds missing methods';
+
done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.001003/xt/dependents.t new/Role-Tiny-2.001004/xt/dependents.t
--- old/Role-Tiny-2.001003/xt/dependents.t 2019-09-09 11:26:04.000000000 +0200
+++ new/Role-Tiny-2.001004/xt/dependents.t 2019-10-22 10:21:28.000000000 +0200
@@ -47,6 +47,7 @@
'Moo',
'namespace::autoclean',
'Dancer2',
+ 'MooX::Options',
) {
note "Testing $dist ...";