Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Data-Printer for openSUSE:Factory checked in at 2023-08-04 15:03:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Data-Printer (Old) and /work/SRC/openSUSE:Factory/.perl-Data-Printer.new.22712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Data-Printer" Fri Aug 4 15:03:19 2023 rev:8 rq:1102206 version:1.001001 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Data-Printer/perl-Data-Printer.changes 2023-01-04 17:55:02.375043396 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Data-Printer.new.22712/perl-Data-Printer.changes 2023-08-04 15:03:27.648294542 +0200 @@ -1,0 +2,16 @@ +Mon Jul 31 03:08:13 UTC 2023 - Tina Müller <[email protected]> + +- updated to 1.001001 + see /usr/share/doc/packages/perl-Data-Printer/Changes + + 1.1.1 2023-07-30 + BUG FIXES: + - explicitly mentions that native perl classes (perl 5.38) do not + have internals. + - 'quiet' now returns the data properly when return_value is 'pass'. + - cope with import and unimport in perl 5.39 UNIVERSAL (Graham Knop) + - fix tie issue (thank you Curtis 'Ovid' Poe for reporting and + Leon Timmermans for providing a patch) + - doc fixes and improvements (Matthias Muth, Elvin Aslanov) + +------------------------------------------------------------------- Old: ---- Data-Printer-1.001000.tar.gz New: ---- Data-Printer-1.001001.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Data-Printer.spec ++++++ --- /var/tmp/diff_new_pack.wdl0Gp/_old 2023-08-04 15:03:28.388299154 +0200 +++ /var/tmp/diff_new_pack.wdl0Gp/_new 2023-08-04 15:03:28.392299180 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Data-Printer # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define cpan_name Data-Printer Name: perl-Data-Printer -Version: 1.001000 +Version: 1.001001 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Colored & full-featured pretty print of Perl data structures and objects ++++++ Data-Printer-1.001000.tar.gz -> Data-Printer-1.001001.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/Changes new/Data-Printer-1.001001/Changes --- old/Data-Printer-1.001000/Changes 2022-12-22 05:11:53.559523306 +0100 +++ new/Data-Printer-1.001001/Changes 2023-07-30 05:43:48.413930012 +0200 @@ -1,5 +1,15 @@ Revision history for Data-Printer +1.1.1 2023-07-30 + BUG FIXES: + - explicitly mentions that native perl classes (perl 5.38) do not + have internals. + - 'quiet' now returns the data properly when return_value is 'pass'. + - cope with import and unimport in perl 5.39 UNIVERSAL (Graham Knop) + - fix tie issue (thank you Curtis 'Ovid' Poe for reporting and + Leon Timmermans for providing a patch) + - doc fixes and improvements (Matthias Muth, Elvin Aslanov) + 1.1.0 2022-12-22 NEW FEATURES: - new option 'coderef_stub' letting you customize what to show on diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/MANIFEST new/Data-Printer-1.001001/MANIFEST --- old/Data-Printer-1.001000/MANIFEST 2022-12-22 05:15:36.000000000 +0100 +++ new/Data-Printer-1.001001/MANIFEST 2023-07-30 05:47:38.000000000 +0200 @@ -15,6 +15,7 @@ lib/Data/Printer/Filter/GenericClass.pm lib/Data/Printer/Filter/GLOB.pm lib/Data/Printer/Filter/HASH.pm +lib/Data/Printer/Filter/OBJECT.pm lib/Data/Printer/Filter/REF.pm lib/Data/Printer/Filter/Regexp.pm lib/Data/Printer/Filter/SCALAR.pm @@ -67,6 +68,7 @@ t/024-tied.t t/025-profiles.t t/026-caller_message.t +t/027-nativeperlclass.t t/100-filter_datetime.t t/101-filter_db.t t/102-filter_digest.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/META.json new/Data-Printer-1.001001/META.json --- old/Data-Printer-1.001000/META.json 2022-12-22 05:15:36.000000000 +0100 +++ new/Data-Printer-1.001001/META.json 2023-07-30 05:47:38.000000000 +0200 @@ -4,7 +4,7 @@ "Breno G. de Oliveira <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -53,6 +53,6 @@ "url" : "https://github.com/garu/Data-Printer" } }, - "version" : "1.001000", - "x_serialization_backend" : "JSON::PP version 4.07" + "version" : "1.001001", + "x_serialization_backend" : "JSON::PP version 4.16" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/META.yml new/Data-Printer-1.001001/META.yml --- old/Data-Printer-1.001000/META.yml 2022-12-22 05:15:36.000000000 +0100 +++ new/Data-Printer-1.001001/META.yml 2023-07-30 05:47:38.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -28,5 +28,5 @@ bugtracker: https://github.com/garu/Data-Printer/issues/ license: http://dev.perl.org/licenses/ repository: https://github.com/garu/Data-Printer -version: '1.001000' +version: '1.001001' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/README.md new/Data-Printer-1.001001/README.md --- old/Data-Printer-1.001000/README.md 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/README.md 2023-07-30 05:42:56.000000000 +0200 @@ -1,7 +1,6 @@ Data::Printer ============= -[](https://travis-ci.org/garu/Data-Printer) [](https://coveralls.io/r/garu/Data-Printer) [](http://badge.fury.io/pl/Data-Printer) @@ -104,7 +103,7 @@ LICENSE AND COPYRIGHT --------------------- -Copyright (C) 2011-2021 Breno G. de Oliveira +Copyright (C) 2011-2023 Breno G. de Oliveira This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/DDP.pm new/Data-Printer-1.001001/lib/DDP.pm --- old/Data-Printer-1.001000/lib/DDP.pm 2022-12-22 05:11:14.000000000 +0100 +++ new/Data-Printer-1.001001/lib/DDP.pm 2023-07-30 05:29:57.000000000 +0200 @@ -5,7 +5,7 @@ BEGIN { push our @ISA, 'Data::Printer'; - our $VERSION = '1.001000'; + our $VERSION = '1.001001'; $VERSION = eval $VERSION; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer/Common.pm new/Data-Printer-1.001001/lib/Data/Printer/Common.pm --- old/Data-Printer-1.001000/lib/Data/Printer/Common.pm 2022-11-21 04:24:09.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer/Common.pm 2023-07-29 06:19:29.000000000 +0200 @@ -11,7 +11,7 @@ sub _filter_category_for { my ($name) = @_; my %core_types = map { $_ => 1 } - qw(SCALAR LVALUE ARRAY HASH REF VSTRING GLOB FORMAT Regexp CODE); + qw(SCALAR LVALUE ARRAY HASH REF VSTRING GLOB FORMAT Regexp CODE OBJECT); return exists $core_types{$name} ? 'type_filters' : 'class_filters'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer/Filter/ARRAY.pm new/Data-Printer-1.001001/lib/Data/Printer/Filter/ARRAY.pm --- old/Data-Printer-1.001000/lib/Data/Printer/Filter/ARRAY.pm 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer/Filter/ARRAY.pm 2023-07-30 05:20:57.000000000 +0200 @@ -79,13 +79,13 @@ my $ref = ref $array_ref->[$idx]; if ($ref) { if ($ref eq 'SCALAR') { - $string .= $ddp->parse(\$array_ref->[$idx]); + $string .= $ddp->parse(\$array_ref->[$idx], tied_parent => !!$tied); } elsif ($ref eq 'REF') { - $string .= $ddp->parse(\$array_ref->[$idx]); + $string .= $ddp->parse(\$array_ref->[$idx], tied_parent => !!$tied); } else { - $string .= $ddp->parse($array_ref->[$idx]); + $string .= $ddp->parse($array_ref->[$idx], tied_parent => !!$tied); } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer/Filter/HASH.pm new/Data-Printer-1.001001/lib/Data/Printer/Filter/HASH.pm --- old/Data-Printer-1.001000/lib/Data/Printer/Filter/HASH.pm 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer/Filter/HASH.pm 2023-07-30 05:20:57.000000000 +0200 @@ -94,12 +94,12 @@ # a '\' in front of them. my $ref = ref $hash_ref->{$key->{raw}}; if ( $ref && $ref eq 'SCALAR' ) { - $string .= $ddp->parse(\$hash_ref->{ $key->{raw} }); + $string .= $ddp->parse(\$hash_ref->{ $key->{raw} }, tied_parent => !!$tied); } elsif ( $ref && $ref ne 'REF' ) { - $string .= $ddp->parse( $hash_ref->{ $key->{raw} }); + $string .= $ddp->parse( $hash_ref->{ $key->{raw} }, tied_parent => !!$tied); } else { - $string .= $ddp->parse(\$hash_ref->{ $key->{raw} }); + $string .= $ddp->parse(\$hash_ref->{ $key->{raw} }, tied_parent => !!$tied); } $string .= $ddp->maybe_colorize($ddp->separator, 'separator') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer/Filter/OBJECT.pm new/Data-Printer-1.001001/lib/Data/Printer/Filter/OBJECT.pm --- old/Data-Printer-1.001000/lib/Data/Printer/Filter/OBJECT.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer/Filter/OBJECT.pm 2023-07-29 05:46:08.000000000 +0200 @@ -0,0 +1,12 @@ +package Data::Printer::Filter::OBJECT; +use strict; +use warnings; +use Data::Printer::Filter; + +filter 'OBJECT' => \&parse; + +sub parse { + return '(opaque object)'; +}; + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer/Object.pm new/Data-Printer-1.001001/lib/Data/Printer/Object.pm --- old/Data-Printer-1.001000/lib/Data/Printer/Object.pm 2022-12-22 04:24:33.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer/Object.pm 2023-07-30 05:18:53.000000000 +0200 @@ -58,6 +58,7 @@ use Data::Printer::Filter::FORMAT; use Data::Printer::Filter::Regexp; use Data::Printer::Filter::CODE; +use Data::Printer::Filter::OBJECT; use Data::Printer::Filter::GenericClass; # create our basic accessors: @@ -363,7 +364,7 @@ my ($self, $props) = @_; # load our core filters (LVALUE is under the 'SCALAR' filter module) - my @core_filters = qw(SCALAR ARRAY HASH REF VSTRING GLOB FORMAT Regexp CODE GenericClass); + my @core_filters = qw(SCALAR ARRAY HASH REF VSTRING GLOB FORMAT Regexp CODE OBJECT GenericClass); foreach my $class (@core_filters) { $self->_load_external_filter($class); } @@ -571,7 +572,7 @@ return @potential_filters; } -# _see($data): marks data as seen if it was never seen it before. +# _see($data): marks data as seen if it was never seen before. # if we are showing refcounts, we return those. Initially we had # this funcionallity separated, but refcounts increase as we find # them again and because of that we were seeing weird refcounting. @@ -589,11 +590,19 @@ return {} unless ref $data; my $id = pack 'J', Scalar::Util::refaddr($data); if (!exists $self->{_seen}{$id}) { - $self->{_seen}{$id} = { + my $entry = { name => $self->current_name, refcount => ($self->show_refcount ? $self->_refcount($data) : 0), }; - return { refcount => $self->{_seen}{$id}->{refcount} }; + # the values returned by tied hashes are temporaries, so we can't + # mark them as 'seen'. Ideally, we'd use something like + # Hash::Util::Fieldhash::register() (see PR#179) and remove entries + # from $self->{_seen} when $data is destroyed. The problem is this + # adds a lot of internal magic to the data we're inspecting (we tried, + # see Issue#75), effectively changing it. So we just ignore them, at + # the risk of missing some circular reference. + $self->{_seen}{$id} = $entry unless $options{tied_parent}; + return { refcount => $entry->{refcount} }; } return { refcount => $self->{_seen}{$id}->{refcount} } if $options{seen_override}; return $self->{_seen}{$id}; @@ -897,7 +906,6 @@ will by default print the second one as a circular reference. When this option is set to true, it will instead resolve the scalar value and keep going. (default: false) - =head2 Array Options =head3 array_max @@ -923,8 +931,7 @@ When set, shows the index number before each array element. (default: 1) - -=head4 Hash Options +=head2 Hash Options =head3 align_hash @@ -1170,7 +1177,7 @@ =head3 class_method When Data::Printer is printing an object, it first looks for a method -named "C<_dataprinter>" and, if one is found, we call it instead of actually +named "C<_data_printer>" and, if one is found, we call it instead of actually parsing the structure. This way, module authors can control how Data::Printer outputs their objects diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/lib/Data/Printer.pm new/Data-Printer-1.001001/lib/Data/Printer.pm --- old/Data-Printer-1.001000/lib/Data/Printer.pm 2022-12-22 05:11:31.000000000 +0100 +++ new/Data-Printer-1.001001/lib/Data/Printer.pm 2023-07-30 05:41:58.000000000 +0200 @@ -5,7 +5,7 @@ use Data::Printer::Common; use Data::Printer::Config; -our $VERSION = '1.001000'; +our $VERSION = '1.001001'; $VERSION = eval $VERSION; my $rc_arguments; @@ -112,9 +112,20 @@ my $caller = caller; my $args_to_use = _fetch_args_with($caller, \%properties); - return if $args_to_use->{quiet}; - my $printer = Data::Printer::Object->new($args_to_use); my $want_value = defined wantarray; + + # return as quickly as possible under 'quiet'. + if ($args_to_use->{quiet}) { + # we avoid creating a Data::Printer::Object instance + # to speed things up, since we don't do anything under 'quiet'. + my $return_type = Data::Printer::Common::_fetch_anyof( + $args_to_use, 'return_value', 'pass', [qw(pass dump void)] + ); + return _handle_output(undef, undef, $want_value, $_[0], $return_type, 1); + } + + my $printer = Data::Printer::Object->new($args_to_use); + if ($printer->colored eq 'auto' && $printer->return_value eq 'dump' && $want_value) { $printer->{_output_color_level} = 0; } @@ -131,7 +142,7 @@ $output = $printer->_write_label . $output; } - return _handle_output($printer, $output, $want_value, $_[0]); + return _handle_output($output, $printer->{output_handle}, $want_value, $_[0], $printer->return_value, undef); } # This is a p() clone without prototypes. Just like regular Data::Dumper, @@ -151,10 +162,20 @@ my $caller = caller; my $args_to_use = _fetch_args_with($caller, \%properties); - return if $args_to_use->{quiet}; + my $want_value = defined wantarray; + + # return as quickly as possible under 'quiet'. + if ($args_to_use->{quiet}) { + # we avoid creating a Data::Printer::Object instance + # to speed things up, since we don't do anything under 'quiet'. + my $return_type = Data::Printer::Common::_fetch_anyof( + $args_to_use, 'return_value', 'pass', [qw(pass dump void)] + ); + return _handle_output(undef, undef, $want_value, $_[0], $return_type, 1); + } + my $printer = Data::Printer::Object->new($args_to_use); - my $want_value = defined wantarray; if ($printer->colored eq 'auto' && $printer->return_value eq 'dump' && $want_value) { $printer->{_output_color_level} = 0; } @@ -172,15 +193,15 @@ $output = $printer->_write_label . $output; } - return _handle_output($printer, $output, $want_value, $_[0]); + return _handle_output($output, $printer->{output_handle}, $want_value, $_[0], $printer->return_value, undef); } sub _handle_output { - my ($printer, $output, $wantarray, $data) = @_; + my ($output, $out_handle, $wantarray, $data, $return_type, $quiet) = @_; - if ($printer->return_value eq 'pass') { - print { $printer->{output_handle} } $output . "\n"; + if ($return_type eq 'pass') { + print { $out_handle } $output . "\n" unless $quiet; require Scalar::Util; my $ref = Scalar::Util::blessed($data); return $data if defined $ref; @@ -201,8 +222,8 @@ return $data; } } - elsif ($printer->return_value eq 'void' || !$wantarray) { - print { $printer->{output_handle} } $output . "\n"; + elsif ($return_type eq 'void' || !$wantarray) { + print { $out_handle} $output . "\n" unless $quiet; return; } else { @@ -327,7 +348,7 @@ =over 4 -=item * Variable dumps designed for I<< easy parsing by the human brain >>, +=item * Variable dumps designed for B<< easy parsing by the human brain >>, not a machine. =back @@ -371,11 +392,18 @@ =over 4 +=item * B<< Full support for dumping perl 5.38 native classes >>. + +=back + +=over 4 + =item * keep your custom settings on a L<< .dataprinter|/The .dataprinter configuration file >> file that allows -B<< different options per module >> being analyzed! You may also create a -custom L<profile|Data::Printer::Profile> class with your preferences and -filters and upload it to CPAN. +B<< different options per module >> being analyzed! You can have +B<< one C<.dataprinter> file per project >>, or default to one in your home +directory. You may also create a custom L<profile|Data::Printer::Profile> class +with your preferences and filters and upload it to CPAN. =back @@ -399,7 +427,8 @@ =over 4 =item * Works on B<< Perl 5.8 and later >>. Because you can't control where -you debug, we try our best to be compatible with all versions of Perl 5. +you debug, we try our best to be compatible with all versions of Perl 5, from +the oldest available to the bleeding edge. =back @@ -932,8 +961,24 @@ =head2 Using Data::Printer in a perl shell (REPL) Some people really enjoy using a REPL shell to quickly try Perl code. One -of the most popular ones out there is L<Devel::REPL>. If you use it, now -you can also see its output with Data::Printer! +of the most popular ones out there are L<Reply> and L<Devel::REPL>. If you +use them, now you can also see its output with Data::Printer! + +=over 4 + +=item * B<Reply> + +=back + +Just install L<Reply::Plugin::DataPrinter> and add a line with +C<< [DataPrinter] >> to your C<.replyrc> file. That's it! Next time +you run the 'reply' REPL, Data::Printer will be used to dump variables! + +=over 4 + +=item * B<Devel::REPL> + +=back Just install L<Devel::REPL::Plugin::DataPrinter> and add the following line to your re.pl configuration file (usually ".re.pl/repl.rc" in your @@ -1061,22 +1106,22 @@ David D Lowe (Flimm), David E. Condon (hhg7), David Golden (xdg), David Precious (bigpresh), David Raab, David E. Wheeler (theory), Damien Krotkine (dams), Denis Howe, dirk, Dotan Dimet, Eden Cardim (edenc), -Elliot Shank (elliotjs), Eugen Konkov (KES777), Fernando Corrêa (SmokeMachine), -Fitz Elliott, Florian (fschlich), Frew Schmidt (frew), GianniGi, -Graham Knop (haarg), Graham Todd, Gregory J. Oschwald, grr, HÃ¥kon Hægland, -Iaroslav O. Kosmina (darviarush), Ivan Bessarabov (bessarabv), J Mash, -James E. Keenan (jkeenan), Jarrod Funnell (Timbus), Jay Allen (jayallen), -Jay Hannah (jhannah), jcop, Jesse Luehrs (doy), Joel Berger (jberger), -John S. Anderson (genehack), Karen Etheridge (ether), -Kartik Thakore (kthakore), Kevin Dawson (bowtie), Kevin McGrath (catlgrep), -Kip Hampton (ubu), Londran, Marcel Grünauer (hanekomu), -Marco Masetti (grubert65), Mark Fowler (Trelane), Martin J. Evans, -Matt S. Trout (mst), Maxim Vuets, Michael Conrad, Mike Doherty (doherty), -Nicolas R (atoomic), Nigel Metheringham (nigelm), Nuba Princigalli (nuba), -Olaf Alders (oalders), Paul Evans (LeoNerd), Pedro Melo (melo), -Philippe Bruhat (BooK), PrzemysÅaw WesoÅek (jest), Rebecca Turner (iarna), -Renato Cron (renatoCRON), Ricardo Signes (rjbs), Rob Hoelz (hoelzro), -Salve J. Nilsen (sjn), sawyer, Sebastian Willing (Sewi), +Elliot Shank (elliotjs), Elvin Aslanov, Eugen Konkov (KES777), +Fernando Corrêa (SmokeMachine), Fitz Elliott, Florian (fschlich), +Frew Schmidt (frew), GianniGi, Graham Knop (haarg), Graham Todd, +Gregory J. Oschwald, grr, HÃ¥kon Hægland, Iaroslav O. Kosmina (darviarush), +Ivan Bessarabov (bessarabv), J Mash, James E. Keenan (jkeenan), +Jarrod Funnell (Timbus), Jay Allen (jayallen), Jay Hannah (jhannah), jcop, +Jesse Luehrs (doy), Joel Berger (jberger), John S. Anderson (genehack), +Karen Etheridge (ether), Kartik Thakore (kthakore), Kevin Dawson (bowtie), +Kevin McGrath (catlgrep), Kip Hampton (ubu), Londran, +Marcel Grünauer (hanekomu), Marco Masetti (grubert65), Mark Fowler (Trelane), +Martin J. Evans, Matthias Muth, Matt S. Trout (mst), Maxim Vuets, Michael Conrad, +Mike Doherty (doherty), Nicolas R (atoomic), Nigel Metheringham (nigelm), +Nuba Princigalli (nuba), Olaf Alders (oalders), Paul Evans (LeoNerd), +Pedro Melo (melo), Philippe Bruhat (BooK), PrzemysÅaw WesoÅek (jest), +Rebecca Turner (iarna), Renato Cron (renatoCRON), Ricardo Signes (rjbs), +Rob Hoelz (hoelzro), Salve J. Nilsen (sjn), sawyer, Sebastian Willing (Sewi), Sébastien Feugère (smonff), Sergey Aleynikov (randir), Slaven ReziÄ, Stanislaw Pusep (syp), Stephen Thirlwall (sdt), sugyan, Tai Paul, Tatsuhiko Miyagawa (miyagawa), Thomas Sibley (tsibley), @@ -1089,7 +1134,7 @@ =head1 LICENSE AND COPYRIGHT -Copyright (C) 2011-2021 Breno G. de Oliveira +Copyright (C) 2011-2023 Breno G. de Oliveira This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/t/011-class.t new/Data-Printer-1.001001/t/011-class.t --- old/Data-Printer-1.001000/t/011-class.t 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/t/011-class.t 2023-07-29 05:03:55.000000000 +0200 @@ -251,25 +251,37 @@ } }', 'testing objects (inherited => "none")' ); -my $universal_DOES = $ddp->can('DOES'); my $sort_class = Data::Printer::Common::_initialize_nsort(); my $has_uc_sort = $sort_class eq 'Sort::Key::Natural'; -my ($n, $public_method_list); -if ($universal_DOES) { - $n = 9; - $public_method_list = $has_uc_sort - ? 'DOES (UNIVERSAL), VERSION (UNIVERSAL), bar (Bar), baz, borg, can (UNIVERSAL), foo, isa (UNIVERSAL), new' - : 'bar (Bar), baz, borg, can (UNIVERSAL), DOES (UNIVERSAL), foo, isa (UNIVERSAL), new, VERSION (UNIVERSAL)' - ; -} -else { - $n = 8; - $public_method_list = $has_uc_sort - ? 'VERSION (UNIVERSAL), bar (Bar), baz, borg, can (UNIVERSAL), foo, isa (UNIVERSAL), new' - : 'bar (Bar), baz, borg, can (UNIVERSAL), foo, isa (UNIVERSAL), new, VERSION (UNIVERSAL)' - ; -} +my @methods = $has_uc_sort ? ( + (defined &UNIVERSAL::DOES ? 'DOES (UNIVERSAL)' : ()), + 'VERSION (UNIVERSAL)', + 'bar (Bar)', + 'baz', + 'borg', + 'can (UNIVERSAL)', + 'foo', + (defined &UNIVERSAL::import ? 'import (UNIVERSAL)' : ()), + 'isa (UNIVERSAL)', + 'new', + (defined &UNIVERSAL::unimport ? 'unimport (UNIVERSAL)' : ()), +) : ( + 'bar (Bar)', + 'baz', + 'borg', + 'can (UNIVERSAL)', + (defined &UNIVERSAL::DOES ? 'DOES (UNIVERSAL)' : ()), + 'foo', + (defined &UNIVERSAL::import ? 'import (UNIVERSAL)' : ()), + 'isa (UNIVERSAL)', + 'new', + (defined &UNIVERSAL::unimport ? 'unimport (UNIVERSAL)' : ()), + 'VERSION (UNIVERSAL)', +); + +my $n = @methods; +my $public_method_list = join ', ', @methods; $ddp = Data::Printer::Object->new( colored => 0, class => { inherited => 'all', universal => 1, format_inheritance => 'string' } ); is( $ddp->parse($object), "Foo { @@ -283,10 +295,21 @@ $ddp = Data::Printer::Object->new( colored => 0, class => { inherited => 'all', universal => 1, format_inheritance => 'lines' } ); -my $universal_methods = $has_uc_sort - ? $universal_DOES ? 'DOES, VERSION, can, isa' : 'VERSION, can, isa' - : $universal_DOES ? 'can, DOES, isa, VERSION' : 'can, isa, VERSION' - ; +my $universal_methods = join ', ', $has_uc_sort ? ( + (defined &UNIVERSAL::DOES ? 'DOES' : ()), + 'VERSION', + 'can', + (defined &UNIVERSAL::import ? 'import' : ()), + 'isa', + (defined &UNIVERSAL::unimport ? 'unimport' : ()), +) : ( + 'can', + (defined &UNIVERSAL::DOES ? 'DOES' : ()), + (defined &UNIVERSAL::import ? 'import' : ()), + 'isa', + (defined &UNIVERSAL::import ? 'unimport' : ()), + 'VERSION', +); is( $ddp->parse($object), "Foo { parents: Bar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/t/011.3-object_pad.t new/Data-Printer-1.001001/t/011.3-object_pad.t --- old/Data-Printer-1.001000/t/011.3-object_pad.t 2022-12-22 05:07:26.000000000 +0100 +++ new/Data-Printer-1.001001/t/011.3-object_pad.t 2023-07-30 05:40:35.000000000 +0200 @@ -13,7 +13,7 @@ 'use Object::Pad 0.60; class TestClass { has $x :param = 42; method one($dX) { } method two { } }' ); skip 'Object::Pad 0.60+ not found', 1 if $error; - + my $ddp = Data::Printer::Object->new( colored => 0, class => { show_reftype => 1 } ); my $obj = TestClass->new( x => 666 ); my $parsed = $ddp->parse($obj); @@ -34,5 +34,3 @@ ); }; } - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/t/024-tied.t new/Data-Printer-1.001001/t/024-tied.t --- old/Data-Printer-1.001000/t/024-tied.t 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/t/024-tied.t 2023-07-30 05:20:57.000000000 +0200 @@ -83,9 +83,40 @@ sub READLINE { return 'foo' } +package Tie::Me::Up; + +sub TIEHASH { + my ($class, $generator) = @_; + return bless { + generator => $generator, + hash => {}, + }, $class; +} + +sub FETCH { + my ($self, $key) = @_; + return $self->{hash}{$key}; +} + +sub STORE { + my ($self, $key, $value) = @_; + $self->{hash}{$key} = $self->{generator}->($value); +} + +sub FIRSTKEY { + my ($self) = @_; + keys %{ $self->{hash} }; # reset each() iterator + each %{ $self->{hash} }; +} + +# lastkey is here for documentation, but we don't use it +sub NEXTKEY { + my ($self, $lastkey) = @_; + return each %{ $self->{hash} }; +} package main; -use Test::More tests => 17; +use Test::More tests => 18; use Data::Printer::Object; my $ddp = Data::Printer::Object->new( colored => 0, seen_override => 1 ); @@ -170,5 +201,13 @@ untie *$var; unlike $ddp->parse(\$var), qr/tied to/, 'cleared (untied) handle again shows no tie information'; +tie my %hash, 'Tie::Me::Up', sub { return scalar reverse $_[0] }; +$hash{first} = '1234'; +$hash{second} = 'ABCD'; +$hash{third} = 'wtf?'; + +my $output = $ddp->parse(\%hash); +unlike $output, qr/var\{\w+\}/, 'No false deduplication'; + __DATA__ test file! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/t/027-nativeperlclass.t new/Data-Printer-1.001001/t/027-nativeperlclass.t --- old/Data-Printer-1.001000/t/027-nativeperlclass.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Data-Printer-1.001001/t/027-nativeperlclass.t 2023-07-30 05:41:05.000000000 +0200 @@ -0,0 +1,63 @@ +use strict; +use warnings; +use Test::More; +use Data::Printer::Object; +use Data::Printer::Common; + +if ($] < 5.038) { + plan skip_all => 'perl native classes only available after 5.38'; + exit; +} + +my $error = Data::Printer::Common::_tryme(<<'EOCODE' + use 5.38.0; + use warnings; + use feature 'class'; + no warnings 'experimental::class'; + + class MyBaseClass { + field $one :param; + field $two; + field $three :param //= 0; + + method base_foo { } + } + + class MyClass :isa(MyBaseClass) { + field $four; + field $five :param = 42; + field $six :param; + field $seven :param(four); + + ADJUST { $four = $five } + + method foo ($x) { + return $x * 2; + } + sub not_a_method { } + }; + + 1; +EOCODE +); + +if ($error) { + plan skip_all => "error creating class: $error"; + exit; +} +plan tests => 1; + +my $obj = MyClass->new( one => 'um', six => 'seis', four => 'quatro' ); + +my $ddp = Data::Printer::Object->new( colored => 0 ); +my $res = $ddp->parse($obj); + +is $res, 'MyClass { + parents: MyBaseClass + public methods (4): + foo, new, not_a_method + MyBaseClass: + base_foo + private methods (0) + internals: (opaque object) +}', 'parsed perl 5.38 native object type'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Data-Printer-1.001000/xt/pod-coverage.t new/Data-Printer-1.001001/xt/pod-coverage.t --- old/Data-Printer-1.001000/xt/pod-coverage.t 2021-03-09 02:38:08.000000000 +0100 +++ new/Data-Printer-1.001001/xt/pod-coverage.t 2023-07-30 05:39:38.000000000 +0200 @@ -5,7 +5,7 @@ my $success = eval "use Test::Pod::Coverage 1.04; 1"; if ($success) { plan tests => 18; - foreach my $m (grep $_ !~ /(?:SCALAR|LVALUE|ARRAY|CODE|VSTRING|REF|GLOB|HASH|FORMAT|GenericClass|Regexp|Common)\z/, all_modules()) { + foreach my $m (grep $_ !~ /(?:SCALAR|LVALUE|ARRAY|CODE|VSTRING|REF|GLOB|HASH|FORMAT|OBJECT|GenericClass|Regexp|Common)\z/, all_modules()) { my $params = {}; if ($m =~ /\AData::Printer::Theme::/) { $params = { also_private => [qr/\Acolors\z/] };
