diff -Nru libmoo-perl-2.003004/Changes libmoo-perl-2.003006/Changes --- libmoo-perl-2.003004/Changes 2017-12-01 01:45:54.000000000 +0000 +++ libmoo-perl-2.003006/Changes 2019-10-25 11:20:49.000000000 +0000 @@ -1,5 +1,29 @@ Revision history for Moo +2.003006 - 2019-10-25 + - update Role::Tiny prerequisite to 2.001004 to fix issues with re-importing + Moo::Role + +2.003_005 - 2019-10-18 + - always exclude helper subs (has, with, etc) from the list of methods, even + if they are installed later or wrapped with a modifier + - drop Devel::GlobalDestruction prerequisite unless using perl < 5.14 + - fix preserving full accuracy of numbers in non-ref defaults + - fix tracking of stubs and constants as methods to be consistent and work + properly with unusual ways of storing subs (RT#130050) + - fix test for modules broken by newer Moo versions when new enough + CPAN::Meta version is not available + - fix undeferring subs before wrapping with a method modifier when subs to + wrap are given as a list or array ref + - fix error reporting locations from Carp calls in DEMOLISH (RT#124845) + - fix extending attributes (has +) to allow overriding a default with a + builder (RT#130361) + - fix re-throwing Moose inflation exceptions when examining exception + objects on older Moose or Devel::StackTrace versions + - reorganized documentation related to Moose to improve clarity + - improved documentation of usage with namespace::clean + - various documentation tweaks + 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) diff -Nru libmoo-perl-2.003004/debian/changelog libmoo-perl-2.003006/debian/changelog --- libmoo-perl-2.003004/debian/changelog 2018-10-29 19:54:03.000000000 +0000 +++ libmoo-perl-2.003006/debian/changelog 2019-10-30 07:05:31.000000000 +0000 @@ -1,3 +1,14 @@ +libmoo-perl (2.003006-1) unstable; urgency=medium + + * Import upstream version 2.003006 + * Update build and runtime dependencies + * Bump debhelper compatibility level to 12 + * Update and tidy build and runtime dependencies with "dh-make-perl refresh" + * Declare compliance with policy 4.4.1 + * Declare that debian/rules does not need (fake)root + + -- intrigeri Wed, 30 Oct 2019 07:05:31 +0000 + libmoo-perl (2.003004-2) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru libmoo-perl-2.003004/debian/compat libmoo-perl-2.003006/debian/compat --- libmoo-perl-2.003004/debian/compat 2018-10-29 19:54:03.000000000 +0000 +++ libmoo-perl-2.003006/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru libmoo-perl-2.003004/debian/control libmoo-perl-2.003006/debian/control --- libmoo-perl-2.003004/debian/control 2018-10-29 19:54:03.000000000 +0000 +++ libmoo-perl-2.003006/debian/control 2019-10-30 07:05:31.000000000 +0000 @@ -4,36 +4,40 @@ Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 11) -Build-Depends-Indep: perl, - libclass-method-modifiers-perl (>= 1.10), - libclass-xsaccessor-perl (>= 1.18), - libdevel-globaldestruction-perl (>= 0.11), +Build-Depends: debhelper-compat (= 12) +Build-Depends-Indep: libclass-method-modifiers-perl, + libclass-xsaccessor-perl, libimport-into-perl, - libmodule-runtime-perl (>= 0.014), - librole-tiny-perl (>= 2.000004), + libmodule-runtime-perl, + libmoose-perl, + librole-tiny-perl (>= 2.001004), + libscalar-list-utils-perl, libstrictures-perl (>= 2), - libsub-name-perl (>= 0.08), - libsub-quote-perl, - libtest-fatal-perl -Standards-Version: 4.2.1 + libsub-name-perl, + libsub-quote-perl (>= 2.006006), + libtest-fatal-perl, + libtest-simple-perl, + libtype-tiny-perl, + perl +Standards-Version: 4.4.1 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libmoo-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libmoo-perl.git Homepage: https://metacpan.org/release/Moo +Rules-Requires-Root: no Package: libmoo-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, - libclass-method-modifiers-perl (>= 1.10), - libdevel-globaldestruction-perl (>= 0.11), + libclass-method-modifiers-perl, libimport-into-perl, - libmodule-runtime-perl (>= 0.014), - librole-tiny-perl (>= 2.000004), + libmodule-runtime-perl, + librole-tiny-perl (>= 2.001004), + libscalar-list-utils-perl, libstrictures-perl (>= 2), - libsub-quote-perl -Recommends: libclass-xsaccessor-perl (>= 1.18), - libsub-name-perl (>= 0.08) + libsub-quote-perl (>= 2.006006) +Recommends: libclass-xsaccessor-perl, + libsub-name-perl Description: Minimalist Object Orientation library (with Moose compatibility) Moo is an extremely light-weight, high-performance Moose replacement. It also avoids depending on any XS modules to allow simple deployments. The name Moo diff -Nru libmoo-perl-2.003004/lib/Method/Generate/Accessor.pm libmoo-perl-2.003006/lib/Method/Generate/Accessor.pm --- libmoo-perl-2.003004/lib/Method/Generate/Accessor.pm 2017-12-01 01:16:07.000000000 +0000 +++ libmoo-perl-2.003006/lib/Method/Generate/Accessor.pm 2019-09-20 14:34:04.000000000 +0000 @@ -264,6 +264,10 @@ ($old_spec->{$key}, $spec->{$key}) ]; } + elsif ($key eq 'builder' || $key eq 'default') { + $spec->{$key} = $old_spec->{$key} + if !(exists $spec->{builder} || exists $spec->{default}); + } elsif (!exists $spec->{$key}) { $spec->{$key} = $old_spec->{$key}; } diff -Nru libmoo-perl-2.003004/lib/Method/Generate/DemolishAll.pm libmoo-perl-2.003006/lib/Method/Generate/DemolishAll.pm --- libmoo-perl-2.003004/lib/Method/Generate/DemolishAll.pm 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/lib/Method/Generate/DemolishAll.pm 2019-09-20 14:33:13.000000000 +0000 @@ -6,6 +6,11 @@ use Sub::Quote qw(quote_sub quotify); use Moo::_Utils qw(_getglob); use Moo::_mro; +BEGIN { + *_USE_DGD = "$]" < 5.014 ? sub(){1} : sub(){0}; + require Devel::GlobalDestruction + if _USE_DGD(); +} sub generate_method { my ($self, $into) = @_; @@ -18,10 +23,15 @@ q! my $self = shift; my $e = do { local $?; - local $@; - require Devel::GlobalDestruction; + local $@;!.(_USE_DGD ? q! + require Devel::GlobalDestruction;! : '').q! + package !.$into.q!; eval { - $self->DEMOLISHALL(Devel::GlobalDestruction::in_global_destruction); + $self->DEMOLISHALL(!.( + _USE_DGD + ? 'Devel::GlobalDestruction::in_global_destruction()' + : q[${^GLOBAL_PHASE} eq 'DESTRUCT'] + ).q!); }; $@; }; @@ -39,12 +49,15 @@ grep *{_getglob($_)}{CODE}, map "${_}::DEMOLISH", @{mro::get_linear_isa($into)}; - join '', map qq{ ${me}->${_}(${args});\n}, @demolishers; + join '', + qq{ package $into;\n}, + map qq{ ${me}->${_}(${args});\n}, @demolishers; } sub _handle_subdemolish { my ($self, $into) = @_; ' if (ref($_[0]) ne '.quotify($into).') {'."\n". + " package $into;\n". ' return shift->Moo::Object::DEMOLISHALL(@_)'.";\n". ' }'."\n"; } diff -Nru libmoo-perl-2.003004/lib/Moo/HandleMoose/FakeMetaClass.pm libmoo-perl-2.003006/lib/Moo/HandleMoose/FakeMetaClass.pm --- libmoo-perl-2.003004/lib/Moo/HandleMoose/FakeMetaClass.pm 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/lib/Moo/HandleMoose/FakeMetaClass.pm 2019-10-18 08:42:24.000000000 +0000 @@ -26,6 +26,13 @@ my $self = shift; return $self->SUPER::isa(@_) if !ref $self or $Moo::sification::disabled; + + # prevent inflation by Devel::StackTrace, which does this check. examining + # the stack trace in an exception from inflation could re-trigger inflation + # and cause another exception. + return !!0 + if @_ == 1 && $_[0] eq 'Exception::Class::Base'; + require Moo::HandleMoose; Moo::HandleMoose::inject_real_metaclass_for($self->{name})->isa(@_) } diff -Nru libmoo-perl-2.003004/lib/Moo/Role.pm libmoo-perl-2.003006/lib/Moo/Role.pm --- libmoo-perl-2.003004/lib/Moo/Role.pm 2017-12-01 01:45:50.000000000 +0000 +++ libmoo-perl-2.003006/lib/Moo/Role.pm 2019-10-25 11:20:32.000000000 +0000 @@ -2,10 +2,12 @@ use Moo::_strictures; use Moo::_Utils qw( + _check_tracked _getglob _getstash _install_coderef _install_modifier + _install_tracked _load_module _name_coderef _set_loaded @@ -23,7 +25,7 @@ ); } -our $VERSION = '2.003004'; +our $VERSION = '2.003006'; $VERSION =~ tr/_//d; require Moo::sification; @@ -42,12 +44,6 @@ our %COMPOSED; our @ON_ROLE_CREATE; -sub _install_tracked { - my ($target, $name, $code) = @_; - $INFO{$target}{exports}{$name} = $code; - _install_coderef "${target}::${name}" => "Moo::Role::${name}" => $code; -} - sub import { my $target = caller; if ($Moo::MAKERS{$target} and $Moo::MAKERS{$target}{is_class}) { @@ -57,6 +53,14 @@ goto &Role::Tiny::import; } +sub _accessor_maker_for { + my ($class, $target) = @_; + ($INFO{$target}{accessor_maker} ||= do { + require Method::Generate::Accessor; + Method::Generate::Accessor->new + }); +} + sub _install_subs { my ($me, $target) = @_; _install_tracked $target => has => sub { @@ -69,10 +73,8 @@ my %spec = @_; foreach my $name (@name_proto) { my $spec_ref = @name_proto > 1 ? +{%spec} : \%spec; - ($INFO{$target}{accessor_maker} ||= do { - require Method::Generate::Accessor; - Method::Generate::Accessor->new - })->generate_method($target, $name, $spec_ref); + $me->_accessor_maker_for($target) + ->generate_method($target, $name, $spec_ref); push @{$INFO{$target}{attributes}||=[]}, $name, $spec_ref; $me->_maybe_reset_handlemoose($target); } @@ -111,7 +113,7 @@ sub unimport { my $target = caller; - _unimport_coderefs($target, $INFO{$target}); + _unimport_coderefs($target); } sub _maybe_reset_handlemoose { @@ -121,6 +123,19 @@ } } +sub _non_methods { + my $self = shift; + my ($role) = @_; + + my $non_methods = $self->SUPER::_non_methods(@_); + + my $all_subs = $self->_all_subs($role); + $non_methods->{$_} = $all_subs->{$_} + for _check_tracked($role, [ keys %$all_subs ]); + + return $non_methods; +} + sub methods_provided_by { my ($self, $role) = @_; _load_module($role); @@ -491,8 +506,9 @@ =head1 DESCRIPTION C builds upon L, so look there for most of the -documentation on how this works. The main addition here is extra bits to make -the roles more "Moosey;" which is to say, it adds L. +documentation on how this works (in particular, using C also +enables L and L). The main addition here is extra bits to +make the roles more "Moosey;" which is to say, it adds L. =head1 IMPORTED SUBROUTINES diff -Nru libmoo-perl-2.003004/lib/Moo/sification.pm libmoo-perl-2.003006/lib/Moo/sification.pm --- libmoo-perl-2.003004/lib/Moo/sification.pm 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/lib/Moo/sification.pm 2019-09-20 14:33:13.000000000 +0000 @@ -2,7 +2,11 @@ use Moo::_strictures; no warnings 'once'; -use Devel::GlobalDestruction qw(in_global_destruction); +BEGIN { + *_USE_DGD = "$]" < 5.014 ? sub(){1} : sub(){0}; + require Devel::GlobalDestruction + if _USE_DGD(); +} use Carp qw(croak); BEGIN { our @CARP_NOT = qw(Moo::HandleMoose) } @@ -13,7 +17,11 @@ } sub Moo::HandleMoose::AuthorityHack::DESTROY { - unless (our $disabled or in_global_destruction) { + unless (our $disabled or + _USE_DGD + ? Devel::GlobalDestruction::in_global_destruction() + : ${^GLOBAL_PHASE} eq 'DESTRUCT' + ) { require Moo::HandleMoose; Moo::HandleMoose->import; } diff -Nru libmoo-perl-2.003004/lib/Moo/_Utils.pm libmoo-perl-2.003006/lib/Moo/_Utils.pm --- libmoo-perl-2.003004/lib/Moo/_Utils.pm 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/lib/Moo/_Utils.pm 2019-10-02 14:43:14.000000000 +0000 @@ -22,26 +22,70 @@ use Module::Runtime qw(use_package_optimistically module_notional_filename); -use Devel::GlobalDestruction (); use Exporter qw(import); use Config; +use Scalar::Util qw(weaken); use Carp qw(croak); +# this should be empty, but some CPAN modules expect these our @EXPORT = qw( - _getglob _install_modifier _load_module _maybe_load_module - _getstash _install_coderef _name_coderef - _unimport_coderefs _set_loaded + _install_coderef + _load_module ); -sub _install_modifier { - my ($into, $type, $name, $code) = @_; +our @EXPORT_OK = qw( + _check_tracked + _getglob + _getstash + _install_coderef + _install_modifier + _install_tracked + _load_module + _maybe_load_module + _name_coderef + _set_loaded + _unimport_coderefs +); + +my %EXPORTS; - if ($INC{'Sub/Defer.pm'} and my $to_modify = $into->can($name)) { # CMM will throw for us if not - Sub::Defer::undefer_sub($to_modify); +sub _install_modifier { + my $target = $_[0]; + my $type = $_[1]; + my $code = $_[-1]; + my @names = @_[2 .. $#_ - 1]; + + @names = @{ $names[0] } + if ref($names[0]) eq 'ARRAY'; + + my @tracked = _check_tracked($target, \@names); + + if ($INC{'Sub/Defer.pm'}) { + for my $name (@names) { + # CMM will throw for us if it doesn't exist + if (my $to_modify = $target->can($name)) { + Sub::Defer::undefer_sub($to_modify); + } + } } require Class::Method::Modifiers; Class::Method::Modifiers::install_modifier(@_); + + if (@tracked) { + my $exports = $EXPORTS{$target}; + weaken($exports->{$_} = $target->can($_)) + for @tracked; + } + + return; +} + +sub _install_tracked { + my ($target, $name, $code) = @_; + my $from = caller; + weaken($EXPORTS{$target}{$name} = $code); + _install_coderef("${target}::${name}", "${from}::${name}", $code); } sub _load_module { @@ -99,23 +143,41 @@ _CAN_SUBNAME ? _subname(@_) : $_[1]; } +sub _check_tracked { + my ($target, $names) = @_; + my $stash = _getstash($target); + my $exports = $EXPORTS{$target} + or return; + + $names = [keys %$exports] + if !$names; + my %rev = + map +($exports->{$_} => $_), + grep defined $exports->{$_}, + keys %$exports; + + return + grep { + my $g = $stash->{$_}; + $g && defined &$g && exists $rev{\&$g}; + } + @$names; +} + sub _unimport_coderefs { - my ($target, $info) = @_; - return unless $info and my $exports = $info->{exports}; - my %rev = reverse %$exports; + my ($target) = @_; + my $stash = _getstash($target); - foreach my $name (keys %$exports) { - if ($stash->{$name} and defined(&{$stash->{$name}})) { - if ($rev{$target->can($name)}) { - my $old = delete $stash->{$name}; - my $full_name = join('::',$target,$name); - # Copy everything except the code slot back into place (e.g. $has) - foreach my $type (qw(SCALAR HASH ARRAY IO)) { - next unless defined(*{$old}{$type}); - no strict 'refs'; - *$full_name = *{$old}{$type}; - } - } + my @exports = _check_tracked($target); + + foreach my $name (@exports) { + my $old = delete $stash->{$name}; + my $full_name = join('::',$target,$name); + # Copy everything except the code slot back into place (e.g. $has) + foreach my $type (qw(SCALAR HASH ARRAY IO)) { + next unless defined(*{$old}{$type}); + no strict 'refs'; + *$full_name = *{$old}{$type}; } } } diff -Nru libmoo-perl-2.003004/lib/Moo.pm libmoo-perl-2.003006/lib/Moo.pm --- libmoo-perl-2.003004/lib/Moo.pm 2017-12-01 01:45:50.000000000 +0000 +++ libmoo-perl-2.003006/lib/Moo.pm 2019-10-25 11:20:32.000000000 +0000 @@ -3,10 +3,12 @@ use Moo::_strictures; use Moo::_mro; use Moo::_Utils qw( + _check_tracked _getglob _getstash _install_coderef _install_modifier + _install_tracked _load_module _set_loaded _unimport_coderefs @@ -23,7 +25,7 @@ ); } -our $VERSION = '2.003004'; +our $VERSION = '2.003006'; $VERSION =~ tr/_//d; require Moo::sification; @@ -31,12 +33,6 @@ our %MAKERS; -sub _install_tracked { - my ($target, $name, $code) = @_; - $MAKERS{$target}{exports}{$name} = $code; - _install_coderef "${target}::${name}" => "Moo::${name}" => $code; -} - sub import { my $target = caller; my $class = shift; @@ -86,11 +82,15 @@ }; } return if $MAKERS{$target}{is_class}; # already exported into this package + my $stash = _getstash($target); - my @not_methods = map +( - !ref($_) ? *$_{CODE}||() : reftype($_) eq 'CODE' ? $_ : () - ), values %$stash; - @{$MAKERS{$target}{not_methods}={}}{@not_methods} = @not_methods; + $MAKERS{$target}{non_methods} = { + map +($_ => \&{"${target}::${_}"}), + grep exists &{"${target}::${_}"}, + grep !/::\z/ && !/\A\(/, + keys %$stash + }; + $MAKERS{$target}{is_class} = 1; { no strict 'refs'; @@ -105,7 +105,7 @@ sub unimport { my $target = caller; - _unimport_coderefs($target, $MAKERS{$target}); + _unimport_coderefs($target); } sub _set_superclasses { @@ -234,18 +234,28 @@ sub _concrete_methods_of { my ($me, $class) = @_; my $makers = $MAKERS{$class}; - # grab class symbol table + + my $non_methods = $makers->{non_methods} || {}; 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 + + my $subs = { map {; no strict 'refs'; - my $code = exists &{"${class}::$_"} ? \&{"${class}::$_"} : undef; - ( ! $code or exists $not_methods->{$code} ) ? () : ($_ => $code) - } grep +(!ref($stash->{$_}) || reftype($stash->{$_}) eq 'CODE'), keys %$stash + ${"${class}::${_}"} = ${"${class}::${_}"}; + ($_ => \&{"${class}::${_}"}); + } + grep exists &{"${class}::${_}"}, + grep !/::\z/, + keys %$stash + }; + + my %tracked = map +($_ => 1), _check_tracked($class, [ keys %$subs ]); + + return { + map +($_ => \&{"${class}::${_}"}), + grep !($non_methods->{$_} && $non_methods->{$_} == $subs->{$_}), + grep !exists $tracked{$_}, + keys %$subs }; } @@ -314,7 +324,8 @@ C avoids depending on any XS modules to allow for simple deployments. The name C is based on the idea that it provides almost -- but not quite -- -two thirds of L. +two thirds of L. As such, the L can serve as an effective +guide to C aside from the MOP and Types sections. Unlike L this module does not aim at full compatibility with L's surface syntax, preferring instead to provide full interoperability @@ -404,7 +415,7 @@ L. For a full explanation, see the article -L which explains +L which explains the differing strategies in more detail and provides a direct example of where L succeeds and L fails. @@ -893,9 +904,17 @@ 1; -If you were to import C after L you would -be able to call C<< ->md5_hex() >> on your C instances (and it -probably wouldn't do what you expect!). +For example if you were to import these subroutines after +L like this + + use namespace::clean; + + use Digest::MD5 qw(md5_hex); + use Moo; + +then any C C<$r> would have methods such as C<< $r->md5_hex() >>, +C<< $r->has() >> and C<< $r->around() >> - almost certainly not what you +intend! Ls behave slightly differently. Since their methods are composed into the consuming class, they can do a little more for you @@ -911,6 +930,8 @@ =head1 INCOMPATIBILITIES WITH MOOSE +=head2 TYPES + There is no built-in type system. C is verified with a coderef; if you need complex types, L can provide types, type libraries, and will work seamlessly with both L and L. L can be @@ -920,18 +941,12 @@ use Types::Standard qw(Int); has days_to_live => (is => 'ro', isa => Int); +=head2 API INCOMPATIBILITIES + C is not supported in core since the author considers it to be a bad idea and Moose best practices recommend avoiding it. Meanwhile C or C are more likely to be able to fulfill your needs. -There is no meta object. If you need this level of complexity you need -L - Moo is small because it explicitly does not provide a metaprotocol. -However, if you load L, then - - Class::MOP::class_of($moo_class_or_role) - -will return an appropriate metaclass pre-populated by L. - No support for C, C, C, or C - the author considers augment to be a bad idea, and override can be translated: @@ -950,7 +965,7 @@ The C method is not provided by default. The author suggests loading L into C (via C for example) and -using C<$obj-E$::Dwarn()> instead. +using C<< $obj->$::Dwarn() >> instead. L only supports coderefs and plain scalars, because passing a hash or array reference as a default is almost always incorrect since the value is @@ -1001,6 +1016,18 @@ use warnings FATAL => "all"; use MooseX::AttributeShortcuts; +=head2 META OBJECT + +There is no meta object. If you need this level of complexity you need +L - Moo is small because it explicitly does not provide a metaprotocol. +However, if you load L, then + + Class::MOP::class_of($moo_class_or_role) + +will return an appropriate metaclass pre-populated by L. + +=head2 IMMUTABILITY + Finally, Moose requires you to call __PACKAGE__->meta->make_immutable; @@ -1014,15 +1041,10 @@ =head1 SUPPORT -Users' IRC: #moose on irc.perl.org - -=for :html -L<(click for instant chatroom login)|http://chat.mibbit.com/#moose@irc.perl.org> - -Development and contribution IRC: #web-simple on irc.perl.org +IRC: #moose on irc.perl.org =for :html -L<(click for instant chatroom login)|http://chat.mibbit.com/#web-simple@irc.perl.org> +L<(click for instant chatroom login)|https://chat.mibbit.com/#moose@irc.perl.org> Bugtracker: L @@ -1078,6 +1100,6 @@ =head1 LICENSE This library is free software and may be distributed under the same terms -as perl itself. See L. +as perl itself. See L. =cut diff -Nru libmoo-perl-2.003004/LICENSE libmoo-perl-2.003006/LICENSE --- libmoo-perl-2.003004/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ libmoo-perl-2.003006/LICENSE 2019-10-25 11:21:38.000000000 +0000 @@ -0,0 +1,374 @@ +Terms of the Perl programming language system itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2019 by mst - Matt S. Trout (cpan:MSTROUT) . + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2019 by mst - Matt S. Trout (cpan:MSTROUT) . + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff -Nru libmoo-perl-2.003004/Makefile.PL libmoo-perl-2.003006/Makefile.PL --- libmoo-perl-2.003004/Makefile.PL 2017-11-29 13:29:26.000000000 +0000 +++ libmoo-perl-2.003006/Makefile.PL 2019-10-25 11:18:14.000000000 +0000 @@ -13,45 +13,44 @@ } }, test => { requires => { - 'Test::More' => 0.94, - 'Test::Fatal' => 0.003, + 'Test::More' => '0.94', + 'Test::Fatal' => '0.003', }, recommends => { - 'CPAN::Meta' => 0, - 'CPAN::Meta::Requirements' => 0, + 'Parse::CPAN::Meta' => '1.4200', + 'CPAN::Meta::Requirements' => 0, }, }, runtime => { requires => { - 'Class::Method::Modifiers' => 1.10, # for RT#80194 - 'Module::Runtime' => 0.014, # for RT#86394 - 'Role::Tiny' => 2.000004, - 'Devel::GlobalDestruction' => 0.11, # for RT#78617 - 'Scalar::Util' => 0, - 'perl' => 5.006, - 'Exporter' => 5.57, # Import 'import' - 'Sub::Quote' => 2.003001, - 'Sub::Defer' => 2.003001, + 'Class::Method::Modifiers' => '1.10', # for RT#80194 + 'Module::Runtime' => '0.014', # for RT#86394 + 'Role::Tiny' => '2.001004', + 'Scalar::Util' => '1.09', + 'perl' => '5.006', + 'Exporter' => '5.57', # Import 'import' + 'Sub::Quote' => '2.006006', + 'Sub::Defer' => '2.006006', }, recommends => { - 'Class::XSAccessor' => 1.18, - 'Sub::Name' => 0.08, - 'strictures' => 2, + 'Class::XSAccessor' => '1.18', + 'Sub::Name' => '0.08', + 'strictures' => '2', }, }, develop => { requires => { - 'strictures' => 2, - 'indirect' => 0, - 'multidimensional' => 0, - 'bareword::filehandles' => 0, - 'Moose' => 0, - 'Mouse' => 0, - 'namespace::clean' => 0, - 'namespace::autoclean' => 0, - 'MooseX::Types::Common::Numeric' => 0, - 'Type::Tiny' => 0, - 'Class::Tiny' => 1.001, + 'strictures' => '2', + 'bareword::filehandles' => 0, + 'indirect' => 0, + 'multidimensional' => 0, + 'Class::Tiny' => '1.001', + 'Moose' => '1.15', + 'MooseX::Types::Common::Numeric' => 0, + 'Mouse' => 0, + 'namespace::autoclean' => 0, + 'namespace::clean' => 0, + 'Type::Tiny' => '0.004', }, }, }, @@ -66,7 +65,7 @@ web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Moo', mailto => 'bug-Moo@rt.cpan.org', }, - license => [ 'http://dev.perl.org/licenses/' ], + license => [ 'https://dev.perl.org/licenses/' ], }, no_index => { directory => [ 't', 'xt' ] @@ -86,11 +85,21 @@ } }, ); +my $xt = $ENV{EXTENDED_TESTING}; my %MM_ARGS = ( PREREQ_PM => { ("$]" >= 5.008_000 ? () : ('Task::Weaken' => 0)), ("$]" >= 5.010_000 ? () : ('MRO::Compat' => 0)), + ("$]" >= 5.014_000 ? () : ('Devel::GlobalDestruction' => 0.11)), }, + ($xt ? ( + TEST_REQUIRES => { + %{ $META{prereqs}{runtime}{recommends} }, + %{ $META{prereqs}{test}{recommends} }, + %{ $META{prereqs}{develop}{requires} }, + }, + test => { TESTS => 't/*.t xt/*.t' }, + ):()), ); { @@ -103,13 +112,21 @@ } sub postamble { - my $MOO_TEST_ENV = !-f 'META.yml' ? "MOO_FATAL_WARNINGS" : ''; - <<"POSTAMBLE"; + my $MOO_TEST_ENV = (!-f 'META.yml' || $xt) ? "MOO_FATAL_WARNINGS" : ''; + ($xt ? <<"XT" : '') +test :: test_no_xs +XT + .<<"POSTAMBLE" MOO_TEST_ENV=$MOO_TEST_ENV fulltest: test test_no_xs -test_no_xs: pure_all -\t\$(NOECHO)\$(MAKE) test MOO_TEST_ENV="\$(MOO_TEST_ENV),MOO_XS_DISABLE" +\t\$(NOECHO) \$(NOOP) +test_no_xs: \$(TEST_TYPE)_no_xs +\t\$(NOECHO) \$(NOOP) POSTAMBLE + .join('', map <<"TEST_TYPE", 'dynamic', 'static', '') +test_${_}_no_xs: pure_all +\t\$(NOECHO)\$(MAKE) test_$_ MOO_TEST_ENV="\$(MOO_TEST_ENV),MOO_XS_DISABLE" +TEST_TYPE } } diff -Nru libmoo-perl-2.003004/MANIFEST libmoo-perl-2.003006/MANIFEST --- libmoo-perl-2.003004/MANIFEST 2017-12-01 01:47:58.000000000 +0000 +++ libmoo-perl-2.003006/MANIFEST 2019-10-25 11:21:39.000000000 +0000 @@ -67,11 +67,13 @@ t/long-package-name.t t/method-generate-accessor.t t/method-generate-constructor.t +t/modifiers.t t/modify_lazy_handlers.t t/moo-accessors.t t/moo-c3.t t/moo-object.t t/moo-utils-_name_coderef.t +t/moo-utils-_subname-Sub-Name.t t/moo-utils-_subname.t t/moo-utils.t t/moo.t @@ -84,7 +86,6 @@ t/not-methods.t t/overloaded-coderefs.t t/overridden-core-funcs.t -t/perl-56-like.t t/strictures.t t/sub-and-handles.t t/subconstructor.t @@ -141,6 +142,8 @@ xt/type-inflate.t xt/type-tiny-coerce.t xt/withautoclean.t +xt/zzz-prereq-versions.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) README README file (added by Distar) +LICENSE LICENSE file (added by Distar) diff -Nru libmoo-perl-2.003004/META.json libmoo-perl-2.003006/META.json --- libmoo-perl-2.003004/META.json 2017-12-01 01:47:57.000000000 +0000 +++ libmoo-perl-2.003006/META.json 2019-10-25 11:21:38.000000000 +0000 @@ -4,7 +4,7 @@ "mst - Matt S. Trout (cpan:MSTROUT) " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.38, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -31,10 +31,10 @@ "develop" : { "requires" : { "Class::Tiny" : "1.001", - "Moose" : "0", + "Moose" : "1.15", "MooseX::Types::Common::Numeric" : "0", "Mouse" : "0", - "Type::Tiny" : "0", + "Type::Tiny" : "0.004", "bareword::filehandles" : "0", "indirect" : "0", "multidimensional" : "0", @@ -50,21 +50,20 @@ "strictures" : "2" }, "requires" : { - "Class::Method::Modifiers" : "1.1", - "Devel::GlobalDestruction" : "0.11", + "Class::Method::Modifiers" : "1.10", "Exporter" : "5.57", "Module::Runtime" : "0.014", - "Role::Tiny" : "2.000004", - "Scalar::Util" : "0", - "Sub::Defer" : "2.003001", - "Sub::Quote" : "2.003001", + "Role::Tiny" : "2.001004", + "Scalar::Util" : "1.09", + "Sub::Defer" : "2.006006", + "Sub::Quote" : "2.006006", "perl" : "5.006" } }, "test" : { "recommends" : { - "CPAN::Meta" : "0", - "CPAN::Meta::Requirements" : "0" + "CPAN::Meta::Requirements" : "0", + "Parse::CPAN::Meta" : "1.4200" }, "requires" : { "Test::Fatal" : "0.003", @@ -79,7 +78,7 @@ "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Moo" }, "license" : [ - "http://dev.perl.org/licenses/" + "https://dev.perl.org/licenses/" ], "repository" : { "type" : "git", @@ -88,7 +87,7 @@ }, "x_IRC" : "irc://irc.perl.org/#moose" }, - "version" : "2.003004", + "version" : "2.003006", "x_authority" : "cpan:MSTROUT", "x_breaks" : { "App::Commando" : "<= 0.012", @@ -104,5 +103,5 @@ "use_warnings" : "internal module used to apply warnings" } }, - "x_serialization_backend" : "JSON::PP version 2.94" + "x_serialization_backend" : "JSON::PP version 4.04" } diff -Nru libmoo-perl-2.003004/META.yml libmoo-perl-2.003006/META.yml --- libmoo-perl-2.003004/META.yml 2017-12-01 01:47:55.000000000 +0000 +++ libmoo-perl-2.003006/META.yml 2019-10-25 11:21:37.000000000 +0000 @@ -8,7 +8,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.38, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -23,21 +23,20 @@ Sub::Name: '0.08' strictures: '2' requires: - Class::Method::Modifiers: '1.1' - Devel::GlobalDestruction: '0.11' + Class::Method::Modifiers: '1.10' Exporter: '5.57' Module::Runtime: '0.014' - Role::Tiny: '2.000004' - Scalar::Util: '0' - Sub::Defer: '2.003001' - Sub::Quote: '2.003001' + Role::Tiny: '2.001004' + Scalar::Util: '1.09' + Sub::Defer: '2.006006' + Sub::Quote: '2.006006' perl: '5.006' resources: IRC: irc://irc.perl.org/#moose bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Moo - license: http://dev.perl.org/licenses/ + license: https://dev.perl.org/licenses/ repository: https://github.com/moose/Moo.git -version: '2.003004' +version: '2.003006' x_authority: cpan:MSTROUT x_breaks: App::Commando: '<= 0.012' diff -Nru libmoo-perl-2.003004/README libmoo-perl-2.003006/README --- libmoo-perl-2.003004/README 2017-12-01 01:47:58.000000000 +0000 +++ libmoo-perl-2.003006/README 2019-10-25 11:21:38.000000000 +0000 @@ -53,7 +53,9 @@ "Moo" avoids depending on any XS modules to allow for simple deployments. The name "Moo" is based on the idea that it provides almost - -- but not quite -- two thirds of Moose. + -- but not quite -- two thirds of Moose. As such, the Moose::Manual can + serve as an effective guide to "Moo" aside from the MOP and Types + sections. Unlike Mouse this module does not aim at full compatibility with Moose's surface syntax, preferring instead to provide full interoperability via @@ -136,7 +138,7 @@ using Moo. For a full explanation, see the article - which + which explains the differing strategies in more detail and provides a direct example of where Moo succeeds and Any::Moose fails. @@ -598,9 +600,16 @@ 1; - If you were to import "md5_hex" after namespace::clean you would be able - to call "->md5_hex()" on your "Record" instances (and it probably - wouldn't do what you expect!). + For example if you were to import these subroutines after + namespace::clean like this + + use namespace::clean; + + use Digest::MD5 qw(md5_hex); + use Moo; + + then any "Record" $r would have methods such as "$r->md5_hex()", + "$r->has()" and "$r->around()" - almost certainly not what you intend! Moo::Roles behave slightly differently. Since their methods are composed into the consuming class, they can do a little more for you @@ -615,6 +624,7 @@ are using version 0.16 or newer. INCOMPATIBILITIES WITH MOOSE + TYPES There is no built-in type system. "isa" is verified with a coderef; if you need complex types, Type::Tiny can provide types, type libraries, and will work seamlessly with both Moo and Moose. Type::Tiny can be @@ -624,18 +634,11 @@ use Types::Standard qw(Int); has days_to_live => (is => 'ro', isa => Int); + API INCOMPATIBILITIES "initializer" is not supported in core since the author considers it to be a bad idea and Moose best practices recommend avoiding it. Meanwhile "trigger" or "coerce" are more likely to be able to fulfill your needs. - There is no meta object. If you need this level of complexity you need - Moose - Moo is small because it explicitly does not provide a - metaprotocol. However, if you load Moose, then - - Class::MOP::class_of($moo_class_or_role) - - will return an appropriate metaclass pre-populated by Moo. - No support for "super", "override", "inner", or "augment" - the author considers augment to be a bad idea, and override can be translated: @@ -706,6 +709,16 @@ use warnings FATAL => "all"; use MooseX::AttributeShortcuts; + META OBJECT + There is no meta object. If you need this level of complexity you need + Moose - Moo is small because it explicitly does not provide a + metaprotocol. However, if you load Moose, then + + Class::MOP::class_of($moo_class_or_role) + + will return an appropriate metaclass pre-populated by Moo. + + IMMUTABILITY Finally, Moose requires you to call __PACKAGE__->meta->make_immutable; @@ -718,9 +731,7 @@ by providing a more Moose-like interface. SUPPORT - Users' IRC: #moose on irc.perl.org - - Development and contribution IRC: #web-simple on irc.perl.org + IRC: #moose on irc.perl.org Bugtracker: @@ -773,5 +784,5 @@ LICENSE This library is free software and may be distributed under the same - terms as perl itself. See . + terms as perl itself. See . diff -Nru libmoo-perl-2.003004/t/croak-locations.t libmoo-perl-2.003006/t/croak-locations.t --- libmoo-perl-2.003004/t/croak-locations.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/croak-locations.t 2019-09-18 14:26:37.000000000 +0000 @@ -268,4 +268,16 @@ Moo::Role->apply_roles_to_object($o, "${PACKAGE}::Role"); END_CODE +location_ok <<'END_CODE', 'Method::Generate::DemolishAll - user croak'; +use Carp qw(croak); +use Moo; +sub DEMOLISH { + croak "demolish" unless $_[0]->{demolished}++; +} +my $o = $PACKAGE->new; +package Elsewhere; +# object destruction normally can't throw, so run this manually +$o->DESTROY; +END_CODE + done_testing; diff -Nru libmoo-perl-2.003004/t/has-plus.t libmoo-perl-2.003006/t/has-plus.t --- libmoo-perl-2.003004/t/has-plus.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/has-plus.t 2019-09-18 14:26:37.000000000 +0000 @@ -98,4 +98,20 @@ is +ExtendsBuilderSub->new->f, 'ExtendsBuilderSub', 'correct build sub used after +attr'; +{ + package HasDefault; + use Moo; + has guff => (is => 'ro', default => sub { 'guff' }); +} + +{ + package ExtendsWithBuilder; + use Moo; + extends 'HasDefault'; + has '+guff' => (builder => sub { 'welp' }); +} + +is +ExtendsWithBuilder->new->guff, 'welp', + 'builder can override default'; + done_testing; diff -Nru libmoo-perl-2.003004/t/method-generate-accessor.t libmoo-perl-2.003006/t/method-generate-accessor.t --- libmoo-perl-2.003004/t/method-generate-accessor.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/method-generate-accessor.t 2019-09-18 14:26:37.000000000 +0000 @@ -6,13 +6,27 @@ use Sub::Quote 'quote_sub'; use Sub::Defer (); -my $gen = Method::Generate::Accessor->new; +my $gen; +BEGIN { + $gen = Method::Generate::Accessor->new; +} { package Foo; use Moo; } +BEGIN { + # lie about overload.pm just in case + local $INC{'overload.pm'}; + delete $INC{'overload.pm'}; + my $c = bless {}, 'Gorf'; + like( + exception { $gen->generate_method('Foo' => 'gorf' => { is => 'ro', coerce => $c } ) }, + qr/^Invalid coerce '\Q$c\E' for Foo->gorf /, "coerce - object rejected (before overload loaded)" + ); +} + { package WithOverload; use overload '&{}' => sub { sub { 5 } }, fallback => 1; diff -Nru libmoo-perl-2.003004/t/modifiers.t libmoo-perl-2.003006/t/modifiers.t --- libmoo-perl-2.003004/t/modifiers.t 1970-01-01 00:00:00.000000000 +0000 +++ libmoo-perl-2.003006/t/modifiers.t 2019-09-18 14:26:37.000000000 +0000 @@ -0,0 +1,42 @@ +use Moo::_strictures; +use Test::More; + +{ + package SomeObject; + use Moo; + use Sub::Defer qw(defer_sub); + + my $gen = 0; + defer_sub 'SomeObject::deferred_sub' => sub { + $gen++; + sub { 1 }; + }; + + after deferred_sub => sub { + 1; + }; + + ::is $gen, 1, + 'applying modifier undefers subs'; + + + my $gen_multi = 0; + defer_sub 'SomeObject::deferred_sub_guff' => sub { + $gen_multi++; + sub { 1 }; + }; + + defer_sub 'SomeObject::deferred_sub_wark' => sub { + $gen_multi++; + sub { 1 }; + }; + + after [qw(deferred_sub_guff deferred_sub_wark)] => sub { + 1; + }; + + ::is $gen_multi, 2, + 'applying modifier to multiple subs undefers'; +} + +done_testing; diff -Nru libmoo-perl-2.003004/t/moo-utils-_subname-Sub-Name.t libmoo-perl-2.003006/t/moo-utils-_subname-Sub-Name.t --- libmoo-perl-2.003004/t/moo-utils-_subname-Sub-Name.t 1970-01-01 00:00:00.000000000 +0000 +++ libmoo-perl-2.003006/t/moo-utils-_subname-Sub-Name.t 2019-09-18 14:26:37.000000000 +0000 @@ -0,0 +1,27 @@ +use Moo::_strictures; +use lib 't/lib'; +use InlineModule + 'Sub::Name' => <<'END_SN', +package Sub::Name; +use strict; +use warnings; + +sub subname { + $::sub_name_run++; + return $_[1]; +} + +1; +END_SN + 'Sub::Util' => undef, +; +use Test::More; + +use Moo::_Utils (); + +$::sub_name_run = 0; +my $sub = Moo::_Utils::_subname 'Some::Sub', sub { 5 }; +is $sub->(), 5, '_subname runs with Sub::Name'; +is $::sub_name_run, 1, '_subname uses Sub::Name::subname'; + +done_testing; diff -Nru libmoo-perl-2.003004/t/moo-utils.t libmoo-perl-2.003006/t/moo-utils.t --- libmoo-perl-2.003004/t/moo-utils.t 2017-11-29 13:29:26.000000000 +0000 +++ libmoo-perl-2.003006/t/moo-utils.t 2019-09-18 14:26:37.000000000 +0000 @@ -1,7 +1,9 @@ use Moo::_strictures; use Test::More; use Test::Fatal; -use Moo::_Utils; +use Moo::_Utils qw( + _maybe_load_module +); use lib 't/lib'; use InlineModule ( 'Broken::Class' => q{ diff -Nru libmoo-perl-2.003004/t/no-moo.t libmoo-perl-2.003006/t/no-moo.t --- libmoo-perl-2.003004/t/no-moo.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/no-moo.t 2019-10-02 11:40:20.000000000 +0000 @@ -103,4 +103,22 @@ is($GlobalConflict2::after, "has!", 'package global left alone'); +{ + package WrappedHas; + use Moo; + + BEGIN { + after has => sub { + 1; + }; + } + + has welp => (is => 'ro'); + + no Moo; +} + +is +WrappedHas->can('has'), undef, + 'has with modifier applied is cleaned'; + done_testing; diff -Nru libmoo-perl-2.003004/t/not-methods.t libmoo-perl-2.003006/t/not-methods.t --- libmoo-perl-2.003004/t/not-methods.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/not-methods.t 2019-10-11 17:33:47.000000000 +0000 @@ -4,14 +4,16 @@ BEGIN { package FooClass; sub early { 1 } + sub early_constant { 2 } use Moo; sub late { 2 } + sub late_constant { 2 } } BEGIN { is_deeply [sort keys %{Moo->_concrete_methods_of('FooClass')}], - [qw(late)], + [qw(late late_constant)], 'subs created before use Moo are not methods'; } @@ -61,4 +63,24 @@ 'only same subrefs created before use Moo::Role are not methods'; } +SKIP: { + skip 'code refs directly in the stash not stable until perl 5.26.1', 1 + unless "$]" >= 5.026001; + + eval '#line '.(__LINE__).' "'.__FILE__.qq["\n].q{ + package Gwaf; + BEGIN { $Gwaf::{foo} = sub { 'foo' }; } + use constant plorp => 1; + use Moo; + BEGIN { $Gwaf::{frab} = sub { 'frab' }; } + use constant terg => 1; + 1; + } or die $@; + + is_deeply + [sort keys %{Moo->_concrete_methods_of('Gwaf')}], + [qw(frab terg)], + 'subrefs stored directly in stash treated the same as those with globs'; +} + done_testing; diff -Nru libmoo-perl-2.003004/t/perl-56-like.t libmoo-perl-2.003006/t/perl-56-like.t --- libmoo-perl-2.003004/t/perl-56-like.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/perl-56-like.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -use B (); -BEGIN { delete $B::{perlstring} }; -use Moo::_strictures; -use Test::More; -use Test::Fatal; - -{ - package MyClass; - use Moo; - my $string = join('', "\x00" .. "\x7F"); - has foo => (is => 'ro', default => $string); - ::is +__PACKAGE__->new->foo, $string, - "can quote arbitrary strings 5.6 style"; -} - -done_testing; diff -Nru libmoo-perl-2.003004/t/zzz-check-breaks.t libmoo-perl-2.003006/t/zzz-check-breaks.t --- libmoo-perl-2.003004/t/zzz-check-breaks.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/t/zzz-check-breaks.t 2019-10-21 14:22:43.000000000 +0000 @@ -2,27 +2,34 @@ use warnings; use Test::More; -my $meta_file; +my $meta; BEGIN { - eval { require CPAN::Meta } - or plan skip_all => 'CPAN::Meta required for checking breakages'; + eval { require Parse::CPAN::Meta; Parse::CPAN::Meta->VERSION(1.4200) } + or plan skip_all => 'Parse::CPAN::Meta required for checking breakages'; eval { require CPAN::Meta::Requirements } or plan skip_all => 'CPAN::Meta::Requirements required for checking breakages'; - ($meta_file) = grep -f, qw(MYMETA.json MYMETA.yml META.json META.yml) + my @meta_files = grep -f, qw(MYMETA.json MYMETA.yml META.json META.yml) or plan skip_all => 'no META file exists'; + for my $meta_file (@meta_files) { + eval { $meta = Parse::CPAN::Meta->load_file($meta_file) } + and last; + } + if (!$meta) { + plan skip_all => 'unable to load any META files'; + } } use ExtUtils::MakeMaker; -use Module::Runtime qw(module_notional_filename); -my $meta = CPAN::Meta->load_file($meta_file)->as_struct; -my $req = CPAN::Meta::Requirements->from_string_hash( $meta->{x_breaks} ); +my $breaks = $meta->{x_breaks}; +my $req = CPAN::Meta::Requirements->from_string_hash( $breaks ); pass 'checking breakages...'; my @breaks; for my $module ($req->required_modules) { - my ($pm_file) = grep -e, map $_.'/'.module_notional_filename($module), @INC; + (my $file = "$module.pm") =~ s{::}{/}g; + my ($pm_file) = grep -e, map "$_/$file", @INC; next unless $pm_file; my $version = MM->parse_version($pm_file); @@ -30,7 +37,7 @@ unless defined $version; (my $check_version = $version) =~ s/_//; if ($req->accepts_module($module, $version)) { - my $broken_v = $req->requirements_for_module($module); + my $broken_v = $breaks->{$module}; $broken_v = ">= $broken_v" unless $broken_v =~ /\A\s*(?:==|>=|>|<=|<|!=)/; push @breaks, [$module, $check_version, $broken_v]; diff -Nru libmoo-perl-2.003004/xt/moo-extend-moose.t libmoo-perl-2.003006/xt/moo-extend-moose.t --- libmoo-perl-2.003004/xt/moo-extend-moose.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/xt/moo-extend-moose.t 2019-09-18 14:26:37.000000000 +0000 @@ -43,4 +43,17 @@ ok +MooChild->meta->does_role('MooseRole'); ok +MooChild->does('MooseRole'); +{ + my $meta = Moose::Meta::Class->initialize('MooseClassByMeta'); + + package WithWuff; + use Moo; + + ::is ::exception { + extends 'MooseClassByMeta'; + }, undef, + 'extends will allow empty Moose roles with no %INC entry'; +} + + done_testing; diff -Nru libmoo-perl-2.003004/xt/moose-inflate-error-recurse.t libmoo-perl-2.003006/xt/moose-inflate-error-recurse.t --- libmoo-perl-2.003004/xt/moose-inflate-error-recurse.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/xt/moose-inflate-error-recurse.t 2019-10-14 14:36:24.000000000 +0000 @@ -52,10 +52,20 @@ has ftw => (is => 'ro', traits => [ 'WTF' ]); } +# avoiding Test::Fatal, because it checks exceptions for truth and that can +# cause more exceptions in this case. Prefer to trigger stringification +# manually here. + +my $e; +eval { + WTF::Class->meta->get_attribute('ftw'); + 1; +} or $e = $@; + +$e = "$e"; + like( - exception { - WTF::Class->meta->get_attribute('ftw'); - }, + $e, qr/Attribute \(wtf\) is required/, 'reasonable error rather than deep recursion for inflating invalid attr (traits)', ); diff -Nru libmoo-perl-2.003004/xt/test-my-dependents.t libmoo-perl-2.003006/xt/test-my-dependents.t --- libmoo-perl-2.003004/xt/test-my-dependents.t 2017-11-21 16:57:44.000000000 +0000 +++ libmoo-perl-2.003006/xt/test-my-dependents.t 2019-09-20 11:27:22.000000000 +0000 @@ -1,3 +1,5 @@ +use strict; +use warnings; use Test::More; BEGIN { plan skip_all => <<'END_HELP' unless $ENV{MOO_TEST_MD} || @ARGV; @@ -19,9 +21,12 @@ } use Test::DependentModules qw( test_module ); -use JSON::PP; -use HTTP::Tiny; -use List::Util (); +BEGIN { + eval { require Cpanel::JSON::XS; Cpane::JSON::XS->import(qw(decode_json encode_json)); } + or + do { require JSON::PP; JSON::PP->import(qw(decode_json encode_json)); } +} +use List::Util qw(uniq); use Cwd (); use Getopt::Long (); use Config; @@ -51,6 +56,9 @@ elsif ($env eq 'all') { $all = 1; } + elsif ($env eq '1') { + $count = 200; + } elsif ($env =~ /^\d+$/) { $count = $env; } @@ -60,32 +68,39 @@ } } -# avoid any modules that depend on these -my @bad_prereqs = qw(Gtk2 Padre Wx); - -my $res = decode_json(HTTP::Tiny->new->post( - 'http://api.metacpan.org/v0/search/reverse_dependencies/Moo', - { content => encode_json({ - query => { - filtered => { - query => { "match_all" => {} }, - filter => { - and => [ - { term => { 'release.status' => 'latest' } }, - { term => { 'release.authorized' => \1 } }, - { not => { filter => { - or => [ - map { { term => { 'dependency.module' => $_ } } } @bad_prereqs, - ], - } } } - ], - }, - }, - }, - size => 5000, - fields => ['distribution', 'provides', 'metadata.provides'], - }) }, -)->{content}); +my %dists; +my $cache_file = 'xt/.dependents.json'; +if (open my $fh, '<', $cache_file) { + if (-M $fh < 1) { + %dists = %{ decode_json(scalar do { local $/; <$fh> }) }; + } +} +if (! %dists) { + my %bad_prereqs = map +($_ => 1), qw(Gtk2 Padre Wx); + require HTTP::Tiny; + my $res = HTTP::Tiny->new->get( + 'https://fastapi.metacpan.org/v1/reverse_dependencies/dist/Moo?size=5000' + ); + if ($res->{success}) { + my $deps = decode_json($res->{content}); + for my $dep ( @{ $deps->{data} } ) { + if (grep exists $bad_prereqs{$_->{module}}, @{ $dep->{dependency} }) { + next; + } + $dists{ $dep->{distribution} } = $dep->{main_module}; + } + if (open my $fh, '>', $cache_file) { + print { $fh } encode_json(\%dists); + close $fh; + } + else { + warn "Unable to write to cache file $cache_file: $!\n"; + } + } + else { + die "Unable to fetch dependents: $res->{status} $res->{reason}\n$res->{content}\n"; + } +} my %bad_dist; my $sec_reason; @@ -120,23 +135,11 @@ my %todo_module; my %skip_module; -my %dists; my @modules; -for my $hit (@{ $res->{hits}{hits} }) { - my $dist = $hit->{fields}{distribution}; +my %module_to_dist; +for my $dist ( keys %dists ) { + my $module = $dists{$dist}; - my $module = (sort { length $a <=> length $b || $a cmp $b } do { - if (my $provides = $hit->{fields}{provides}) { - ref $provides ? @$provides : ($provides); - } - elsif (my $provides = $hit->{fields}{'metadata.provides'}) { - keys %$provides; - } - else { - (my $module = $dist) =~ s/-/::/g; - ($module); - } - })[0]; $todo_module{$module} = $todo{$dist} if exists $todo{$dist}; $skip_module{$module} = $skip{$dist} @@ -144,9 +147,8 @@ if ($dist =~ /^(Task|Bundle|Acme)-/) { $skip_module{$module} = "not testing $1 dist"; } - $dists{$module} = $dist; + $module_to_dist{$module} = $dist; push @modules, $module; - $module; } @modules = sort @modules; @@ -154,12 +156,11 @@ @modules = grep /^MooX(?:$|::)/, @modules; } elsif ( $count ) { - $count = $count == 1 ? 200 : $count; diag(<<"EOF"); Picking $count random dependents to test. Set MOO_TEST_MD=all to test all dependents or MOO_TEST_MD=MooX to test extension modules only. EOF - @modules = grep { !exists $skip_modules{$_} } List::Util::shuffle(@modules); + @modules = grep { !exists $skip_module{$_} } List::Util::shuffle(@modules); @modules = @modules[0 .. $count-1]; } elsif ( @pick ) { @@ -167,7 +168,7 @@ if (my @unknown = grep { !$modules{$_} } @pick) { die "Unknown modules: @unknown"; } - delete @skip_modules{@pick}; + delete @skip_module{@pick}; @modules = @pick; } @@ -197,8 +198,8 @@ if (! $last->{ok}) { my $name = $last->{name}; $name =~ s/\s.*//; - $name =~ s/^\Q$dists{$module}-//; - print { $skip_report } "$dists{$module} # $name\n"; + $name =~ s/^\Q$module_to_dist{$module}-//; + print { $skip_report } "$module_to_dist{$module} # $name\n"; } } } diff -Nru libmoo-perl-2.003004/xt/zzz-prereq-versions.t libmoo-perl-2.003006/xt/zzz-prereq-versions.t --- libmoo-perl-2.003004/xt/zzz-prereq-versions.t 1970-01-01 00:00:00.000000000 +0000 +++ libmoo-perl-2.003006/xt/zzz-prereq-versions.t 2019-10-13 21:59:07.000000000 +0000 @@ -0,0 +1,40 @@ +use strict; +use warnings; +use Test::More; + +my $meta_file; +BEGIN { + $ENV{CONTINUOUS_INTEGRATION} + or plan skip_all => 'Only runs under CONTINUOUS_INTEGRATION'; + eval { require Parse::CPAN::Meta; Parse::CPAN::Meta->VERSION(1.4200) } + or plan skip_all => 'Parse::CPAN::Meta required for checking breakages'; + ($meta_file) = grep -f, qw(MYMETA.json MYMETA.yml META.json META.yml) + or plan skip_all => 'no META file exists'; +} + +use ExtUtils::MakeMaker; + +my $meta = Parse::CPAN::Meta->load_file($meta_file); +my %seen = (perl => 1); +my @prereqs = + sort + grep !$seen{$_}++, + 'Devel::StackTrace', + 'Package::Stash', + 'Package::Stash::XS', + 'Eval::Closure', + map keys %$_, + map values %$_, + values %{$meta->{prereqs}}; + +pass 'reporting prereqs...'; + +for my $module (@prereqs) { + (my $file = "$module.pm") =~ s{::}{/}g; + my ($pm_file) = grep -e, map "$_/$file", @INC; + my $version = $pm_file ? MM->parse_version($pm_file) : 'missing'; + $version = '[undef]' if !defined $version; + diag sprintf "%-40s %s", $module, $version; +} + +done_testing;