Hello community, here is the log from the commit of package perl-Moo for openSUSE:Factory checked in at 2018-01-09 14:50:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Moo (Old) and /work/SRC/openSUSE:Factory/.perl-Moo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Moo" Tue Jan 9 14:50:48 2018 rev:21 rq:555055 version:2.003004 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Moo/perl-Moo.changes 2017-04-07 14:20:50.310164633 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Moo.new/perl-Moo.changes 2018-01-09 14:51:14.605286748 +0100 @@ -1,0 +2,24 @@ +Thu Dec 7 06:39:25 UTC 2017 - [email protected] + +- updated to 2.003004 + see /usr/share/doc/packages/perl-Moo/Changes + + 2.003004 - 2017-12-01 + - re-allow stubs for attribute parameters like isa or coerce (RT#123753) + - fix accidentally removed space in coderef error message (GH#33) + - fix test errors with old Carp versions + +------------------------------------------------------------------- +Fri Nov 17 06:37:23 UTC 2017 - [email protected] + +- updated to 2.003003 + see /usr/share/doc/packages/perl-Moo/Changes + + 2.003003 - 2017-11-16 + - test tweaks + - fix handling of code refs stored directly in the stash (for perl 5.28) + - consider inline packages with constants in them as being loaded + - stubs will be treated as methods that exist when inflating to Moose + - avoid loading overload.pm unless required + +------------------------------------------------------------------- Old: ---- Moo-2.003002.tar.gz New: ---- Moo-2.003004.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Moo.spec ++++++ --- /var/tmp/diff_new_pack.egxCVD/_old 2018-01-09 14:51:15.225257682 +0100 +++ /var/tmp/diff_new_pack.egxCVD/_new 2018-01-09 14:51:15.229257494 +0100 @@ -17,7 +17,7 @@ Name: perl-Moo -Version: 2.003002 +Version: 2.003004 Release: 0 %define cpan_name Moo Summary: Minimalist Object Orientation (with Moose compatibility) ++++++ Moo-2.003002.tar.gz -> Moo-2.003004.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/Changes new/Moo-2.003004/Changes --- old/Moo-2.003002/Changes 2017-03-29 00:59:45.000000000 +0200 +++ new/Moo-2.003004/Changes 2017-12-01 02:45:54.000000000 +0100 @@ -1,7 +1,19 @@ Revision history for Moo +2.003004 - 2017-12-01 + - re-allow stubs for attribute parameters like isa or coerce (RT#123753) + - fix accidentally removed space in coderef error message (GH#33) + - fix test errors with old Carp versions + +2.003003 - 2017-11-16 + - test tweaks + - fix handling of code refs stored directly in the stash (for perl 5.28) + - consider inline packages with constants in them as being loaded + - stubs will be treated as methods that exist when inflating to Moose + - avoid loading overload.pm unless required + 2.003002 - 2017-03-28 - - ensure tarball does not contain SCHILY headers + - ensure tarball does not contain SCHILY headers 2.003001 - 2017-03-06 - fix +attributes replacing builder subs if parent attribute was defined with diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/MANIFEST new/Moo-2.003004/MANIFEST --- old/Moo-2.003002/MANIFEST 2017-03-29 01:03:35.000000000 +0200 +++ new/Moo-2.003004/MANIFEST 2017-12-01 02:47:58.000000000 +0100 @@ -81,6 +81,7 @@ t/non-moo-extends-c3.t t/non-moo-extends.t t/not-both.t +t/not-methods.t t/overloaded-coderefs.t t/overridden-core-funcs.t t/perl-56-like.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/META.json new/Moo-2.003004/META.json --- old/Moo-2.003002/META.json 2017-03-29 01:03:35.000000000 +0200 +++ new/Moo-2.003004/META.json 2017-12-01 02:47:57.000000000 +0100 @@ -4,13 +4,13 @@ "mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", + "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Moo", "no_index" : { @@ -88,7 +88,7 @@ }, "x_IRC" : "irc://irc.perl.org/#moose" }, - "version" : "2.003002", + "version" : "2.003004", "x_authority" : "cpan:MSTROUT", "x_breaks" : { "App::Commando" : "<= 0.012", @@ -104,5 +104,5 @@ "use_warnings" : "internal module used to apply warnings" } }, - "x_serialization_backend" : "JSON::PP version 2.27300" + "x_serialization_backend" : "JSON::PP version 2.94" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/META.yml new/Moo-2.003004/META.yml --- old/Moo-2.003002/META.yml 2017-03-29 01:03:34.000000000 +0200 +++ new/Moo-2.003004/META.yml 2017-12-01 02:47:55.000000000 +0100 @@ -8,7 +8,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' +generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -37,7 +37,7 @@ bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Moo license: http://dev.perl.org/licenses/ repository: https://github.com/moose/Moo.git -version: '2.003002' +version: '2.003004' x_authority: cpan:MSTROUT x_breaks: App::Commando: '<= 0.012' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/Makefile.PL new/Moo-2.003004/Makefile.PL --- old/Moo-2.003002/Makefile.PL 2017-01-18 11:21:14.000000000 +0100 +++ new/Moo-2.003004/Makefile.PL 2017-11-29 14:29:26.000000000 +0100 @@ -132,6 +132,9 @@ if $mymeta_broken; $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } unless -f 'META.yml'; +$MM_ARGS{PL_FILES} ||= {}; +$MM_ARGS{NORECURS} = 1 + if not exists $MM_ARGS{NORECURS}; for (qw(configure build test runtime)) { my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/lib/Method/Generate/Accessor.pm new/Moo-2.003004/lib/Method/Generate/Accessor.pm --- old/Moo-2.003002/lib/Method/Generate/Accessor.pm 2017-03-28 01:26:54.000000000 +0200 +++ new/Moo-2.003004/lib/Method/Generate/Accessor.pm 2017-12-01 02:16:07.000000000 +0100 @@ -8,7 +8,6 @@ use Scalar::Util 'blessed'; use Carp qw(croak); BEGIN { our @CARP_NOT = qw(Moo::_Utils) } -use overload (); BEGIN { *_CAN_WEAKEN_READONLY = ( "$]" < 5.008_003 or $ENV{MOO_TEST_PRE_583} @@ -671,19 +670,27 @@ sub _validate_codulatable { my ($self, $setting, $value, $into, $appended) = @_; - my $invalid = "Invalid $setting '" . overload::StrVal($value) - . "' for $into not a coderef"; - $invalid .= " $appended" if $appended; - unless (ref $value and (ref $value eq 'CODE' or blessed($value))) { - croak "$invalid or code-convertible object"; - } + my $error; - unless (eval { \&$value }) { - croak "$invalid and could not be converted to a coderef: $@"; + if (blessed $value) { + local $@; + no warnings 'void'; + eval { \&$value; 1 } + and return 1; + $error = "could not be converted to a coderef: $@"; + } + elsif (ref $value eq 'CODE') { + return 1; + } + else { + $error = 'is not a coderef or code-convertible object'; } - 1; + croak "Invalid $setting '" + . ($INC{'overload.pm'} ? overload::StrVal($value) : $value) + . "' for $into " . $error + . ($appended ? " $appended" : ''); } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/lib/Method/Generate/Constructor.pm new/Moo-2.003004/lib/Method/Generate/Constructor.pm --- old/Moo-2.003002/lib/Method/Generate/Constructor.pm 2017-02-17 10:34:09.000000000 +0100 +++ new/Moo-2.003004/lib/Method/Generate/Constructor.pm 2017-11-29 14:29:26.000000000 +0100 @@ -231,8 +231,8 @@ my @required_init = map $spec->{$_}{init_arg}, grep { - my %s = %{$spec->{$_}}; # ignore required if default or builder set - $s{required} and not($s{builder} or exists $s{default}) + my $s = $spec->{$_}; # ignore required if default or builder set + $s->{required} and not($s->{builder} or exists $s->{default}) } sort keys %$spec; return '' unless @required_init; ' if (my @missing = grep !exists $args->{$_}, ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/lib/Moo/Role.pm new/Moo-2.003004/lib/Moo/Role.pm --- old/Moo-2.003002/lib/Moo/Role.pm 2017-03-29 00:59:40.000000000 +0200 +++ new/Moo-2.003004/lib/Moo/Role.pm 2017-12-01 02:45:50.000000000 +0100 @@ -23,8 +23,8 @@ ); } -our $VERSION = '2.003002'; -$VERSION = eval $VERSION; +our $VERSION = '2.003004'; +$VERSION =~ tr/_//d; require Moo::sification; Moo::sification->import; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/lib/Moo/_Utils.pm new/Moo-2.003004/lib/Moo/_Utils.pm --- old/Moo-2.003002/lib/Moo/_Utils.pm 2017-01-18 11:21:14.000000000 +0100 +++ new/Moo-2.003004/lib/Moo/_Utils.pm 2017-11-21 17:57:44.000000000 +0100 @@ -55,7 +55,7 @@ # can't just ->can('can') because a sub-package Foo::Bar::Baz # creates a 'Baz::' key in Foo::Bar's symbol table my $stash = _getstash($module)||{}; - return 1 if grep +(!ref($_) and *$_{CODE}), values %$stash; + return 1 if grep +(ref($_) || *$_{CODE}), values %$stash; return 1 if $INC{"Moose.pm"} && Class::MOP::class_of($module) or Mouse::Util->can('find_meta') && Mouse::Util::find_meta($module); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/lib/Moo.pm new/Moo-2.003004/lib/Moo.pm --- old/Moo-2.003002/lib/Moo.pm 2017-03-29 00:59:40.000000000 +0200 +++ new/Moo-2.003004/lib/Moo.pm 2017-12-01 02:45:50.000000000 +0100 @@ -11,6 +11,7 @@ _set_loaded _unimport_coderefs ); +use Scalar::Util qw(reftype); use Carp qw(croak); BEGIN { our @CARP_NOT = qw( @@ -22,8 +23,8 @@ ); } -our $VERSION = '2.003002'; -$VERSION = eval $VERSION; +our $VERSION = '2.003004'; +$VERSION =~ tr/_//d; require Moo::sification; Moo::sification->import; @@ -86,7 +87,9 @@ } return if $MAKERS{$target}{is_class}; # already exported into this package my $stash = _getstash($target); - my @not_methods = map { *$_{CODE}||() } grep !ref($_), values %$stash; + my @not_methods = map +( + !ref($_) ? *$_{CODE}||() : reftype($_) eq 'CODE' ? $_ : () + ), values %$stash; @{$MAKERS{$target}{not_methods}={}}{@not_methods} = @not_methods; $MAKERS{$target}{is_class} = 1; { @@ -192,7 +195,8 @@ my $con; my @isa = @{mro::get_linear_isa($target)}; shift @isa; - if (my ($parent_new) = grep { *{_getglob($_.'::new')}{CODE} } @isa) { + no strict 'refs'; + if (my ($parent_new) = grep +(defined &{$_.'::new'}), @isa) { if ($parent_new eq 'Moo::Object') { # no special constructor needed } @@ -228,19 +232,20 @@ } sub _concrete_methods_of { - my ($me, $role) = @_; - my $makers = $MAKERS{$role}; - # grab role symbol table - my $stash = _getstash($role); + my ($me, $class) = @_; + my $makers = $MAKERS{$class}; + # grab class symbol table + my $stash = _getstash($class); # reverse so our keys become the values (captured coderefs) in case # they got copied or re-used since my $not_methods = { reverse %{$makers->{not_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 &{"${class}::$_"} ? \&{"${class}::$_"} : undef; ( ! $code or exists $not_methods->{$code} ) ? () : ($_ => $code) - } grep !ref($stash->{$_}), keys %$stash + } grep +(!ref($stash->{$_}) || reftype($stash->{$_}) eq 'CODE'), keys %$stash }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/t/accessor-isa.t new/Moo-2.003004/t/accessor-isa.t --- old/Moo-2.003002/t/accessor-isa.t 2016-10-31 01:06:02.000000000 +0100 +++ new/Moo-2.003004/t/accessor-isa.t 2017-12-01 02:16:07.000000000 +0100 @@ -217,4 +217,22 @@ ::is $@, $error, '$@ unchanged after successful isa'; } +{ + package TestClassWithStub; + use Moo; + sub stub_isa; + + ::is ::exception { has attr1 => (is => 'ro', isa => \&stub_isa); }, undef, + 'stubs allowed for isa checks'; + + eval q{ + sub stub_isa { die "stub isa check"; } + 1; + } or die $@; + + ::like ::exception { __PACKAGE__->new(attr1 => 1) }, + qr/stub isa check/, + 'stub isa works after being defined'; +} + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/t/lib/TestEnv.pm new/Moo-2.003004/t/lib/TestEnv.pm --- old/Moo-2.003002/t/lib/TestEnv.pm 2017-01-18 11:18:48.000000000 +0100 +++ new/Moo-2.003004/t/lib/TestEnv.pm 2017-11-21 17:57:44.000000000 +0100 @@ -4,7 +4,7 @@ sub import { $ENV{$_} = 1 - for grep defined && length, @_[1 .. $#_]; + for grep defined && length && !exists $ENV{$_}, @_[1 .. $#_]; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/t/moo-utils.t new/Moo-2.003004/t/moo-utils.t --- old/Moo-2.003002/t/moo-utils.t 2016-10-31 01:06:02.000000000 +0100 +++ new/Moo-2.003004/t/moo-utils.t 2017-11-29 14:29:26.000000000 +0100 @@ -29,4 +29,55 @@ " ... and doesn't warn"; } +{ + { + package MooTest::Module::WithVariable; + our $VARIABLE = 219; + } + like exception { Moo::_Utils::_load_module('MooTest::Module::WithVariable') }, + qr{^Can't locate MooTest/Module/WithVariable\.pm }, + '_load_module: inline package with only variable not treated as loaded'; + + { + package MooTest::Module::WithSub; + sub glorp { $_[0] + 1 } + } + is exception { Moo::_Utils::_load_module('MooTest::Module::WithSub') }, undef, + '_load_module: inline package with sub treated as loaded'; + + { + package MooTest::Module::WithConstant; + use constant GORP => "GLUB"; + } + is exception { Moo::_Utils::_load_module('MooTest::Module::WithConstant') }, undef, + '_load_module: inline package with constant treated as loaded'; + + { + package MooTest::Module::WithListConstant; + use constant GORP => "GLUB", "BOGGLE"; + } + is exception { Moo::_Utils::_load_module('MooTest::Module::WithListConstant') }, undef, + '_load_module: inline package with constant treated as loaded'; + + { + package MooTest::Module::WithBEGIN; + my $var; + BEGIN { $var = 1 } + } + like exception { Moo::_Utils::_load_module('MooTest::Module::WithBEGIN') }, + qr{^Can't locate MooTest/Module/WithBEGIN\.pm }, + '_load_module: inline package with only BEGIN not treated as loaded'; + + { + package MooTest::Module::WithSubPackage; + package MooTest::Module::WithSubPackage::SubPackage; + our $grop = 1; + sub grop { 1 } + } + like exception { Moo::_Utils::_load_module('MooTest::Module::WithSubPackage') }, + qr{^Can't locate MooTest/Module/WithSubPackage\.pm }, + '_load_module: inline package with sub package not treated as loaded'; + +} + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/t/not-methods.t new/Moo-2.003004/t/not-methods.t --- old/Moo-2.003002/t/not-methods.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Moo-2.003004/t/not-methods.t 2017-11-21 17:57:44.000000000 +0100 @@ -0,0 +1,64 @@ +use Moo::_strictures; +use Test::More; + +BEGIN { + package FooClass; + sub early { 1 } + use Moo; + sub late { 2 } +} + +BEGIN { + is_deeply + [sort keys %{Moo->_concrete_methods_of('FooClass')}], + [qw(late)], + 'subs created before use Moo are not methods'; +} + +BEGIN { + package BarClass; + sub early { 1 } + use Moo; + sub late { 2 } + no warnings 'redefine'; + sub early { 3 } +} + +BEGIN { + is_deeply + [sort keys %{Moo->_concrete_methods_of('BarClass')}], + [qw(early late)], + 'only same subrefs created before use Moo are not methods'; +} + +BEGIN { + package FooRole; + sub early { 1 } + use Moo::Role; + sub late { 2 } +} + +BEGIN { + is_deeply + [sort keys %{Moo::Role->_concrete_methods_of('FooRole')}], + [qw(late)], + 'subs created before use Moo::Role are not methods'; +} + +BEGIN { + package BarRole; + sub early { 1 } + use Moo::Role; + sub late { 2 } + no warnings 'redefine'; + sub early { 3 } +} + +BEGIN { + is_deeply + [sort keys %{Moo::Role->_concrete_methods_of('BarRole')}], + [qw(early late)], + 'only same subrefs created before use Moo::Role are not methods'; +} + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/xt/moo-consume-moose-role-coerce.t new/Moo-2.003004/xt/moo-consume-moose-role-coerce.t --- old/Moo-2.003002/xt/moo-consume-moose-role-coerce.t 2017-02-17 10:34:09.000000000 +0100 +++ new/Moo-2.003004/xt/moo-consume-moose-role-coerce.t 2017-11-21 17:57:44.000000000 +0100 @@ -5,7 +5,6 @@ package RoleOne; use Moose::Role; use Moose::Util::TypeConstraints; - use namespace::autoclean; subtype 'Foo', as 'Int'; coerce 'Foo', from 'Str', via { 3 }; @@ -20,7 +19,6 @@ { package Class; use Moo; # Works if use Moose.. - use namespace::clean -except => 'meta'; with 'RoleOne'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/xt/moo-consume-mouse-role-coerce.t new/Moo-2.003004/xt/moo-consume-mouse-role-coerce.t --- old/Moo-2.003002/xt/moo-consume-mouse-role-coerce.t 2017-02-17 10:34:09.000000000 +0100 +++ new/Moo-2.003004/xt/moo-consume-mouse-role-coerce.t 2017-11-21 17:57:44.000000000 +0100 @@ -7,7 +7,6 @@ package RoleOne; use Mouse::Role; use Mouse::Util::TypeConstraints; - use namespace::clean; subtype 'Foo', as 'Int'; coerce 'Foo', from 'Str', via { 3 }; @@ -22,7 +21,6 @@ { package Class; use Moo; # Works if use Moose.. - use namespace::clean -except => 'meta'; with 'RoleOne'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-2.003002/xt/moo-role-types.t new/Moo-2.003004/xt/moo-role-types.t --- old/Moo-2.003002/xt/moo-role-types.t 2016-10-31 01:06:02.000000000 +0100 +++ new/Moo-2.003004/xt/moo-role-types.t 2017-11-21 17:57:44.000000000 +0100 @@ -5,7 +5,6 @@ { package TestClientClass; use Moo; - use namespace::clean -except => 'meta'; sub consume {} } @@ -13,7 +12,6 @@ { package TestBadClientClass; use Moo; - use namespace::clean -except => 'meta'; sub not_consume {} } @@ -22,8 +20,6 @@ package TestRole; use Moo::Role; use Sub::Quote; - use namespace::clean -except => 'meta'; - has output_to => ( isa => quote_sub(q{
