diff -Nru libmoo-perl-2.003002/Changes libmoo-perl-2.003003/Changes --- libmoo-perl-2.003002/Changes 2017-03-28 22:59:45.000000000 +0000 +++ libmoo-perl-2.003003/Changes 2017-11-16 16:21:54.000000000 +0000 @@ -1,7 +1,14 @@ Revision history for Moo +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 -Nru libmoo-perl-2.003002/debian/changelog libmoo-perl-2.003003/debian/changelog --- libmoo-perl-2.003002/debian/changelog 2017-06-17 20:43:55.000000000 +0000 +++ libmoo-perl-2.003003/debian/changelog 2017-11-27 09:01:40.000000000 +0000 @@ -1,3 +1,15 @@ +libmoo-perl (2.003003-1) unstable; urgency=medium + + [ Alex Muntada ] + * Remove inactive pkg-perl members from Uploaders. + + [ intrigeri ] + * Import upstream version 2.003003. + * Declare compliance with Standards-Version 4.1.1. + * debian/changelog: remove trailing whitespace. + + -- intrigeri Mon, 27 Nov 2017 09:01:40 +0000 + libmoo-perl (2.003002-1) unstable; urgency=medium * Team upload. @@ -317,7 +329,7 @@ [ gregor herrmann ] * Make (build) dependency on libclass-method-modifiers-perl versioned. - + -- Alessandro Ghedini Fri, 23 Dec 2011 20:41:22 +0100 libmoo-perl (0.009012-1) unstable; urgency=low @@ -360,7 +372,7 @@ * Bump to 3.9.2 Standard-Version. * Switch to DEP5 license format. * Add myself to Uploaders. - * Update Format-Specification link. + * Update Format-Specification link. -- Fabrizio Regalli Wed, 15 Jun 2011 23:17:43 +0200 diff -Nru libmoo-perl-2.003002/debian/control libmoo-perl-2.003003/debian/control --- libmoo-perl-2.003002/debian/control 2017-06-17 20:43:55.000000000 +0000 +++ libmoo-perl-2.003003/debian/control 2017-11-27 09:01:40.000000000 +0000 @@ -1,7 +1,6 @@ Source: libmoo-perl Maintainer: Debian Perl Group -Uploaders: Alessandro Ghedini , - intrigeri +Uploaders: intrigeri Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional @@ -17,7 +16,7 @@ libsub-name-perl (>= 0.08), libsub-quote-perl, libtest-fatal-perl -Standards-Version: 3.9.8 +Standards-Version: 4.1.1 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libmoo-perl.git Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libmoo-perl.git Homepage: https://metacpan.org/release/Moo diff -Nru libmoo-perl-2.003002/lib/Method/Generate/Accessor.pm libmoo-perl-2.003003/lib/Method/Generate/Accessor.pm --- libmoo-perl-2.003002/lib/Method/Generate/Accessor.pm 2017-03-27 23:26:54.000000000 +0000 +++ libmoo-perl-2.003003/lib/Method/Generate/Accessor.pm 2017-10-01 22:45:19.000000000 +0000 @@ -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,29 @@ 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') { + defined &$value + and return 1; + $error = 'is a stub'; + } + 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 -Nru libmoo-perl-2.003002/lib/Moo/Role.pm libmoo-perl-2.003003/lib/Moo/Role.pm --- libmoo-perl-2.003002/lib/Moo/Role.pm 2017-03-28 22:59:40.000000000 +0000 +++ libmoo-perl-2.003003/lib/Moo/Role.pm 2017-11-16 16:21:49.000000000 +0000 @@ -23,8 +23,8 @@ ); } -our $VERSION = '2.003002'; -$VERSION = eval $VERSION; +our $VERSION = '2.003003'; +$VERSION =~ tr/_//d; require Moo::sification; Moo::sification->import; diff -Nru libmoo-perl-2.003002/lib/Moo/_Utils.pm libmoo-perl-2.003003/lib/Moo/_Utils.pm --- libmoo-perl-2.003002/lib/Moo/_Utils.pm 2017-01-18 10:21:14.000000000 +0000 +++ libmoo-perl-2.003003/lib/Moo/_Utils.pm 2017-11-08 02:50:46.000000000 +0000 @@ -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 -Nru libmoo-perl-2.003002/lib/Moo.pm libmoo-perl-2.003003/lib/Moo.pm --- libmoo-perl-2.003002/lib/Moo.pm 2017-03-28 22:59:40.000000000 +0000 +++ libmoo-perl-2.003003/lib/Moo.pm 2017-11-16 16:21:49.000000000 +0000 @@ -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.003003'; +$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 -Nru libmoo-perl-2.003002/MANIFEST libmoo-perl-2.003003/MANIFEST --- libmoo-perl-2.003002/MANIFEST 2017-03-28 23:03:35.000000000 +0000 +++ libmoo-perl-2.003003/MANIFEST 2017-11-16 16:22:37.000000000 +0000 @@ -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 -Nru libmoo-perl-2.003002/META.json libmoo-perl-2.003003/META.json --- libmoo-perl-2.003002/META.json 2017-03-28 23:03:35.000000000 +0000 +++ libmoo-perl-2.003003/META.json 2017-11-16 16:22:37.000000000 +0000 @@ -10,7 +10,7 @@ ], "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.003003", "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 -Nru libmoo-perl-2.003002/META.yml libmoo-perl-2.003003/META.yml --- libmoo-perl-2.003002/META.yml 2017-03-28 23:03:34.000000000 +0000 +++ libmoo-perl-2.003003/META.yml 2017-11-16 16:22:36.000000000 +0000 @@ -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.003003' x_authority: cpan:MSTROUT x_breaks: App::Commando: '<= 0.012' diff -Nru libmoo-perl-2.003002/t/lib/TestEnv.pm libmoo-perl-2.003003/t/lib/TestEnv.pm --- libmoo-perl-2.003002/t/lib/TestEnv.pm 2017-01-18 10:18:48.000000000 +0000 +++ libmoo-perl-2.003003/t/lib/TestEnv.pm 2017-10-10 19:58:13.000000000 +0000 @@ -4,7 +4,7 @@ sub import { $ENV{$_} = 1 - for grep defined && length, @_[1 .. $#_]; + for grep defined && length && !exists $ENV{$_}, @_[1 .. $#_]; } 1; diff -Nru libmoo-perl-2.003002/t/moo-utils.t libmoo-perl-2.003003/t/moo-utils.t --- libmoo-perl-2.003002/t/moo-utils.t 2016-10-31 00:06:02.000000000 +0000 +++ libmoo-perl-2.003003/t/moo-utils.t 2017-11-08 02:50:46.000000000 +0000 @@ -29,4 +29,56 @@ " ... and doesn't warn"; } +{ + local @INC = (); + { + package Module::WithVariable; + our $VARIABLE = 219; + } + like exception { Moo::_Utils::_load_module('Module::WithVariable') }, + qr{^Can't locate Module/WithVariable.pm }, + '_load_module: inline package with only variable not treated as loaded'; + + { + package Module::WithSub; + sub glorp { $_[0] + 1 } + } + is exception { Moo::_Utils::_load_module('Module::WithSub') }, undef, + '_load_module: inline package with sub treated as loaded'; + + { + package Module::WithConstant; + use constant GORP => "GLUB"; + } + is exception { Moo::_Utils::_load_module('Module::WithConstant') }, undef, + '_load_module: inline package with constant treated as loaded'; + + { + package Module::WithListConstant; + use constant GORP => "GLUB", "BOGGLE"; + } + is exception { Moo::_Utils::_load_module('Module::WithListConstant') }, undef, + '_load_module: inline package with constant treated as loaded'; + + { + package Module::WithBEGIN; + my $var; + BEGIN { $var = 1 } + } + like exception { Moo::_Utils::_load_module('Module::WithBEGIN') }, + qr{^Can't locate Module/WithBEGIN.pm }, + '_load_module: inline package with only BEGIN not treated as loaded'; + + { + package Module::WithSubPackage; + package Module::WithSubPackage::SubPackage; + our $grop = 1; + sub grop { 1 } + } + like exception { Moo::_Utils::_load_module('Module::WithSubPackage') }, + qr{^Can't locate Module/WithSubPackage.pm }, + '_load_module: inline package with sub package not treated as loaded'; + +} + done_testing; diff -Nru libmoo-perl-2.003002/t/not-methods.t libmoo-perl-2.003003/t/not-methods.t --- libmoo-perl-2.003002/t/not-methods.t 1970-01-01 00:00:00.000000000 +0000 +++ libmoo-perl-2.003003/t/not-methods.t 2017-11-08 02:50:46.000000000 +0000 @@ -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 -Nru libmoo-perl-2.003002/xt/moo-consume-moose-role-coerce.t libmoo-perl-2.003003/xt/moo-consume-moose-role-coerce.t --- libmoo-perl-2.003002/xt/moo-consume-moose-role-coerce.t 2017-02-17 09:34:09.000000000 +0000 +++ libmoo-perl-2.003003/xt/moo-consume-moose-role-coerce.t 2017-10-01 22:45:19.000000000 +0000 @@ -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 -Nru libmoo-perl-2.003002/xt/moo-consume-mouse-role-coerce.t libmoo-perl-2.003003/xt/moo-consume-mouse-role-coerce.t --- libmoo-perl-2.003002/xt/moo-consume-mouse-role-coerce.t 2017-02-17 09:34:09.000000000 +0000 +++ libmoo-perl-2.003003/xt/moo-consume-mouse-role-coerce.t 2017-10-01 22:45:19.000000000 +0000 @@ -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 -Nru libmoo-perl-2.003002/xt/moo-role-types.t libmoo-perl-2.003003/xt/moo-role-types.t --- libmoo-perl-2.003002/xt/moo-role-types.t 2016-10-31 00:06:02.000000000 +0000 +++ libmoo-perl-2.003003/xt/moo-role-types.t 2017-10-01 22:45:19.000000000 +0000 @@ -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{