diff -Nru libfile-remove-perl-1.58/Build.PL libfile-remove-perl-1.60/Build.PL --- libfile-remove-perl-1.58/Build.PL 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/Build.PL 2020-10-22 06:50:23.000000000 +0000 @@ -1,5 +1,5 @@ -# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.012. +# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.015. use strict; use warnings; @@ -19,7 +19,7 @@ "Shlomi Fish " ], "dist_name" => "File-Remove", - "dist_version" => "1.58", + "dist_version" => "1.60", "license" => "perl", "module_name" => "File::Remove", "recursive_test_files" => 1, @@ -29,7 +29,7 @@ "File::Path" => 0, "File::Spec" => "3.29", "constant" => 0, - "perl" => "5.006", + "perl" => "5.008", "strict" => 0, "vars" => 0, "warnings" => 0 @@ -40,8 +40,7 @@ "File::Spec::Functions" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, - "Test::More" => "0.88", - "perl" => "5.006" + "Test::More" => "0.88" } ); @@ -53,8 +52,7 @@ "IO::Handle" => 0, "IPC::Open3" => 0, "Module::Build" => "0.28", - "Test::More" => "0.88", - "perl" => "5.006" + "Test::More" => "0.88" ); diff -Nru libfile-remove-perl-1.58/Changes libfile-remove-perl-1.60/Changes --- libfile-remove-perl-1.58/Changes 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/Changes 2020-10-22 06:50:23.000000000 +0000 @@ -1,5 +1,17 @@ Revision history for Perl extension File-Remove +1.60 2020-10-22 - Shlomi Fish + - Add .tidyallrc + related changes + - Fix mismatched $VERSION. + - https://rt.cpan.org/Public/Bug/Display.html?id=133562 + - https://github.com/shlomif/File-Remove/pull/3/files + - Thanks to William Storey, PMPERRY, and @briang for the report + +1.59 2020-10-16 - Shlomi Fish + - dist.ini / weaver.ini / .tidyallrc / etc. cleanup + - Move to @SHLOMIF + - Inspired by Lady_Aleena. + 1.58 2018-10-04 - Shlomi Fish - Added [MetaJSON] to dist.ini, so releases include a META.json diff -Nru libfile-remove-perl-1.58/debian/changelog libfile-remove-perl-1.60/debian/changelog --- libfile-remove-perl-1.58/debian/changelog 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/changelog 2020-10-25 12:30:36.000000000 +0000 @@ -1,3 +1,23 @@ +libfile-remove-perl (1.60-1) unstable; urgency=medium + + * Import upstream version 1.60 + + -- Salvatore Bonaccorso Sun, 25 Oct 2020 13:30:36 +0100 + +libfile-remove-perl (1.59-1) unstable; urgency=medium + + [ gregor herrmann ] + * debian/watch: use uscan version 4. + + [ Salvatore Bonaccorso ] + * Import upstream version 1.59 + * Bump Debhelper compat level to 13 + * Remove obsolete fields Name, Contact from debian/upstream/metadata + * Declare compliance with Debian policy 4.5.0 + * Update copyright years for debian/* packaging files + + -- Salvatore Bonaccorso Sun, 18 Oct 2020 16:18:07 +0200 + libfile-remove-perl (1.58-1) unstable; urgency=medium [ gregor herrmann ] diff -Nru libfile-remove-perl-1.58/debian/compat libfile-remove-perl-1.60/debian/compat --- libfile-remove-perl-1.58/debian/compat 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -10 diff -Nru libfile-remove-perl-1.58/debian/control libfile-remove-perl-1.60/debian/control --- libfile-remove-perl-1.58/debian/control 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/control 2020-10-25 12:30:36.000000000 +0000 @@ -6,9 +6,9 @@ Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 10), libmodule-build-perl +Build-Depends: debhelper-compat (= 13), libmodule-build-perl Build-Depends-Indep: perl -Standards-Version: 4.2.1 +Standards-Version: 4.5.0 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libfile-remove-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libfile-remove-perl.git Homepage: https://metacpan.org/release/File-Remove diff -Nru libfile-remove-perl-1.58/debian/copyright libfile-remove-perl-1.60/debian/copyright --- libfile-remove-perl-1.58/debian/copyright 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/copyright 2020-10-25 12:30:36.000000000 +0000 @@ -17,7 +17,7 @@ 2008, Rene Mayorga 2008, 2012, gregor herrmann 2009, Iulian Udrea - 2009-2016, Salvatore Bonaccorso + 2009-2020, Salvatore Bonaccorso 2011, Fabrizio Regalli License: Artistic or GPL-1+ diff -Nru libfile-remove-perl-1.58/debian/upstream/metadata libfile-remove-perl-1.60/debian/upstream/metadata --- libfile-remove-perl-1.58/debian/upstream/metadata 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/upstream/metadata 2020-10-25 12:30:36.000000000 +0000 @@ -1,6 +1,5 @@ --- Archive: CPAN Bug-Database: https://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Remove -Contact: Shlomi Fish -Name: File-Remove Repository: https://github.com/shlomif/File-Remove.git +Repository-Browse: https://github.com/shlomif/File-Remove diff -Nru libfile-remove-perl-1.58/debian/watch libfile-remove-perl-1.60/debian/watch --- libfile-remove-perl-1.58/debian/watch 2018-10-04 19:49:00.000000000 +0000 +++ libfile-remove-perl-1.60/debian/watch 2020-10-25 12:30:36.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 -https://metacpan.org/release/File-Remove .*/File-Remove-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) +version=4 +https://metacpan.org/release/File-Remove .*/File-Remove-v?@ANY_VERSION@@ARCHIVE_EXT@$ diff -Nru libfile-remove-perl-1.58/dist.ini libfile-remove-perl-1.60/dist.ini --- libfile-remove-perl-1.58/dist.ini 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/dist.ini 2020-10-22 06:50:23.000000000 +0000 @@ -3,7 +3,7 @@ license = Perl_5 copyright_holder = Gabor Egressy copyright_year = 1998 -version = 1.58 +version = 1.60 [@Filter] -bundle = @SHLOMIF @@ -14,3 +14,4 @@ repository_url = git://github.com/shlomif/File-Remove.git repository_web = https://github.com/shlomif/File-Remove repository_type = git +[Test::TidyAll] diff -Nru libfile-remove-perl-1.58/lib/File/Remove.pm libfile-remove-perl-1.60/lib/File/Remove.pm --- libfile-remove-perl-1.58/lib/File/Remove.pm 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/lib/File/Remove.pm 2020-10-22 06:50:23.000000000 +0000 @@ -1,16 +1,14 @@ package File::Remove; - -use 5.00503; +$File::Remove::VERSION = '1.60'; +use 5.008; use strict; use warnings; use vars qw{ @ISA @EXPORT_OK }; use vars qw{ $DEBUG $unlink $rmdir }; -our $VERSION = '1.58'; - -BEGIN { - # $VERSION = eval $VERSION; +BEGIN +{ @ISA = qw{ Exporter }; @EXPORT_OK = qw{ remove rm clear trash }; } @@ -18,41 +16,40 @@ use File::Path (); use File::Glob (); use File::Spec 3.29 (); -use Cwd 3.29 (); +use Cwd 3.29 (); # $debug variable must be set before loading File::Remove. # Convert to a constant to allow debugging code to be pruned out. -use constant DEBUG => !! $DEBUG; +use constant DEBUG => !!$DEBUG; # Are we on VMS? # If so copy File::Path and assume VMS::Filespec is loaded -use constant IS_VMS => !! ( $^O eq 'VMS' ); +use constant IS_VMS => !!( $^O eq 'VMS' ); # Are we on Mac? # If so we'll need to do some special trash work -use constant IS_MAC => !! ( $^O eq 'darwin' ); +use constant IS_MAC => !!( $^O eq 'darwin' ); # Are we on Win32? # If so write permissions does not imply deletion permissions -use constant IS_WIN32 => !! ( $^O =~ /^MSWin/ or $^O eq 'cygwin' ); +use constant IS_WIN32 => !!( $^O =~ /^MSWin/ or $^O eq 'cygwin' ); # If we ever need a Mac::Glue object we will want to cache it. my $glue; - - - - ##################################################################### # Main Functions my @CLEANUP = (); -sub clear (@) { - my @files = expand( @_ ); +## no critic +sub clear (@) +{ + my @files = expand(@_); # Do the initial deletion - foreach my $file ( @files ) { + foreach my $file (@files) + { next unless -e $file; remove( \1, $file ); } @@ -63,9 +60,12 @@ # live until their end-time. push @CLEANUP, map { [ $$, $_ ] } @files; } +## use critic -END { - foreach my $file ( @CLEANUP ) { +END +{ + foreach my $file (@CLEANUP) + { next unless $file->[0] == $$; next unless -e $file->[1]; remove( \1, $file->[1] ); @@ -75,96 +75,129 @@ # Acts like unlink would until given a directory as an argument, then # it acts like rm -rf ;) unless the recursive arg is zero which it is by # default -sub remove (@) { - my $recursive = (ref $_[0] eq 'SCALAR') ? shift : \0; - my $opts = (ref $_[0] eq 'HASH') ? shift : { glob => 1 }; - my @files = _expand_with_opts ($opts, @_); +## no critic +sub remove (@) +{ + ## use critic + my $recursive = ( ref $_[0] eq 'SCALAR' ) ? shift : \0; + my $opts = ( ref $_[0] eq 'HASH' ) ? shift : { glob => 1 }; + my @files = _expand_with_opts( $opts, @_ ); # Iterate over the files my @removes; - foreach my $path ( @files ) { + foreach my $path (@files) + { # need to check for symlink first # could be pointing to nonexisting/non-readable destination - if ( -l $path ) { + if ( -l $path ) + { print "link: $path\n" if DEBUG; - if ( $unlink ? $unlink->($path) : unlink($path) ) { + if ( $unlink ? $unlink->($path) : unlink($path) ) + { push @removes, $path; } next; } - unless ( -e $path ) { + unless ( -e $path ) + { print "missing: $path\n" if DEBUG; - push @removes, $path; # Say we deleted it + push @removes, $path; # Say we deleted it next; } my $can_delete; - if ( IS_VMS ) { + if (IS_VMS) + { $can_delete = VMS::Filespec::candelete($path); - } elsif ( IS_WIN32 ) { + } + elsif (IS_WIN32) + { # Assume we can delete it for the moment $can_delete = 1; - } elsif ( -w $path ) { + } + elsif ( -w $path ) + { # We have write permissions already $can_delete = 1; - } elsif ( $< == 0 ) { + } + elsif ( $< == 0 ) + { # Unixy and root $can_delete = 1; - } elsif ( (lstat($path))[4] == $< ) { + } + elsif ( ( lstat($path) )[4] == $< ) + { # I own the file $can_delete = 1; - } else { + } + else + { # I don't think we can delete it $can_delete = 0; } - unless ( $can_delete ) { + unless ($can_delete) + { print "nowrite: $path\n" if DEBUG; next; } - if ( -f $path ) { + if ( -f $path ) + { print "file: $path\n" if DEBUG; - unless ( -w $path ) { + unless ( -w $path ) + { # Make the file writable (implementation from File::Path) - (undef, undef, my $rp) = lstat $path or next; - $rp &= 07777; # Don't forget setuid, setgid, sticky bits - $rp |= 0600; # Turn on user read/write + ( undef, undef, my $rp ) = lstat $path or next; + $rp &= 07777; # Don't forget setuid, setgid, sticky bits + $rp |= 0600; # Turn on user read/write chmod $rp, $path; } - if ( $unlink ? $unlink->($path) : unlink($path) ) { + if ( $unlink ? $unlink->($path) : unlink($path) ) + { # Failed to delete the file next if -e $path; push @removes, $path; } - } elsif ( -d $path ) { + } + elsif ( -d $path ) + { print "dir: $path\n" if DEBUG; my $dir = File::Spec->canonpath($path); # Do we need to move our cwd out of the location # we are planning to delete? my $chdir = _moveto($dir); - if ( length $chdir ) { + if ( length $chdir ) + { chdir($chdir) or next; } - if ( $$recursive ) { - if ( File::Path::rmtree( [ $dir ], DEBUG, 0 ) ) { + if ($$recursive) + { + if ( File::Path::rmtree( [$dir], DEBUG, 0 ) ) + { # Failed to delete the directory next if -e $path; push @removes, $path; } - } else { - my ($save_mode) = (stat $dir)[2]; - chmod $save_mode & 0777, $dir; # just in case we cannot remove it. - if ( $rmdir ? $rmdir->($dir) : rmdir($dir) ) { + } + else + { + my ($save_mode) = ( stat $dir )[2]; + chmod $save_mode & 0777, + $dir; # just in case we cannot remove it. + if ( $rmdir ? $rmdir->($dir) : rmdir($dir) ) + { # Failed to delete the directory next if -e $path; push @removes, $path; } } - } else { + } + else + { print "???: $path\n" if DEBUG; } } @@ -172,79 +205,91 @@ return @removes; } -sub rm (@) { +sub rm (@) +{ goto &remove; } -sub trash (@) { +sub trash (@) +{ local $unlink = $unlink; local $rmdir = $rmdir; - if ( ref $_[0] eq 'HASH' ) { - my %options = %{+shift @_}; + if ( ref $_[0] eq 'HASH' ) + { + my %options = %{ +shift @_ }; $unlink = $options{unlink}; $rmdir = $options{rmdir}; - } elsif ( IS_WIN32 ) { + } + elsif (IS_WIN32) + { local $@; eval 'use Win32::FileOp ();'; - die "Can't load Win32::FileOp to support the Recycle Bin: \$@ = $@" if length $@; + die "Can't load Win32::FileOp to support the Recycle Bin: \$@ = $@" + if length $@; $unlink = \&Win32::FileOp::Recycle; $rmdir = \&Win32::FileOp::Recycle; - } elsif ( IS_MAC ) { - unless ( $glue ) { + } + elsif (IS_MAC) + { + unless ($glue) + { local $@; eval 'use Mac::Glue ();'; - die "Can't load Mac::Glue::Finder to support the Trash Can: \$@ = $@" if length $@; + die +"Can't load Mac::Glue::Finder to support the Trash Can: \$@ = $@" + if length $@; $glue = Mac::Glue->new('Finder'); } my $code = sub { - my @files = map { - Mac::Glue::param_type( - Mac::Glue::typeAlias() => $_ - ) - } @_; - $glue->delete(\@files); + my @files = + map { Mac::Glue::param_type( Mac::Glue::typeAlias() => $_ ) } + @_; + $glue->delete( \@files ); }; $unlink = $code; $rmdir = $code; - } else { - die "Support for trash() on platform '$^O' not available at this time.\n"; + } + else + { + die +"Support for trash() on platform '$^O' not available at this time.\n"; } remove(@_); } -sub undelete (@) { +sub undelete (@) +{ goto &trash; } - - - - ###################################################################### # Support Functions -sub _expand_with_opts { +sub _expand_with_opts +{ my $opts = shift; - return ($opts->{glob} ? expand(@_) : @_); + return ( $opts->{glob} ? expand(@_) : @_ ); } -sub expand (@) { +sub expand (@) +{ map { -e $_ ? $_ : File::Glob::bsd_glob($_) } @_; } # Do we need to move to a different directory to delete a directory, # and if so which. -sub _moveto { +sub _moveto +{ my $remove = File::Spec->rel2abs(shift); my $cwd = @_ ? shift : Cwd::cwd(); # Do everything in absolute terms - $remove = Cwd::abs_path( $remove ); - $cwd = Cwd::abs_path( $cwd ); + $remove = Cwd::abs_path($remove); + $cwd = Cwd::abs_path($cwd); # If we are on a different volume we don't need to move my ( $cv, $cd ) = File::Spec->splitpath( $cwd, 1 ); @@ -256,20 +301,18 @@ my @rd = File::Spec->splitdir($rd); # Is the current directory the same as or inside the remove directory? - unless ( @cd >= @rd ) { + unless ( @cd >= @rd ) + { return ''; } - foreach ( 0 .. $#rd ) { + foreach ( 0 .. $#rd ) + { $cd[$_] eq $rd[$_] or return ''; } # Confirmed, the current working dir is in the removal dir pop @rd; - return File::Spec->catpath( - $rv, - File::Spec->catdir(@rd), - '' - ); + return File::Spec->catpath( $rv, File::Spec->catdir(@rd), '' ); } 1; @@ -278,13 +321,15 @@ =pod +=encoding UTF-8 + =head1 NAME File::Remove - Remove files and directories =head1 VERSION -version 1.58 +version 1.60 =head1 SYNOPSIS @@ -316,10 +361,6 @@ the addition of an optional, infrequently used "other platforms" hashref. -=head1 VERSION - -version 1.58 - =head1 SUBROUTINES =head2 remove @@ -424,37 +465,10 @@ This program is free software; you can redistribute and/or modify it under the same terms as Perl itself. -=head1 AUTHOR - -Shlomi Fish - -=head1 COPYRIGHT AND LICENSE - -This software is copyright (c) 1998 by Gabor Egressy. - -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - -=head1 BUGS - -Please report any bugs or feature requests on the bugtracker website -L or by email to -L. - -When submitting a bug or request, please include a test-file or a -patch to an existing test-file that illustrates the bug or desired -feature. - -=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan +=for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT -=head2 Perldoc - -You can find documentation for this module with the perldoc command. - - perldoc File::Remove - =head2 Websites The following websites have more information about this module, and may be of help to you. As always, @@ -472,14 +486,6 @@ =item * -Search CPAN - -The default CPAN search engine, useful to view POD in HTML format. - -L - -=item * - RT: CPAN's Bug Tracker The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. @@ -488,22 +494,6 @@ =item * -AnnoCPAN - -The AnnoCPAN is a website that allows community annotations of Perl module documentation. - -L - -=item * - -CPAN Ratings - -The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. - -L - -=item * - CPANTS The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. @@ -552,4 +542,25 @@ git clone git://github.com/shlomif/File-Remove.git +=head1 AUTHOR + +Shlomi Fish + +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +L or by email to +L. + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 1998 by Gabor Egressy. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + =cut diff -Nru libfile-remove-perl-1.58/Makefile.PL libfile-remove-perl-1.60/Makefile.PL --- libfile-remove-perl-1.58/Makefile.PL 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/Makefile.PL 2020-10-22 06:50:23.000000000 +0000 @@ -1,8 +1,8 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.015. use strict; use warnings; -use 5.006; +use 5.008; use ExtUtils::MakeMaker; @@ -18,7 +18,7 @@ }, "DISTNAME" => "File-Remove", "LICENSE" => "perl", - "MIN_PERL_VERSION" => "5.006", + "MIN_PERL_VERSION" => "5.008", "NAME" => "File::Remove", "PREREQ_PM" => { "Cwd" => "3.29", @@ -38,7 +38,7 @@ "IPC::Open3" => 0, "Test::More" => "0.88" }, - "VERSION" => "1.58", + "VERSION" => "1.60", "test" => { "TESTS" => "t/*.t" } diff -Nru libfile-remove-perl-1.58/MANIFEST libfile-remove-perl-1.60/MANIFEST --- libfile-remove-perl-1.58/MANIFEST 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/MANIFEST 2020-10-22 06:50:23.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.015. Build.PL Changes LICENSE @@ -26,5 +26,6 @@ xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-syntax.t +xt/author/tidyall.t xt/release/cpan-changes.t xt/release/trailing-space.t diff -Nru libfile-remove-perl-1.58/META.json libfile-remove-perl-1.60/META.json --- libfile-remove-perl-1.58/META.json 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/META.json 2020-10-22 06:50:23.000000000 +0000 @@ -4,7 +4,7 @@ "Shlomi Fish " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", + "generated_by" : "Dist::Zilla version 6.015, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -29,6 +29,7 @@ "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", + "Test::Code::TidyAll" : "0.50", "Test::EOL" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", @@ -44,7 +45,7 @@ "File::Path" : "0", "File::Spec" : "3.29", "constant" : "0", - "perl" : "5.006", + "perl" : "5.008", "strict" : "0", "vars" : "0", "warnings" : "0" @@ -57,15 +58,14 @@ "File::Spec::Functions" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", - "Test::More" : "0.88", - "perl" : "5.006" + "Test::More" : "0.88" } } }, "provides" : { "File::Remove" : { "file" : "lib/File/Remove.pm", - "version" : "1.58" + "version" : "1.60" } }, "release_status" : "stable", @@ -81,10 +81,10 @@ "web" : "https://github.com/shlomif/File-Remove" } }, - "version" : "1.58", + "version" : "1.60", "x_Dist_Zilla" : { "perl" : { - "version" : "5.028000" + "version" : "5.032000" }, "plugins" : [ { @@ -96,17 +96,17 @@ } }, "name" : "@Filter/TestMoreDoneTesting", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Filter/AutoPrereqs", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Filter/ExecDir", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::GatherDir", @@ -122,27 +122,27 @@ } }, "name" : "@Filter/GatherDir", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Filter/ManifestSkip", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Filter/MetaYAML", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Filter/PruneCruft", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Filter/Readme", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", @@ -157,7 +157,7 @@ { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Filter/ShareDir", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", @@ -167,7 +167,7 @@ } }, "name" : "@Filter/MakeMaker", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", @@ -177,22 +177,22 @@ { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Filter/ConfirmRelease", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Filter/Manifest", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Filter/MetaConfig", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Filter/MetaJSON", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", @@ -202,7 +202,7 @@ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.012" + "version" : "6.015" } ], "include_underscores" : 0 @@ -214,7 +214,7 @@ "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { - "Module::Metadata" : "1.000033", + "Module::Metadata" : "1.000037", "version" : "0.006" } }, @@ -224,7 +224,7 @@ { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@Filter/MetaResources", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ModuleBuild", @@ -234,27 +234,22 @@ } }, "name" : "@Filter/ModuleBuild", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@Filter/PkgVersion", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Filter/PodCoverageTests", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Filter/PodSyntaxTests", - "version" : "6.012" - }, - { - "class" : "Dist::Zilla::Plugin::PodVersion", - "name" : "@Filter/PodVersion", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", @@ -323,12 +318,12 @@ { "class" : "Dist::Zilla::Plugin::Test::TrailingSpace", "name" : "@Filter/Test::TrailingSpace", - "version" : "0.2.0" + "version" : null }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Filter/TestRelease", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", @@ -340,6 +335,16 @@ ], "plugins" : [ { + "class" : "Pod::Weaver::Plugin::SingleEncoding", + "name" : "@SHLOMIF/SingleEncoding", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Plugin::WikiDoc", + "name" : "@SHLOMIF/WikiDoc", + "version" : "0.093004" + }, + { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" @@ -351,73 +356,108 @@ }, { "class" : "Pod::Weaver::Section::Generic", - "name" : "NAME", + "name" : "@SHLOMIF/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", - "name" : "Version", + "name" : "@SHLOMIF/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", - "name" : "prelude", + "name" : "@SHLOMIF/Prelude", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "@SHLOMIF/Synopsis", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "@SHLOMIF/Description", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", - "name" : "SYNOPSIS", + "name" : "@SHLOMIF/Usage", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", - "name" : "DESCRIPTION", + "name" : "@SHLOMIF/Overview", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", - "name" : "OVERVIEW", + "name" : "@SHLOMIF/Stability", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "Requirements", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "Attributes", + "version" : "4.015" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "Constructors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", - "name" : "ATTRIBUTES", + "name" : "Methods", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", - "name" : "METHODS", + "name" : "Functions", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", - "name" : "Leftovers", + "name" : "@SHLOMIF/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", - "name" : "postlude", + "name" : "@SHLOMIF/postlude", "version" : "4.015" }, { + "class" : "Pod::Weaver::Section::Support", + "name" : "@SHLOMIF/Support", + "version" : "1.013" + }, + { "class" : "Pod::Weaver::Section::Authors", - "name" : "Authors", + "name" : "@SHLOMIF/Authors", "version" : "4.015" }, { - "class" : "Pod::Weaver::Section::Legal", - "name" : "Legal", + "class" : "Pod::Weaver::Section::Bugs", + "name" : "@SHLOMIF/Bugs", "version" : "4.015" }, { - "class" : "Pod::Weaver::Section::Bugs", - "name" : "Bugs", + "class" : "Pod::Weaver::Section::Contributors", + "name" : "@SHLOMIF/Contributors", + "version" : "0.009" + }, + { + "class" : "Pod::Weaver::Section::Legal", + "name" : "@SHLOMIF/Legal", "version" : "4.015" }, { - "class" : "Pod::Weaver::Section::Support", - "name" : "Support", - "version" : "1.010" + "class" : "Pod::Weaver::Plugin::Transformer", + "name" : "@SHLOMIF/List", + "version" : "4.015" } ] } @@ -428,62 +468,67 @@ { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Filter/UploadToCPAN", - "version" : "6.012" + "version" : "6.015" + }, + { + "class" : "Dist::Zilla::Plugin::Test::TidyAll", + "name" : "Test::TidyAll", + "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", - "version" : "6.012" + "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.012" + "version" : "6.015" } ], "zilla" : { @@ -491,10 +536,11 @@ "config" : { "is_trial" : 0 }, - "version" : "6.012" + "version" : "6.015" } }, - "x_generated_by_perl" : "v5.28.0", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.06" + "x_generated_by_perl" : "v5.32.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.24", + "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } diff -Nru libfile-remove-perl-1.58/META.yml libfile-remove-perl-1.60/META.yml --- libfile-remove-perl-1.58/META.yml 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/META.yml 2020-10-22 06:50:23.000000000 +0000 @@ -10,12 +10,11 @@ IPC::Open3: '0' Module::Build: '0.28' Test::More: '0.88' - perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' Module::Build: '0.28' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' +generated_by: 'Dist::Zilla version 6.015, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,14 +23,14 @@ provides: File::Remove: file: lib/File/Remove.pm - version: '1.58' + version: '1.60' requires: Cwd: '3.29' File::Glob: '0' File::Path: '0' File::Spec: '3.29' constant: '0' - perl: '5.006' + perl: '5.008' strict: '0' vars: '0' warnings: '0' @@ -39,10 +38,10 @@ bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Remove homepage: http://metacpan.org/release/File-Remove repository: git://github.com/shlomif/File-Remove.git -version: '1.58' +version: '1.60' x_Dist_Zilla: perl: - version: '5.028000' + version: '5.032000' plugins: - class: Dist::Zilla::Plugin::Prereqs @@ -51,15 +50,15 @@ phase: test type: requires name: '@Filter/TestMoreDoneTesting' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Filter/AutoPrereqs' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::ExecDir name: '@Filter/ExecDir' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::GatherDir config: @@ -72,23 +71,23 @@ prune_directory: [] root: . name: '@Filter/GatherDir' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Filter/ManifestSkip' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::MetaYAML name: '@Filter/MetaYAML' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::PruneCruft name: '@Filter/PruneCruft' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::Readme name: '@Filter/Readme' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::RunExtraTests config: @@ -99,14 +98,14 @@ - class: Dist::Zilla::Plugin::ShareDir name: '@Filter/ShareDir' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Filter/MakeMaker' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@Filter/CheckChangesHasContent' @@ -114,19 +113,19 @@ - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Filter/ConfirmRelease' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::Manifest name: '@Filter/Manifest' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::MetaConfig name: '@Filter/MetaConfig' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::MetaJSON name: '@Filter/MetaJSON' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::MetaProvides::Package config: @@ -135,7 +134,7 @@ - class: Dist::Zilla::Plugin::FinderCode name: '@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' - version: '6.012' + version: '6.015' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' @@ -143,37 +142,33 @@ inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: - Module::Metadata: '1.000033' + Module::Metadata: '1.000037' version: '0.006' name: '@Filter/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaResources name: '@Filter/MetaResources' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::ModuleBuild config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Filter/ModuleBuild' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::PkgVersion name: '@Filter/PkgVersion' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Filter/PodCoverageTests' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Filter/PodSyntaxTests' - version: '6.012' - - - class: Dist::Zilla::Plugin::PodVersion - name: '@Filter/PodVersion' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::Test::Compile config: @@ -225,11 +220,11 @@ - class: Dist::Zilla::Plugin::Test::TrailingSpace name: '@Filter/Test::TrailingSpace' - version: 0.2.0 + version: ~ - class: Dist::Zilla::Plugin::TestRelease name: '@Filter/TestRelease' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::PodWeaver config: @@ -239,6 +234,14 @@ - ':ExecFiles' plugins: - + class: Pod::Weaver::Plugin::SingleEncoding + name: '@SHLOMIF/SingleEncoding' + version: '4.015' + - + class: Pod::Weaver::Plugin::WikiDoc + name: '@SHLOMIF/WikiDoc' + version: '0.093004' + - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' @@ -248,114 +251,147 @@ version: '4.015' - class: Pod::Weaver::Section::Generic - name: NAME + name: '@SHLOMIF/Name' version: '4.015' - class: Pod::Weaver::Section::Version - name: Version + name: '@SHLOMIF/Version' version: '4.015' - class: Pod::Weaver::Section::Region - name: prelude + name: '@SHLOMIF/Prelude' version: '4.015' - class: Pod::Weaver::Section::Generic - name: SYNOPSIS + name: '@SHLOMIF/Synopsis' version: '4.015' - class: Pod::Weaver::Section::Generic - name: DESCRIPTION + name: '@SHLOMIF/Description' version: '4.015' - class: Pod::Weaver::Section::Generic - name: OVERVIEW + name: '@SHLOMIF/Usage' + version: '4.015' + - + class: Pod::Weaver::Section::Generic + name: '@SHLOMIF/Overview' + version: '4.015' + - + class: Pod::Weaver::Section::Generic + name: '@SHLOMIF/Stability' version: '4.015' - class: Pod::Weaver::Section::Collect - name: ATTRIBUTES + name: Requirements version: '4.015' - class: Pod::Weaver::Section::Collect - name: METHODS + name: Attributes + version: '4.015' + - + class: Pod::Weaver::Section::Collect + name: Constructors + version: '4.015' + - + class: Pod::Weaver::Section::Collect + name: Methods + version: '4.015' + - + class: Pod::Weaver::Section::Collect + name: Functions version: '4.015' - class: Pod::Weaver::Section::Leftovers - name: Leftovers + name: '@SHLOMIF/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region - name: postlude + name: '@SHLOMIF/postlude' version: '4.015' - + class: Pod::Weaver::Section::Support + name: '@SHLOMIF/Support' + version: '1.013' + - class: Pod::Weaver::Section::Authors - name: Authors + name: '@SHLOMIF/Authors' version: '4.015' - - class: Pod::Weaver::Section::Legal - name: Legal + class: Pod::Weaver::Section::Bugs + name: '@SHLOMIF/Bugs' version: '4.015' - - class: Pod::Weaver::Section::Bugs - name: Bugs + class: Pod::Weaver::Section::Contributors + name: '@SHLOMIF/Contributors' + version: '0.009' + - + class: Pod::Weaver::Section::Legal + name: '@SHLOMIF/Legal' version: '4.015' - - class: Pod::Weaver::Section::Support - name: Support - version: '1.010' + class: Pod::Weaver::Plugin::Transformer + name: '@SHLOMIF/List' + version: '4.015' name: '@Filter/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Filter/UploadToCPAN' - version: '6.012' + version: '6.015' + - + class: Dist::Zilla::Plugin::Test::TidyAll + name: Test::TidyAll + version: '0.04' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' - version: '6.012' + version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: '@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' - version: '6.012' + version: '6.015' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' - version: '6.012' -x_generated_by_perl: v5.28.0 + version: '6.015' +x_generated_by_perl: v5.32.0 x_serialization_backend: 'YAML::Tiny version 1.73' +x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' diff -Nru libfile-remove-perl-1.58/README libfile-remove-perl-1.60/README --- libfile-remove-perl-1.58/README 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/README 2020-10-22 06:50:23.000000000 +0000 @@ -1,5 +1,5 @@ This archive contains the distribution File-Remove, -version 1.58: +version 1.60: Remove files and directories @@ -9,4 +9,4 @@ the same terms as the Perl 5 programming language system itself. -This README file was generated by Dist::Zilla::Plugin::Readme v6.012. +This README file was generated by Dist::Zilla::Plugin::Readme v6.015. diff -Nru libfile-remove-perl-1.58/t/01_compile.t libfile-remove-perl-1.60/t/01_compile.t --- libfile-remove-perl-1.58/t/01_compile.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/01_compile.t 2020-10-22 06:50:23.000000000 +0000 @@ -3,11 +3,9 @@ # Tests that File::Remove compiles ok use strict; -BEGIN { - $| = 1; - $^W = 1; -} +use warnings; use Test::More tests => 1; -use_ok( 'File::Remove' ); +# TEST +use_ok('File::Remove'); diff -Nru libfile-remove-perl-1.58/t/02_directories.t libfile-remove-perl-1.60/t/02_directories.t --- libfile-remove-perl-1.58/t/02_directories.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/02_directories.t 2020-10-22 06:50:23.000000000 +0000 @@ -1,149 +1,187 @@ #!/usr/bin/perl use strict; -BEGIN { - $| = 1; + +BEGIN +{ + $| = 1; $^W = 1; } use Test::More 'no_plan'; use File::Remove qw{ remove trash }; - - - - # Set up the tests -my @dirs = ("$0.tmp", map { "$0.tmp/$_" } qw(a a/b c c/d e e/f g)); +my @dirs = ( "$0.tmp", map { "$0.tmp/$_" } qw(a a/b c c/d e e/f g) ); -for my $path ( reverse @dirs ) { - if ( -e $path ) { +for my $path ( reverse @dirs ) +{ + if ( -e $path ) + { ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } } -for my $path ( @dirs ) { - ok( ! -e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); +for my $path (@dirs) +{ + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } -for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); +for my $path ( reverse @dirs ) +{ + ok( -e $path, "-e: $path" ); ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } -for my $path ( @dirs ) { - ok( ! -e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); +for my $path (@dirs) +{ + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } -for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); - ok( remove(\1, $path), "remove \\1: $path" ); - ok( !-e $path, "!-e: $path" ); +for my $path ( reverse @dirs ) +{ + ok( -e $path, "-e: $path" ); + ok( remove( \1, $path ), "remove \\1: $path" ); + ok( !-e $path, "!-e: $path" ); } -for my $path (@dirs) { - ok( !-e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); +for my $path (@dirs) +{ + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } -for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); +for my $path ( reverse @dirs ) +{ + ok( -e $path, "-e: $path" ); ok( remove($path), "remove: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } -for my $path (reverse @dirs) { +for my $path ( reverse @dirs ) +{ ok( !-e $path, "-e: $path" ); - if (-e _) { + if ( -e _ ) + { ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } } -SKIP: { - if ($^O eq 'darwin') { +SKIP: +{ + if ( $^O eq 'darwin' ) + { + ## no critic eval 'use Mac::Glue ();'; skip "Undelete support requires Mac::Glue", 0 if length $@; eval 'Mac::Glue->new("Finder")'; - skip "Undelete support requires Mac::Glue with Finder support", 0 if length $@; - } elsif ($^O eq 'cygwin' || $^O =~ /^MSWin/) { + ## use critic + skip "Undelete support requires Mac::Glue with Finder support", 0 + if length $@; + } + elsif ( $^O eq 'cygwin' || $^O =~ /^MSWin/ ) + { + ## no critic eval 'use Win32::FileOp::Recycle;'; + ## use critic skip "Undelete support requires Win32::FileOp::Recycle", 0 if length $@; - } else { + } + else + { skip "Undelete support not available by default", 0; } - for my $path (@dirs) { - ok( !-e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); + for my $path (@dirs) + { + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } - for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); + for my $path ( reverse @dirs ) + { + ok( -e $path, "-e: $path" ); ok( eval { trash($path) }, "trash: $path" ); - is( $@, '', "trash: \$@" ); - ok( !-e $path, "!-e: $path" ); + is( $@, '', "trash: \$@" ); + ok( !-e $path, "!-e: $path" ); } - for my $path (reverse @dirs) { + for my $path ( reverse @dirs ) + { ok( !-e $path, "-e: $path" ); - if (-e _) { + if ( -e _ ) + { ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } } - for my $path (@dirs) { - ok( !-e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); + for my $path (@dirs) + { + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } - for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); + for my $path ( reverse @dirs ) + { + ok( -e $path, "-e: $path" ); ok( remove($path), "remove: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } - for my $path (reverse @dirs) { + for my $path ( reverse @dirs ) + { ok( !-e $path, "-e: $path" ); - if (-e _) { + if ( -e _ ) + { ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } } - for my $path (@dirs) { - ok( !-e $path, "!-e: $path" ); - ok( mkdir($path, 0777), "mkdir: $path" ); + for my $path (@dirs) + { + ok( !-e $path, "!-e: $path" ); + ok( mkdir( $path, 0777 ), "mkdir: $path" ); chmod 0777, $path; - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); } - for my $path (reverse @dirs) { - ok( -e $path, "-e: $path" ); + for my $path ( reverse @dirs ) + { + ok( -e $path, "-e: $path" ); ok( - # Fake callbacks will not remove directories, so trash() would return empty list - eval { trash({ 'rmdir' => sub { 1 }, 'unlink' => sub { 1 } }, $path); 1 }, +# Fake callbacks will not remove directories, so trash() would return empty list + eval { + trash( + { + 'rmdir' => sub { 1 }, + 'unlink' => sub { 1 } + }, + $path + ); + 1; + }, "trash: $path", ); - ok( -e $path, "-e: $path" ); + ok( -e $path, "-e: $path" ); ok( rmdir($path), "rmdir: $path" ); - ok( !-e $path, "!-e: $path" ); + ok( !-e $path, "!-e: $path" ); } - UNDELETE: 1; +UNDELETE: 1; } diff -Nru libfile-remove-perl-1.58/t/03_deep_readonly.t libfile-remove-perl-1.60/t/03_deep_readonly.t --- libfile-remove-perl-1.58/t/03_deep_readonly.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/03_deep_readonly.t 2020-10-22 06:50:23.000000000 +0000 @@ -3,67 +3,89 @@ # Test that File::Remove can recursively remove a directory that # deeply contains a readonly file that is owned by the current user. use strict; -BEGIN { - $| = 1; - $^W = 1; -} +use warnings; use Test::More tests => 12; use File::Spec::Functions ':ALL'; use File::Copy (); use File::Remove (); - - - - ##################################################################### # Set up for the test my $in = catdir( curdir(), 't' ); + +# TEST ok( -d $in, 'Found t dir' ); my $d1 = catdir( $in, 'd1' ); my $d2 = catdir( $d1, 'd2' ); my $f3 = catfile( $d2, 'f3.txt' ); -sub create_directory { - mkdir($d1,0777) or die "Failed to create $d1"; +sub create_directory +{ + mkdir( $d1, 0777 ) or die "Failed to create $d1"; + + # TEST ok( -d $d1, "Created $d1 ok" ); + + # TEST ok( -r $d1, "Created $d1 -r" ); + + # TEST ok( -w $d1, "Created $d1 -w" ); - mkdir($d2,0777) or die "Failed to create $d2"; + mkdir( $d2, 0777 ) or die "Failed to create $d2"; + + # TEST ok( -d $d2, "Created $d2 ok" ); + + # TEST ok( -r $d2, "Created $d2 -r" ); + + # TEST ok( -w $d2, "Created $d2 -w" ); - # Copy in a known-readonly file (in this case, the File::Spec lib we are using + + # Copy in a known-readonly file (in this case, the File::Spec lib we are using File::Copy::copy( $INC{'File/Spec.pm'} => $f3 ); chmod( 0400, $f3 ); + + # TEST ok( -f $f3, "Created $f3 ok" ); + + # TEST ok( -r $f3, "Created $f3 -r" ); - SKIP: { - if ( $^O ne 'MSWin32' and ($< == 0 or $> == 0) ) { - skip("This test doesn't work as root", 1); +SKIP: + { + if ( $^O ne 'MSWin32' and ( $< == 0 or $> == 0 ) ) + { + skip( "This test doesn't work as root", 1 ); } - if ( $^O eq 'cygwin' ) { - skip("Fails on some cygwin and shouldn't prevent install",1); + if ( $^O eq 'cygwin' ) + { + skip( "Fails on some cygwin and shouldn't prevent install", 1 ); } - ok( ! -w $f3, "Created $f3 ! -w" ); - }; + + # TEST + ok( !-w $f3, "Created $f3 ! -w" ); + } } -sub clear_directory { - if ( -e $f3 ) { +sub clear_directory +{ + if ( -e $f3 ) + { chmod( 0700, $f3 ) or die "chmod 0700 $f3 failed"; - unlink( $f3 ) or die "unlink: $f3 failed"; - ! -e $f3 or die "unlink didn't work"; + unlink($f3) or die "unlink: $f3 failed"; + !-e $f3 or die "unlink didn't work"; } - if ( -e $d2 ) { - rmdir( $d2 ) or die "rmdir: $d2 failed"; - ! -e $d2 or die "rmdir didn't work"; + if ( -e $d2 ) + { + rmdir($d2) or die "rmdir: $d2 failed"; + !-e $d2 or die "rmdir didn't work"; } - if ( -e $d1 ) { - rmdir( $d1 ) or die "rmdir: $d1 failed"; - ! -e $d1 or die "rmdir didn't work"; + if ( -e $d1 ) + { + rmdir($d1) or die "rmdir: $d1 failed"; + !-e $d1 or die "rmdir didn't work"; } } @@ -74,17 +96,17 @@ create_directory(); # Schedule cleanup -END { +END +{ clear_directory(); } - - - - ##################################################################### # Main Testing # Call a recursive remove of the directory, nothing should be left after +# TEST ok( File::Remove::remove( \1, $d1 ), "remove('$d1') ok" ); -ok( ! -e $d1, "Removed the directory ok" ); + +# TEST +ok( !-e $d1, "Removed the directory ok" ); diff -Nru libfile-remove-perl-1.58/t/04_can_delete.t libfile-remove-perl-1.60/t/04_can_delete.t --- libfile-remove-perl-1.58/t/04_can_delete.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/04_can_delete.t 2020-10-22 06:50:23.000000000 +0000 @@ -3,68 +3,90 @@ # Test that File::Remove can recursively remove a directory that # deeply contains a readonly file that is owned by the current user. use strict; -BEGIN { - $| = 1; - $^W = 1; -} +use warnings; use Test::More tests => 12; use File::Spec::Functions ':ALL'; use File::Copy (); use File::Remove (); - - - - ##################################################################### # Set up for the test my $in = catdir( curdir(), 't', "04_can_delete-t.tmp" ); mkdir($in); + +# TEST ok( -d $in, 'Found t dir' ); my $d1 = catdir( $in, 'd1' ); my $d2 = catdir( $d1, 'd2' ); my $f3 = catfile( $d2, 'f3.txt' ); -sub create_directory { - mkdir($d1,0777) or die "Failed to create $d1"; +sub create_directory +{ + mkdir( $d1, 0777 ) or die "Failed to create $d1"; + + # TEST ok( -d $d1, "Created $d1 ok" ); + + # TEST ok( -r $d1, "Created $d1 -r" ); + + # TEST ok( -w $d1, "Created $d1 -w" ); - mkdir($d2,0777) or die "Failed to create $d2"; + mkdir( $d2, 0777 ) or die "Failed to create $d2"; + + # TEST ok( -d $d2, "Created $d2 ok" ); + + # TEST ok( -r $d2, "Created $d2 -r" ); + + # TEST ok( -w $d2, "Created $d2 -w" ); - # Copy in a known-readonly file (in this case, the File::Spec lib we are using + + # Copy in a known-readonly file (in this case, the File::Spec lib we are using File::Copy::copy( $INC{'File/Spec.pm'} => $f3 ); chmod( 0400, $f3 ); + + # TEST ok( -f $f3, "Created $f3 ok" ); + + # TEST ok( -r $f3, "Created $f3 -r" ); - SKIP: { - if ( $^O ne 'MSWin32' and $< == 0 ) { - skip("This test doesn't work as root", 1); +SKIP: + { + if ( $^O ne 'MSWin32' and $< == 0 ) + { + skip( "This test doesn't work as root", 1 ); } - if ( $^O eq 'cygwin' ) { - skip("Fails on some cygwin and shouldn't prevent install",1); + if ( $^O eq 'cygwin' ) + { + skip( "Fails on some cygwin and shouldn't prevent install", 1 ); } - ok( ! -w $f3, "Created $f3 ! -w" ); - }; + + # TEST + ok( !-w $f3, "Created $f3 ! -w" ); + } } -sub clear_directory { - if ( -e $f3 ) { +sub clear_directory +{ + if ( -e $f3 ) + { chmod( 0700, $f3 ) or die "chmod 0700 $f3 failed"; - unlink( $f3 ) or die "unlink: $f3 failed"; - ! -e $f3 or die "unlink didn't work"; + unlink($f3) or die "unlink: $f3 failed"; + !-e $f3 or die "unlink didn't work"; } - if ( -e $d2 ) { - rmdir( $d2 ) or die "rmdir: $d2 failed"; - ! -e $d2 or die "rmdir didn't work"; + if ( -e $d2 ) + { + rmdir($d2) or die "rmdir: $d2 failed"; + !-e $d2 or die "rmdir didn't work"; } - if ( -e $d1 ) { - rmdir( $d1 ) or die "rmdir: $d1 failed"; - ! -e $d1 or die "rmdir didn't work"; + if ( -e $d1 ) + { + rmdir($d1) or die "rmdir: $d1 failed"; + !-e $d1 or die "rmdir didn't work"; } } @@ -75,17 +97,17 @@ create_directory(); # Schedule cleanup -END { +END +{ clear_directory(); } - - - - ##################################################################### # Main Testing # Call a recursive remove of the directory, nothing should be left after -is_deeply( [ File::Remove::remove( $f3 ) ], [ $f3 ], "remove('$f3') ok" ); -ok( ! -e $f3, "Removed the file ok" ); +# TEST +is_deeply( [ File::Remove::remove($f3) ], [$f3], "remove('$f3') ok" ); + +# TEST +ok( !-e $f3, "Removed the file ok" ); diff -Nru libfile-remove-perl-1.58/t/05_links.t libfile-remove-perl-1.60/t/05_links.t --- libfile-remove-perl-1.58/t/05_links.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/05_links.t 2020-10-22 06:50:23.000000000 +0000 @@ -1,8 +1,10 @@ #!/usr/bin/perl use strict; -BEGIN { - $| = 1; + +BEGIN +{ + $| = 1; $^W = 1; } @@ -10,8 +12,9 @@ use File::Spec::Functions ':ALL'; use File::Remove (); -unless( eval { symlink("",""); 1 } ) { - plan("skip_all" => "No Unix-like symlinks"); +unless ( eval { symlink( "", "" ); 1 } ) +{ + plan( "skip_all" => "No Unix-like symlinks" ); exit(0); } @@ -19,38 +22,46 @@ # Set up the tests my $testdir = catdir( 't', 'linktest' ); -if ( -d $testdir ) { +if ( -d $testdir ) +{ File::Remove::remove( \1, $testdir ); die "Failed to clear test directory '$testdir'" if -d $testdir; } -ok( ! -d $testdir, 'Cleared testdir' ); -unless( mkdir($testdir, 0777) ) { +ok( !-d $testdir, 'Cleared testdir' ); +unless ( mkdir( $testdir, 0777 ) ) +{ die("Cannot create test directory '$testdir': $!"); } ok( -d $testdir, 'Created testdir' ); my %links = ( - l_ex => curdir(), -# l_ex_a => rootdir(), - l_nex => 'does_not_exist' + l_ex => curdir(), + + # l_ex_a => rootdir(), + l_nex => 'does_not_exist' ); my $errs = 0; -foreach my $link (keys %links) { +foreach my $link ( keys %links ) +{ my $path = catdir( $testdir, $link ); - unless( symlink($links{$link}, $path )) { + unless ( symlink( $links{$link}, $path ) ) + { diag("Cannot create symlink $link -> $links{$link}: $!"); $errs++; } } -if ( $errs ) { +if ($errs) +{ die("Could not create test links"); } -ok( File::Remove::remove(\1, map { catdir($testdir, $_) } keys %links), "remove \\1: all links" ); +ok( File::Remove::remove( \1, map { catdir( $testdir, $_ ) } keys %links ), + "remove \\1: all links" ); my @entries; -ok( opendir(DIR, $testdir) ); -foreach my $dir ( readdir(DIR) ) { +ok( opendir( DIR, $testdir ) ); +foreach my $dir ( readdir(DIR) ) +{ next if $dir eq curdir(); next if $dir eq updir(); push @entries, $dir; @@ -59,6 +70,6 @@ ok( @entries == 0, "no links remained in directory; found @entries" ); -ok( File::Remove::remove(\1, $testdir), "remove \\1: $testdir" ); +ok( File::Remove::remove( \1, $testdir ), "remove \\1: $testdir" ); -ok( ! -e $testdir, "!-e: $testdir" ); +ok( !-e $testdir, "!-e: $testdir" ); diff -Nru libfile-remove-perl-1.58/t/06_curly.t libfile-remove-perl-1.60/t/06_curly.t --- libfile-remove-perl-1.58/t/06_curly.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/06_curly.t 2020-10-22 06:50:23.000000000 +0000 @@ -5,10 +5,7 @@ # Test that a directory called '{1234}' is deleted correctly. use strict; -BEGIN { - $| = 1; - $^W = 1; -} +use warnings; use Test::More tests => 6; use File::Spec::Functions ':ALL'; @@ -17,21 +14,35 @@ # Create the test directory my $dir = '{1234}'; my $path = catdir( 't', '{1234}' ); -unless ( -e $path ) { - mkdir($path,0777); +unless ( -e $path ) +{ + mkdir( $path, 0777 ); } + +# TEST ok( -e $path, "Test directory $path exists" ); # Delete the test directory my @removed = File::Remove::remove( \1, $path ); -is_deeply( \@removed, [ $path ], 'remove returns as expected' ); -ok( ! -e $path, "remove deletes the $path directory" ); + +# TEST +is_deeply( \@removed, [$path], 'remove returns as expected' ); + +# TEST +ok( !-e $path, "remove deletes the $path directory" ); # Repeat the tests on a dir named {1234} in the root path -unless ( -e $dir ) { - mkdir($dir,0777); +unless ( -e $dir ) +{ + mkdir( $dir, 0777 ); } + +# TEST ok( -e $dir, "Test directory $dir exists" ); @removed = File::Remove::remove( \1, $dir ); -is_deeply( \@removed, [ $dir ], 'remove returns as expected' ); -ok( ! -e $path, "remove delete the $dir directory" ); + +# TEST +is_deeply( \@removed, [$dir], 'remove returns as expected' ); + +# TEST +ok( !-e $path, "remove delete the $dir directory" ); diff -Nru libfile-remove-perl-1.58/t/07_cwd.t libfile-remove-perl-1.60/t/07_cwd.t --- libfile-remove-perl-1.58/t/07_cwd.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/07_cwd.t 2020-10-22 06:50:23.000000000 +0000 @@ -1,7 +1,9 @@ #!/usr/bin/perl use strict; -BEGIN { + +BEGIN +{ $| = 1; $^W = 1; } @@ -12,43 +14,55 @@ use Cwd (); # Create the test directories -my $base = Cwd::abs_path(Cwd::cwd()); -my $cwd = rel2abs(catdir('t', 'cwd')); -my $foo = rel2abs(catdir('t', 'cwd', 'foo')); -my $file = rel2abs(catdir('t', 'cwd', 'foo', 'bar.txt')); +my $base = Cwd::abs_path( Cwd::cwd() ); +my $cwd = rel2abs( catdir( 't', 'cwd' ) ); +my $foo = rel2abs( catdir( 't', 'cwd', 'foo' ) ); +my $file = rel2abs( catdir( 't', 'cwd', 'foo', 'bar.txt' ) ); File::Remove::clear($cwd); -mkdir($cwd,0777) or die "mkdir($cwd): $!"; -mkdir($foo,0777) or die "mkdir($foo): $!"; -open( FILE, ">$file" ) or die "open($file): $!"; -print FILE "blah\n"; -close( FILE ) or die "close($file): $!"; -ok( -d $cwd, "$cwd directory exists" ); -ok( -d $foo, "$foo directory exists" ); -ok( -f $file, "$file file exists" ); +mkdir( $cwd, 0777 ) or die "mkdir($cwd): $!"; +mkdir( $foo, 0777 ) or die "mkdir($foo): $!"; +open( my $fh, ">", $file ) or die "open($file): $!"; +print {$fh} "blah\n"; +close($fh) or die "close($file): $!"; + +# TEST +ok( -d $cwd, "$cwd directory exists" ); + +# TEST +ok( -d $foo, "$foo directory exists" ); + +# TEST +ok( -f $file, "$file file exists" ); # Test that _moveto behaves as expected -SCOPE: { +SCOPE: +{ + # TEST is( File::Remove::_moveto( - File::Spec->catdir($base, 't'), # remove - File::Spec->catdir($base), # cwd + File::Spec->catdir( $base, 't' ), # remove + File::Spec->catdir($base), # cwd ), '', '_moveto returns correct for normal case', ); my $moveto1 = File::Remove::_moveto( - File::Spec->catdir($base, 't'), # remove - File::Spec->catdir($base, 't'), # cwd + File::Spec->catdir( $base, 't' ), # remove + File::Spec->catdir( $base, 't' ), # cwd ); $moveto1 =~ s/\\/\//g; + + # TEST is( $moveto1, $base, '_moveto returns correct for normal case' ); my $moveto2 = File::Remove::_moveto( - File::Spec->catdir($base, 't'), # remove - File::Spec->catdir($base, 't', 'cwd'), # cwd + File::Spec->catdir( $base, 't' ), # remove + File::Spec->catdir( $base, 't', 'cwd' ), # cwd ); $moveto2 =~ s/\\/\//g; + + # TEST is( $moveto2, $base, '_moveto returns correct for normal case' ); # Regression: _moveto generates false positives @@ -56,10 +70,11 @@ # remove: /tmp/eBtQxTPGHC # moveto: /tmp # expected: '' + # TEST is( File::Remove::_moveto( - File::Spec->catdir($base, 't'), # remove - File::Spec->catdir($base, 'lib', 'File'), # cwd + File::Spec->catdir( $base, 't' ), # remove + File::Spec->catdir( $base, 'lib', 'File' ), # cwd ), '', '_moveto returns null as expected', @@ -69,21 +84,32 @@ # Change the current working directory into the first # test directory and store the absolute path. chdir($cwd) or die "chdir($cwd): $!"; -my $cwdabs = Cwd::abs_path(Cwd::cwd()); +my $cwdabs = Cwd::abs_path( Cwd::cwd() ); + +# TEST ok( $cwdabs =~ /\bcwd$/, "Expected abs path is $cwdabs" ); # Change into the directory that should be deleted chdir('foo') or die "chdir($foo): $!"; -my $fooabs = Cwd::abs_path(Cwd::cwd()); +my $fooabs = Cwd::abs_path( Cwd::cwd() ); + +# TEST ok( $fooabs =~ /\bfoo$/, "Deleting from abs path is $fooabs" ); # Delete the foo directory -ok( File::Remove::remove(\1, $foo), "remove($foo) ok" ); +# TEST +ok( File::Remove::remove( \1, $foo ), "remove($foo) ok" ); # We should now be in the bottom directory again -is( Cwd::abs_path(Cwd::cwd()), $cwdabs, "We are now back in the original directory" ); +# TEST +is( Cwd::abs_path( Cwd::cwd() ), + $cwdabs, "We are now back in the original directory" ); # Move back to the base dir and confirm everything was deleted. chdir($base) or die "chdir($base): $!"; -ok( ! -e $foo, "$foo does not exist" ); -ok( ! -e $file, "$file does not exist" ); + +# TEST +ok( !-e $foo, "$foo does not exist" ); + +# TEST +ok( !-e $file, "$file does not exist" ); diff -Nru libfile-remove-perl-1.58/t/08_spaces.t libfile-remove-perl-1.60/t/08_spaces.t --- libfile-remove-perl-1.58/t/08_spaces.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/08_spaces.t 2020-10-22 06:50:23.000000000 +0000 @@ -4,7 +4,10 @@ # spaces in the path to delete. use strict; -BEGIN { +use warnings; + +BEGIN +{ $| = 1; $^W = 1; } @@ -14,51 +17,54 @@ use File::Copy (); use File::Remove (); - - - - ##################################################################### # Set up for the test my $t = catdir( curdir(), 't' ); -my $s = catdir( $t, 'spaced path' ); -my $f1 = catfile( $s, 'foo1.txt' ); -my $f2 = catfile( $s, 'foo2.txt' ); -my $f3 = catfile( $s, 'bar.txt' ); - -sub create_directory { - mkdir($s,0777) or die "Failed to create $s"; +my $s = catdir( $t, 'spaced path' ); +my $f1 = catfile( $s, 'foo1.txt' ); +my $f2 = catfile( $s, 'foo2.txt' ); +my $f3 = catfile( $s, 'bar.txt' ); + +sub create_directory +{ + mkdir( $s, 0777 ) or die "Failed to create $s"; ok( -d $s, "Created $s ok" ); ok( -r $s, "Created $s -r" ); ok( -w $s, "Created $s -w" ); - open( FILE, ">$f1" ) or die "Failed to create $f1"; - print FILE "Test\n"; - close FILE; - open( FILE, ">$f2" ) or die "Failed to create $f2"; - print FILE "Test\n"; - close FILE; - open( FILE, ">$f3" ) or die "Failed to create $f3"; - print FILE "Test\n"; - close FILE; + my $spew = sub { + my $fn = shift; + open( my $fh, ">", $fn ) or die "Failed to create $fn"; + print {$fh} "Test\n"; + close $fh; + return; + }; + $spew->($f1); + $spew->($f2); + $spew->($f3); } -sub clear_directory { - if ( -e $f1 ) { - unlink( $f1 ) or die "unlink: $f1 failed"; - ! -e $f1 or die "unlink didn't work"; +sub clear_directory +{ + if ( -e $f1 ) + { + unlink($f1) or die "unlink: $f1 failed"; + !-e $f1 or die "unlink didn't work"; } - if ( -e $f2 ) { - unlink( $f2 ) or die "unlink: $f2 failed"; - ! -e $f2 or die "unlink didn't work"; + if ( -e $f2 ) + { + unlink($f2) or die "unlink: $f2 failed"; + !-e $f2 or die "unlink didn't work"; } - if ( -e $f3 ) { - unlink( $f3 ) or die "unlink: $f3 failed"; - ! -e $f3 or die "unlink didn't work"; + if ( -e $f3 ) + { + unlink($f3) or die "unlink: $f3 failed"; + !-e $f3 or die "unlink didn't work"; } - if ( -e $s ) { - rmdir( $s ) or die "rmdir: $s failed"; - ! -e $s or die "rmdir didn't work"; + if ( -e $s ) + { + rmdir($s) or die "rmdir: $s failed"; + !-e $s or die "rmdir didn't work"; } } @@ -69,14 +75,11 @@ create_directory(); # Schedule cleanup -END { +END +{ clear_directory(); } - - - - ##################################################################### # Main Testing diff -Nru libfile-remove-perl-1.58/t/09_fork.t libfile-remove-perl-1.60/t/09_fork.t --- libfile-remove-perl-1.58/t/09_fork.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/09_fork.t 2020-10-22 06:50:23.000000000 +0000 @@ -3,10 +3,7 @@ # Ensure that we don't prematurely END-time delete due to forking use strict; -BEGIN { - $| = 1; - $^W = 1; -} +use warnings; use Test::More tests => 8; use File::Spec::Functions ':ALL'; @@ -14,17 +11,26 @@ # Create a directory my $parent = catdir( 't', '09_fork_parent' ); -my $child = catdir( 't', '09_fork_child' ); +my $child = catdir( 't', '09_fork_child' ); File::Remove::clear($parent); File::Remove::remove($child); -ok( ! -d $parent, 'Parent directory does not exist' ); -ok( ! -d $child, 'Child directory does not exist' ); + +# TEST +ok( !-d $parent, 'Parent directory does not exist' ); + +# TEST +ok( !-d $child, 'Child directory does not exist' ); + +# TEST ok( mkdir( $parent, 0777 ), 'Created directory' ); + +# TEST ok( -d $parent, 'Directory exists' ); # Fork the test my $pid = fork(); -unless ( $pid ) { +unless ($pid) +{ # Create a child-owned directory and flag for deletion File::Remove::clear($child); mkdir( $child, 0777 ); @@ -37,11 +43,19 @@ # In the parent, wait 1 second for process to spawn # and create the child directory sleep(1); + +# TEST ok( -d $child, 'Child directory created (by forked child)' ); # Wait for the child to exit my $caught = wait(); + +# TEST is( $pid, $caught, 'The child exited' ); -sleep(1); # Give a chance for flakey windows to delete directory +sleep(1); # Give a chance for flakey windows to delete directory + +# TEST ok( -d $parent, 'Parent directory still exists' ); -ok( ! -d $child, 'Child directory is removed' ); + +# TEST +ok( !-d $child, 'Child directory is removed' ); diff -Nru libfile-remove-perl-1.58/t/10_noglob.t libfile-remove-perl-1.60/t/10_noglob.t --- libfile-remove-perl-1.58/t/10_noglob.t 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/t/10_noglob.t 2020-10-22 06:50:23.000000000 +0000 @@ -6,7 +6,7 @@ use 5.006; use File::Spec (); -use Cwd (qw/getcwd/); +use Cwd (qw/getcwd/); use File::Path qw/rmtree/; @@ -16,45 +16,42 @@ { my $dir = File::Spec->rel2abs( - File::Spec->catdir( - File::Spec->curdir(), "t", "10_noglob_dir", - ) - ); + File::Spec->catdir( File::Spec->curdir(), "t", "10_noglob_dir", ) ); mkdir($dir); my $file_path = sub { my ($bn) = @_; - return File::Spec->catfile($dir, $bn); + return File::Spec->catfile( $dir, $bn ); }; my $create_file = sub { - my ($bn, $contents) = @_; + my ( $bn, $contents ) = @_; open my $fh, '>', $file_path->($bn) or die "Cannot create basename '$bn'"; print {$fh} $contents; - close ($fh); + close($fh); return; }; - $create_file->("a", "a contents\n"); - $create_file->("b", "b contents\n"); - $create_file->("c", "c contents\n"); + $create_file->( "a", "a contents\n" ); + $create_file->( "b", "b contents\n" ); + $create_file->( "c", "c contents\n" ); my $cur_dir = getcwd(); - chdir ($dir); + chdir($dir); - remove(\0, +{ glob => 0 }, '*'); + remove( \0, +{ glob => 0 }, '*' ); my $is_file = sub { my ($bn) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; - return ok (scalar(-e $file_path->($bn)), "$bn was not deleted."); + return ok( scalar( -e $file_path->($bn) ), "$bn was not deleted." ); }; # TEST @@ -66,8 +63,8 @@ # TEST $is_file->('c'); - chdir ($cur_dir); + chdir($cur_dir); - rmtree ($dir); + rmtree($dir); } diff -Nru libfile-remove-perl-1.58/weaver.ini libfile-remove-perl-1.60/weaver.ini --- libfile-remove-perl-1.58/weaver.ini 2018-10-04 09:31:40.000000000 +0000 +++ libfile-remove-perl-1.60/weaver.ini 2020-10-22 06:50:23.000000000 +0000 @@ -1,37 +1 @@ -[@CorePrep] - -[Generic / NAME] - -[Version] - -[Region / prelude] - - -[Generic / SYNOPSIS] -[Generic / DESCRIPTION] -[Generic / OVERVIEW] - -[Collect / ATTRIBUTES] -command = attr - -[Collect / METHODS] -command = method - -[Leftovers] - -[Region / postlude] - -[Authors] -[Legal] - -; [Generic / DESCRIPTION] -; required = 1 - -; [Generic / BUGS] - -; [Generic / Section::Bugs] -; [Generic / Section::License] -; -[Bugs] -[Support] -all_modules = 1 +[@SHLOMIF] diff -Nru libfile-remove-perl-1.58/xt/author/tidyall.t libfile-remove-perl-1.60/xt/author/tidyall.t --- libfile-remove-perl-1.58/xt/author/tidyall.t 1970-01-01 00:00:00.000000000 +0000 +++ libfile-remove-perl-1.60/xt/author/tidyall.t 2020-10-22 06:50:23.000000000 +0000 @@ -0,0 +1,11 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Test::TidyAll v$VERSION + +use Test::More 0.88; +use Test::Code::TidyAll 0.24; + +tidyall_ok( + verbose => ( exists $ENV{TEST_TIDYALL_VERBOSE} ? $ENV{TEST_TIDYALL_VERBOSE} : 0 ), + jobs => ( exists $ENV{TEST_TIDYALL_JOBS} ? $ENV{TEST_TIDYALL_JOBS} : 1 ), +); + +done_testing;