Hello community, here is the log from the commit of package perl-Role-Tiny for openSUSE:Factory checked in at 2016-11-10 13:27:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Role-Tiny (Old) and /work/SRC/openSUSE:Factory/.perl-Role-Tiny.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Role-Tiny" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Role-Tiny/perl-Role-Tiny.changes 2016-05-12 09:33:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Role-Tiny.new/perl-Role-Tiny.changes 2016-11-10 13:27:33.000000000 +0100 @@ -1,0 +2,11 @@ +Tue Nov 1 07:11:18 UTC 2016 - [email protected] + +- updated to 2.000004 + see /usr/share/doc/packages/perl-Role-Tiny/Changes + + 2.000004 - 2016-10-31 + - Fix consuming stubs from roles (RT#116674). + - Fix error message when applying conflicting roles to an object. + - Drop prerequisite on MRO::Compat on perl 5.8. + +------------------------------------------------------------------- Old: ---- Role-Tiny-2.000003.tar.gz New: ---- Role-Tiny-2.000004.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Role-Tiny.spec ++++++ --- /var/tmp/diff_new_pack.om6whn/_old 2016-11-10 13:27:33.000000000 +0100 +++ /var/tmp/diff_new_pack.om6whn/_new 2016-11-10 13:27:33.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Role-Tiny -Version: 2.000003 +Version: 2.000004 Release: 0 %define cpan_name Role-Tiny Summary: Roles. Like a nouvelle cuisine portion size slice of Moose ++++++ Role-Tiny-2.000003.tar.gz -> Role-Tiny-2.000004.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/Changes new/Role-Tiny-2.000004/Changes --- old/Role-Tiny-2.000003/Changes 2016-04-22 00:03:16.000000000 +0200 +++ new/Role-Tiny-2.000004/Changes 2016-10-31 22:22:29.000000000 +0100 @@ -1,5 +1,10 @@ Revision history for Role-Tiny +2.000004 - 2016-10-31 + - Fix consuming stubs from roles (RT#116674). + - Fix error message when applying conflicting roles to an object. + - Drop prerequisite on MRO::Compat on perl 5.8. + 2.000003 - 2016-04-21 - don't install subs if importing into a package that is already a role. This can happen if the module previously imported Moo::Role. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/MANIFEST new/Role-Tiny-2.000004/MANIFEST --- old/Role-Tiny-2.000003/MANIFEST 2016-04-22 00:03:50.000000000 +0200 +++ new/Role-Tiny-2.000004/MANIFEST 2016-10-31 22:22:49.000000000 +0100 @@ -7,8 +7,6 @@ t/concrete-methods.t t/create-hook.t t/does.t -t/lib/Bar.pm -t/lib/Baz.pm t/lib/BrokenModule.pm t/lib/FalseModule.pm t/lib/TrackLoad.pm @@ -19,9 +17,6 @@ t/role-basic-bugs.t t/role-basic-composition.t t/role-basic-exceptions.t -t/role-basic/lib/My/Does/Basic.pm -t/role-basic/lib/My/Example.pm -t/role-basic/lib/TestMethods.pm t/role-duplication.t t/role-long-package-name.t t/role-tiny-composition.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/META.json new/Role-Tiny-2.000004/META.json --- old/Role-Tiny-2.000003/META.json 2016-04-22 00:03:49.000000000 +0200 +++ new/Role-Tiny-2.000004/META.json 2016-10-31 22:22:49.000000000 +0100 @@ -3,8 +3,8 @@ "author" : [ "mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>" ], - "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", + "dynamic_config" : 0, + "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -60,5 +60,7 @@ }, "x_IRC" : "irc://irc.perl.org/#moose" }, - "version" : "2.000003" + "version" : "2.000004", + "x_serialization_backend" : "JSON::PP version 2.27300", + "x_static_install" : 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/META.yml new/Role-Tiny-2.000004/META.yml --- old/Role-Tiny-2.000003/META.yml 2016-04-22 00:03:49.000000000 +0200 +++ new/Role-Tiny-2.000004/META.yml 2016-10-31 22:22:49.000000000 +0100 @@ -4,8 +4,8 @@ - 'mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>' build_requires: Test::More: '0.88' -dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' +dynamic_config: 0 +generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -25,4 +25,6 @@ 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.000003' +version: '2.000004' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' +x_static_install: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/Makefile.PL new/Role-Tiny-2.000004/Makefile.PL --- old/Role-Tiny-2.000003/Makefile.PL 2015-11-17 12:07:34.000000000 +0100 +++ new/Role-Tiny-2.000004/Makefile.PL 2016-10-18 22:03:17.000000000 +0200 @@ -39,17 +39,15 @@ no_index => { directory => [ 't', 'xt' ] }, + dynamic_config => 0, + x_static_install => 1, ); -my %MM_ARGS = ( - PREREQ_PM => { - ($] >= 5.010 ? () : ('MRO::Compat' => 0)), - }, -); +my %MM_ARGS = (); ## BOILERPLATE ############################################################### require ExtUtils::MakeMaker; -(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; +(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; # have to do this since old EUMM dev releases miss the eval $VERSION line my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/lib/Role/Tiny/With.pm new/Role-Tiny-2.000004/lib/Role/Tiny/With.pm --- old/Role-Tiny-2.000003/lib/Role/Tiny/With.pm 2016-04-22 00:03:11.000000000 +0200 +++ new/Role-Tiny-2.000004/lib/Role/Tiny/With.pm 2016-10-31 22:22:24.000000000 +0100 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '2.000003'; +our $VERSION = '2.000004'; $VERSION = eval $VERSION; use Role::Tiny (); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/lib/Role/Tiny.pm new/Role-Tiny-2.000004/lib/Role/Tiny.pm --- old/Role-Tiny-2.000003/lib/Role/Tiny.pm 2016-04-22 00:03:11.000000000 +0200 +++ new/Role-Tiny-2.000004/lib/Role/Tiny.pm 2016-10-31 22:22:24.000000000 +0100 @@ -6,7 +6,7 @@ use strict; use warnings; -our $VERSION = '2.000003'; +our $VERSION = '2.000004'; $VERSION = eval $VERSION; our %INFO; @@ -19,7 +19,6 @@ BEGIN { *_WORK_AROUND_BROKEN_MODULE_STATE = "$]" < 5.009 ? sub(){1} : sub(){0}; - *_MRO_MODULE = "$]" < 5.010 ? sub(){"MRO/Compat.pm"} : sub(){"mro.pm"}; } sub croak { @@ -162,8 +161,6 @@ croak "${role} is not a Role::Tiny" unless $me->is_role($role); } - require(_MRO_MODULE); - my $composite_info = $me->_composite_info_for(@roles); my %conflicts = %{$composite_info->{conflicts}}; if (keys %conflicts) { @@ -171,7 +168,7 @@ join "\n", map { "Method name conflict for '$_' between roles " - ."'".join(' and ', sort values %{$conflicts{$_}})."'" + ."'".join("' and '", sort values %{$conflicts{$_}})."'" .", cannot apply these simultaneously to an object." } keys %conflicts; croak $fail; @@ -345,8 +342,9 @@ my $not_methods = { reverse %{$info->{not_methods}||{}} }; $info->{methods} ||= +{ # grab all code entries that aren't in the not_methods list - map { - my $code = *{$stash->{$_}}{CODE}; + map {; + no strict 'refs'; + my $code = exists &{"${role}::$_"} ? \&{"${role}::$_"} : undef; ( ! $code or exists $not_methods->{$code} ) ? () : ($_ => $code) } grep !ref($stash->{$_}), keys %$stash }; @@ -456,8 +454,7 @@ sub does_role { my ($proto, $role) = @_; - require(_MRO_MODULE); - foreach my $class (@{mro::get_linear_isa(ref($proto)||$proto)}) { + foreach my $class (@{_get_isa(ref($proto)||$proto)}) { return 1 if exists $APPLIED_TO{$class}{$role}; } return 0; @@ -468,6 +465,30 @@ return !!($INFO{$role} && ($INFO{$role}{is_role} || $INFO{$role}{not_methods})); } +sub _get_isa ($;$) { + no warnings 'redefine'; + if ("$]" >= 5.010) { + require mro; + *__get_isa = \&mro::get_linear_isa; + } + else { + *__get_isa = \&__get_linear_isa_dfs; + } + goto &__get_isa; +} + +sub _get_linear_isa_dfs ($;$) { + my @isa = shift; + my @lin; + my %seen; + while (my $class = pop @isa) { + push @lin, $class; + no strict 'refs'; + push @isa, grep !$seen{$_}++, reverse @{$class.'::ISA'}; + } + return \@lin; +} + 1; __END__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/maint/Makefile.PL.include new/Role-Tiny-2.000004/maint/Makefile.PL.include --- old/Role-Tiny-2.000003/maint/Makefile.PL.include 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/maint/Makefile.PL.include 2016-09-14 23:03:12.000000000 +0200 @@ -7,6 +7,4 @@ author 'mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>'; -manifest_include 't/role-basic' => qr/.*\.pm$/; - 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/lib/Bar.pm new/Role-Tiny-2.000004/t/lib/Bar.pm --- old/Role-Tiny-2.000003/t/lib/Bar.pm 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/t/lib/Bar.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -package Bar; - -sub new { bless {} => shift } -sub bar { 1 } - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/lib/Baz.pm new/Role-Tiny-2.000004/t/lib/Baz.pm --- old/Role-Tiny-2.000003/t/lib/Baz.pm 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/t/lib/Baz.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -package Baz; - -use Role::Tiny; - -sub baz { 1 } - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic/lib/My/Does/Basic.pm new/Role-Tiny-2.000004/t/role-basic/lib/My/Does/Basic.pm --- old/Role-Tiny-2.000003/t/role-basic/lib/My/Does/Basic.pm 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic/lib/My/Does/Basic.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -package My::Does::Basic; - -use Role::Tiny; - -requires 'turbo_charger'; - -sub no_conflict { - return "My::Does::Basic::no_conflict"; -} - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic/lib/My/Example.pm new/Role-Tiny-2.000004/t/role-basic/lib/My/Example.pm --- old/Role-Tiny-2.000003/t/role-basic/lib/My/Example.pm 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic/lib/My/Example.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -package My::Example; - -use Role::Tiny 'with'; - -with 'My::Does::Basic'; - -sub new { bless {} => shift } - -sub turbo_charger {} -$My::Example::foo = 1; -sub foo() {} - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic/lib/TestMethods.pm new/Role-Tiny-2.000004/t/role-basic/lib/TestMethods.pm --- old/Role-Tiny-2.000003/t/role-basic/lib/TestMethods.pm 2015-01-30 06:36:04.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic/lib/TestMethods.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,23 +0,0 @@ -package TestMethods; - -use strict; -use warnings; - -sub import { - my ( $class, @methods ) = @_; - my $target = caller; - - foreach my $method (@methods) { - my $fq_method = $target . "::$method"; - no strict 'refs'; - *$fq_method = sub { - local *__ANON__ = "__ANON__$fq_method"; - my $self = shift; - return $self->{$method} unless @_; - $self->{$method} = shift; - return $self; - }; - } -} - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic-basic.t new/Role-Tiny-2.000004/t/role-basic-basic.t --- old/Role-Tiny-2.000003/t/role-basic-basic.t 2015-03-31 06:44:26.000000000 +0200 +++ new/Role-Tiny-2.000004/t/role-basic-basic.t 2016-09-14 22:58:40.000000000 +0200 @@ -1,7 +1,34 @@ use strict; use warnings; use Test::More; -use lib 't/role-basic/lib'; + +BEGIN { + package My::Does::Basic; + $INC{'My/Does/Basic.pm'} = 1; + + use Role::Tiny; + + requires 'turbo_charger'; + + sub no_conflict { + return "My::Does::Basic::no_conflict"; + } +} + +BEGIN { + package My::Example; + $INC{'My/Example.pm'} = 1; + + use Role::Tiny 'with'; + + with 'My::Does::Basic'; + + sub new { bless {} => shift } + + sub turbo_charger {} + $My::Example::foo = 1; + sub foo() {} +} use My::Example; can_ok 'My::Example', 'no_conflict'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic-bugs.t new/Role-Tiny-2.000004/t/role-basic-bugs.t --- old/Role-Tiny-2.000003/t/role-basic-bugs.t 2015-11-16 02:34:32.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic-bugs.t 2016-09-14 23:02:41.000000000 +0200 @@ -1,6 +1,5 @@ use strict; use warnings; -use lib 't/role-basic/lib', 't/lib'; use Test::More; # multiple roles with the same role @@ -81,5 +80,22 @@ ::ok(Role::Tiny::does_role($object, 'Role2'), 'Role2 consumed'); } +BEGIN { + package Bar; + $INC{'Bar.pm'} = __FILE__; + + sub new { bless {} => shift } + sub bar { 1 } +} +BEGIN { + package Baz; + $INC{'Baz.pm'} = __FILE__; + + use Role::Tiny; + + sub baz { 1 } +} + can_ok(Role::Tiny->create_class_with_roles(qw(Bar Baz))->new, qw(bar baz)); + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic-composition.t new/Role-Tiny-2.000004/t/role-basic-composition.t --- old/Role-Tiny-2.000003/t/role-basic-composition.t 2015-02-23 21:29:22.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic-composition.t 2016-09-14 23:02:46.000000000 +0200 @@ -1,6 +1,5 @@ use strict; use warnings; -use lib 't/role-basic/lib'; use Test::More; require Role::Tiny; @@ -79,11 +78,29 @@ ok !$object->Role::Tiny::does_role('My::Does::Basic1'), '... but not roles which it never consumed'; + +{ + package GenAccessors; + BEGIN { $INC{'GenAccessors.pm'} = __FILE__ } + + sub import { + my ( $class, @methods ) = @_; + my $target = caller; + + foreach my $method (@methods) { + no strict 'refs'; + *{"${target}::${method}"} = sub { + @_ > 1 ? $_[0]->{$method} = $_[1] : $_[0]->{$method}; + }; + } + } +} + { { package Role::Which::Imports; - use Role::Tiny allow => 'TestMethods'; - use TestMethods qw(this that); + use Role::Tiny; + use GenAccessors qw(this that); } { package Class::With::ImportingRole; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-basic-exceptions.t new/Role-Tiny-2.000004/t/role-basic-exceptions.t --- old/Role-Tiny-2.000003/t/role-basic-exceptions.t 2015-02-23 21:29:22.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-basic-exceptions.t 2016-09-14 23:02:50.000000000 +0200 @@ -1,6 +1,5 @@ use strict; use warnings; -use lib 't/role-basic/lib'; use Test::More; require Role::Tiny; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-tiny-composition.t new/Role-Tiny-2.000004/t/role-tiny-composition.t --- old/Role-Tiny-2.000003/t/role-tiny-composition.t 2015-11-14 08:19:52.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-tiny-composition.t 2016-10-31 06:54:29.000000000 +0100 @@ -29,7 +29,9 @@ eval { Role::Tiny->apply_roles_to_object(X->new, "R1", "R2") }; like $@, - qr/^Method name conflict for 'foo' between roles 'R. and R2., cannot apply these simultaneously to an object/, + qr/^Method name conflict for 'foo' between roles 'R1' and 'R2', cannot apply these simultaneously to an object/, 'apply conflicting roles to object'; + + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-tiny-with.t new/Role-Tiny-2.000004/t/role-tiny-with.t --- old/Role-Tiny-2.000003/t/role-tiny-with.t 2015-02-23 21:29:22.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-tiny-with.t 2016-09-07 00:56:58.000000000 +0200 @@ -29,4 +29,27 @@ is(MyClass->bar, 'role bar', 'method from role'); is(MyClass->baz, 'class baz', 'method from class'); +BEGIN { + package RoleWithStub; + + use Role::Tiny; + + sub foo { 'role foo' } + + sub bar ($$); +} + +{ + package ClassConsumeStub; + use Role::Tiny::With; + + eval { + with 'RoleWithStub'; + }; +} + +is $@, '', 'stub composed without error'; +ok exists &ClassConsumeStub::bar && !defined &ClassConsumeStub::bar, + 'stub exists in consuming class'; + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Role-Tiny-2.000003/t/role-with-inheritance.t new/Role-Tiny-2.000004/t/role-with-inheritance.t --- old/Role-Tiny-2.000003/t/role-with-inheritance.t 2015-02-23 21:29:22.000000000 +0100 +++ new/Role-Tiny-2.000004/t/role-with-inheritance.t 2016-10-31 08:38:06.000000000 +0100 @@ -27,4 +27,15 @@ ok Role::Tiny::does_role('C2','R1'), "Child does base's role"; ok Role::Tiny::does_role('C2','R2'), "Child does own role"; +{ + package C3; + our @ISA = qw(C1); +} +{ + package C4; + our @ISA = qw(C2 C3); +} +is_deeply Role::Tiny::_get_linear_isa_dfs('C4'), ['C4', 'C2', 'C1', 'C3'], + 'dfs isa search is accurate'; + done_testing();
