Hello community, here is the log from the commit of package perl-Path-Class for openSUSE:Factory checked in at 2013-12-19 12:24:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Path-Class (Old) and /work/SRC/openSUSE:Factory/.perl-Path-Class.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Path-Class" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Path-Class/perl-Path-Class.changes 2013-06-11 09:35:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Path-Class.new/perl-Path-Class.changes 2013-12-19 12:24:10.000000000 +0100 @@ -1,0 +2,17 @@ +Wed Dec 18 10:40:28 UTC 2013 - [email protected] + +- updated to 0.33 + - New copy_to() and move_to() methods. [Robert Rothenberg & Ken Williams] + + - As advised in the utime() docs, pass undef as the time for touch(). + + - Do a better job cleaning up temp files in the tests. + + - Optimization: use parent.pm instead of base.pm. [Olivier Mengué] + + - Changed the docs to show that file() and dir() are exported by + default. + + - Fixed spelling error in POD. [Salvatore Bonaccorso] + +------------------------------------------------------------------- Old: ---- Path-Class-0.32.tar.gz New: ---- Path-Class-0.33.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Path-Class.spec ++++++ --- /var/tmp/diff_new_pack.L4AqHy/_old 2013-12-19 12:24:10.000000000 +0100 +++ /var/tmp/diff_new_pack.L4AqHy/_new 2013-12-19 12:24:10.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Path-Class -Version: 0.32 +Version: 0.33 Release: 0 %define cpan_name Path-Class Summary: Cross-platform path specification manipulation @@ -31,11 +31,12 @@ BuildRequires: perl-macros BuildRequires: perl(File::Spec) >= 3.26 BuildRequires: perl(Module::Build) >= 0.3601 -#BuildRequires: perl(Path::Class) -#BuildRequires: perl(Path::Class::Dir) -#BuildRequires: perl(Path::Class::Entity) -#BuildRequires: perl(Path::Class::File) +BuildRequires: perl(Perl::OSType) +BuildRequires: perl(parent) + Requires: perl(File::Spec) >= 3.26 +Requires: perl(Perl::OSType) +Requires: perl(parent) %{perl_requires} %description ++++++ Path-Class-0.32.tar.gz -> Path-Class-0.33.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/Build.PL new/Path-Class-0.33/Build.PL --- old/Path-Class-0.32/Build.PL 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/Build.PL 2013-12-12 04:47:52.000000000 +0100 @@ -7,10 +7,7 @@ my %module_build_args = ( "build_requires" => { - "Module::Build" => "0.3601", - "Test" => 0, - "Test::More" => 0, - "warnings" => 0 + "Module::Build" => "0.3601" }, "configure_requires" => { "ExtUtils::MakeMaker" => "6.30", @@ -21,7 +18,7 @@ "Ken Williams <kwilliams\@cpan.org>" ], "dist_name" => "Path-Class", - "dist_version" => "0.32", + "dist_version" => "0.33", "license" => "perl", "module_name" => "Path::Class", "recommends" => {}, @@ -30,21 +27,41 @@ "Carp" => 0, "Cwd" => 0, "Exporter" => 0, + "File::Copy" => 0, "File::Path" => 0, "File::Spec" => "3.26", "File::Temp" => 0, "File::stat" => 0, "IO::Dir" => 0, "IO::File" => 0, + "Perl::OSType" => 0, "Scalar::Util" => 0, - "base" => 0, "overload" => 0, + "parent" => 0, "strict" => 0 }, - "script_files" => [] + "script_files" => [], + "test_requires" => { + "Test" => 0, + "Test::More" => 0, + "warnings" => 0 + } ); +my %fallback_build_requires = ( + "Module::Build" => "0.3601", + "Test" => 0, + "Test::More" => 0, + "warnings" => 0 +); + + +unless ( eval { Module::Build->VERSION(0.4004) } ) { + delete $module_build_args{test_requires}; + $module_build_args{build_requires} = \%fallback_build_requires; +} + my $build = Module::Build->new(%module_build_args); $build->create_build_script; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/Changes new/Path-Class-0.33/Changes --- old/Path-Class-0.32/Changes 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/Changes 2013-12-12 04:47:52.000000000 +0100 @@ -1,5 +1,20 @@ Revision history for Perl extension Path::Class. +0.33 Wed Dec 11 21:30:35 CST 2013 + + - New copy_to() and move_to() methods. [Robert Rothenberg & Ken Williams] + + - As advised in the utime() docs, pass undef as the time for touch(). + + - Do a better job cleaning up temp files in the tests. + + - Optimization: use parent.pm instead of base.pm. [Olivier Mengué] + + - Changed the docs to show that file() and dir() are exported by + default. + + - Fixed spelling error in POD. [Salvatore Bonaccorso] + 0.32 Mon Mar 18 20:53:00 CDT 2013 - Updated dependency on File::Spec to 3.26, fixing RT #83143. @@ -78,6 +93,8 @@ - Fixed a grammar error in the docs. [Shlomi Fish] + - Moved from Google Code (SVN) to GitHub (Git). + 0.24 Sat May 28 20:52:39 CDT 2011 - Added a tempfile() method for Dir objects, which provides an diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/INSTALL new/Path-Class-0.33/INSTALL --- old/Path-Class-0.32/INSTALL 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/INSTALL 2013-12-12 04:47:52.000000000 +0100 @@ -25,16 +25,16 @@ As a last resort, you can manually install it. Download the tarball, untar it, then build it: - % perl Makefile.PL - % make && make test + % perl Build.PL + % ./Build && ./Build test Then install it: - % make install + % ./Build install If you are installing into a system-wide directory, you may need to run: - % sudo make install + % sudo ./Build install ## Documentation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/LICENSE new/Path-Class-0.33/LICENSE --- old/Path-Class-0.32/LICENSE 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/LICENSE 2013-12-12 04:47:52.000000000 +0100 @@ -22,7 +22,7 @@ Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/META.yml new/Path-Class-0.33/META.yml --- old/Path-Class-0.32/META.yml 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/META.yml 2013-12-12 04:47:52.000000000 +0100 @@ -11,7 +11,7 @@ ExtUtils::MakeMaker: 6.30 Module::Build: 0.3601 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.300028, CPAN::Meta::Converter version 2.120921' +generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -21,17 +21,19 @@ Carp: 0 Cwd: 0 Exporter: 0 + File::Copy: 0 File::Path: 0 File::Spec: 3.26 File::Temp: 0 File::stat: 0 IO::Dir: 0 IO::File: 0 + Perl::OSType: 0 Scalar::Util: 0 - base: 0 overload: 0 + parent: 0 strict: 0 resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Path-Class repository: git://github.com/kenahoo/Path-Class.git -version: 0.32 +version: 0.33 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/Makefile.PL new/Path-Class-0.33/Makefile.PL --- old/Path-Class-0.32/Makefile.PL 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/Makefile.PL 2013-12-12 04:47:52.000000000 +0100 @@ -12,10 +12,7 @@ "ABSTRACT" => "Cross-platform path specification manipulation", "AUTHOR" => "Ken Williams <kwilliams\@cpan.org>", "BUILD_REQUIRES" => { - "Module::Build" => "0.3601", - "Test" => 0, - "Test::More" => 0, - "warnings" => 0 + "Module::Build" => "0.3601" }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30", @@ -29,35 +26,58 @@ "Carp" => 0, "Cwd" => 0, "Exporter" => 0, + "File::Copy" => 0, "File::Path" => 0, "File::Spec" => "3.26", "File::Temp" => 0, "File::stat" => 0, "IO::Dir" => 0, "IO::File" => 0, + "Perl::OSType" => 0, "Scalar::Util" => 0, - "base" => 0, "overload" => 0, + "parent" => 0, "strict" => 0 }, - "VERSION" => "0.32", + "TEST_REQUIRES" => { + "Test" => 0, + "Test::More" => 0, + "warnings" => 0 + }, + "VERSION" => "0.33", "test" => { "TESTS" => "t/*.t" } ); -unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { - my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; - my $pp = $WriteMakefileArgs{PREREQ_PM}; - for my $mod ( keys %$br ) { - if ( exists $pp->{$mod} ) { - $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; - } - else { - $pp->{$mod} = $br->{$mod}; - } - } +my %FallbackPrereqs = ( + "Carp" => 0, + "Cwd" => 0, + "Exporter" => 0, + "File::Copy" => 0, + "File::Path" => 0, + "File::Spec" => "3.26", + "File::Temp" => 0, + "File::stat" => 0, + "IO::Dir" => 0, + "IO::File" => 0, + "Module::Build" => "0.3601", + "Perl::OSType" => 0, + "Scalar::Util" => 0, + "Test" => 0, + "Test::More" => 0, + "overload" => 0, + "parent" => 0, + "strict" => 0, + "warnings" => 0 +); + + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + delete $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{BUILD_REQUIRES}; + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/README new/Path-Class-0.33/README --- old/Path-Class-0.32/README 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/README 2013-12-12 04:47:52.000000000 +0100 @@ -1,7 +1,7 @@ This archive contains the distribution Path-Class, -version 0.32: +version 0.33: Cross-platform path specification manipulation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/SIGNATURE new/Path-Class-0.33/SIGNATURE --- old/Path-Class-0.32/SIGNATURE 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/SIGNATURE 2013-12-12 04:47:52.000000000 +0100 @@ -1,5 +1,5 @@ This file contains message digests of all files listed in MANIFEST, -signed via the Module::Signature module, version 0.68. +signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: @@ -14,33 +14,33 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 8a47d82a249ef740f9ddc1edc0a8a1967ab5af95 Build.PL -SHA1 d483503ab40a499be572ac7b638f789289a13e5b Changes -SHA1 3baefa5156f90435f40c793b7f071e2f89a74006 INSTALL -SHA1 8cb63de1ae4c54a120beb97cacc1fe2efe4d266b LICENSE +SHA1 6ac2c44c6b51b498e1b99b7300d2ec7acbdeae2a Build.PL +SHA1 2c368cb4b8cf9b19fbc367d91aa7124f85969215 Changes +SHA1 771edd8859e502c500ae883cd9ebb7105c1b453d INSTALL +SHA1 89884a27efb5ba2d96f817f53a1726b00e185225 LICENSE SHA1 dd5bf80ec1724df9d52ce5ffcc29753b83bd8f24 MANIFEST -SHA1 22f34e51b142ffc10b6d29ec52f485a6bc2e952a META.yml -SHA1 4949343af9acf51e1eccadd2b83b906397e74fa2 Makefile.PL -SHA1 3746678adadf43a39aece706e4e3f9a46e447faf README +SHA1 86ef234e4beca4cf4675df53124e3326b67ee4ed META.yml +SHA1 1bb04d14f2d3c4f16271d55add732449843cd07b Makefile.PL +SHA1 ed8969489ffd5de1bf7e1d6e976bb550a66bb21d README SHA1 767e92b9cc035fc40c62a7deda816efddd4c14f2 README.pod -SHA1 9f5b9baa5682f8926bbbcac581431adf6ee35f7d dist.ini -SHA1 d5f5e3124978e888f81f2ba2a4da1743c14fb9ef lib/Path/Class.pm -SHA1 e3d410769736158296d337c155f8719719bce00d lib/Path/Class/Dir.pm -SHA1 c264511acf15c1a8f0d34ee97d0b1b88836ba76a lib/Path/Class/Entity.pm -SHA1 0042e7b87e5f61b0d999e5be18e61c2a1c9ea6bc lib/Path/Class/File.pm +SHA1 eb9ac556153244a9f9ef7ac46e67cd80342f9a2e dist.ini +SHA1 3a08937fcaa637509bb453f659b2a1ea4567d78a lib/Path/Class.pm +SHA1 c5c7d0576fa121e2f2709d118311b0c0d0c41b9c lib/Path/Class/Dir.pm +SHA1 0381b3ab0fa4038e272285fbca79c7a4e46c7b3e lib/Path/Class/Entity.pm +SHA1 7b791de2a209f88be3fcfaacb032de1a0ef07abc lib/Path/Class/File.pm SHA1 212c128d87fa012c36016210e6e9213112fc3c23 t/01-basic.t SHA1 2dc6abce3b4c4601fe22bce9b0d58cb9484bcd0f t/02-foreign.t -SHA1 b2acb047bd89e0388273bc5703e12e2b8a6e296e t/03-filesystem.t -SHA1 a163d4cf70142b45974ed39c78571e7ce2ba5a7f t/04-subclass.t +SHA1 e89a18c10016807e90a5070cff509c71adf36b65 t/03-filesystem.t +SHA1 d18a55c06da766987268ad541578a03a17ecee41 t/04-subclass.t SHA1 a154070d2cb1369f6cebf4228742edea39c43c63 t/05-traverse.t SHA1 c71c41e78012d9577c47aa71b6d962e2c70d0e0e t/06-traverse_filt.t SHA1 108772f2ba8c196345adf814a39a03401031651c t/07-recurseprune.t SHA1 fa45d6e6ab1cd421349dea4ef527bfd5cdc8a09e t/author-critic.t -----BEGIN PGP SIGNATURE----- -Version: GnuPG/MacGPG2 v2.0.17 (Darwin) +Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org -iEYEARECAAYFAlFHxXkACgkQgrvMBLfvlHZ/9wCfS6c7fWvewcCY9qRzQANeobwN -2b8An1gyXrGrbCou9+PsEJyFd0UihoEX -=IM95 +iEYEARECAAYFAlKpMecACgkQgrvMBLfvlHbwbACg5wAMCh5qitUbcs4R4qyB0qQQ +X8MAoI7fBptesxgYcVRv0o/OLYaM/MlP +=fjvh -----END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/dist.ini new/Path-Class-0.33/dist.ini --- old/Path-Class-0.32/dist.ini 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/dist.ini 2013-12-12 04:47:52.000000000 +0100 @@ -1,5 +1,5 @@ name = Path-Class -version = 0.32 +version = 0.33 author = Ken Williams <[email protected]> license = Perl_5 copyright_holder = Ken Williams diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/lib/Path/Class/Dir.pm new/Path-Class-0.33/lib/Path/Class/Dir.pm --- old/Path-Class-0.32/lib/Path/Class/Dir.pm 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/lib/Path/Class/Dir.pm 2013-12-12 04:47:52.000000000 +0100 @@ -2,12 +2,12 @@ package Path::Class::Dir; { - $Path::Class::Dir::VERSION = '0.32'; + $Path::Class::Dir::VERSION = '0.33'; } use Path::Class::File; use Carp(); -use base qw(Path::Class::Entity); +use parent qw(Path::Class::Entity); use IO::Dir (); use File::Path (); @@ -321,11 +321,11 @@ =head1 VERSION -version 0.32 +version 0.33 =head1 SYNOPSIS - use Path::Class qw(dir); # Export a short constructor + use Path::Class; # Exports dir() by default my $dir = dir('foo', 'bar'); # Path::Class::Dir object my $dir = Path::Class::Dir->new('foo', 'bar'); # Same thing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/lib/Path/Class/Entity.pm new/Path-Class-0.33/lib/Path/Class/Entity.pm --- old/Path-Class-0.32/lib/Path/Class/Entity.pm 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/lib/Path/Class/Entity.pm 2013-12-12 04:47:52.000000000 +0100 @@ -2,7 +2,7 @@ package Path::Class::Entity; { - $Path::Class::Entity::VERSION = '0.32'; + $Path::Class::Entity::VERSION = '0.33'; } use File::Spec 3.26; @@ -99,7 +99,7 @@ =head1 VERSION -version 0.32 +version 0.33 =head1 DESCRIPTION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/lib/Path/Class/File.pm new/Path-Class-0.33/lib/Path/Class/File.pm --- old/Path-Class-0.32/lib/Path/Class/File.pm 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/lib/Path/Class/File.pm 2013-12-12 04:47:52.000000000 +0100 @@ -2,14 +2,16 @@ package Path::Class::File; { - $Path::Class::File::VERSION = '0.32'; + $Path::Class::File::VERSION = '0.33'; } use Path::Class::Dir; -use base qw(Path::Class::Entity); +use parent qw(Path::Class::Entity); use Carp; use IO::File (); +use Perl::OSType (); +use File::Copy (); sub new { my $self = shift->SUPER::new; @@ -74,8 +76,7 @@ sub touch { my $self = shift; if (-e $self) { - my $now = time(); - utime $now, $now, $self; + utime undef, undef, $self; } else { $self->openw; } @@ -139,6 +140,49 @@ return not -e $file; } +sub copy_to { + my ($self, $dest) = @_; + if ( UNIVERSAL::isa($dest, Path::Class::File::) ) { + $dest = $dest->stringify; + die "Can't copy to file $dest: it is a directory" if -d $dest; + } elsif ( UNIVERSAL::isa($dest, Path::Class::Dir::) ) { + $dest = $dest->stringify; + die "Can't copy to directory $dest: it is a file" if -f $dest; + die "Can't copy to directory $dest: no such directory" unless -d $dest; + } elsif ( ref $dest ) { + die "Don't know how to copy files to objects of type '".ref($self)."'"; + } + + if ( !Perl::OSType::is_os_type('Unix') ) { + + return unless File::Copy::cp($self->stringify, $dest); + + } else { + + return unless (system('cp', $self->stringify, $dest) == 0); + + } + + return $self->new($dest); +} + +sub move_to { + my ($self, $dest) = @_; + if (File::Copy::move($self->stringify, $dest)) { + + my $new = $self->new($dest); + + $self->{$_} = $new->{$_} foreach (qw/ dir file /); + + return $self; + + } else { + + return; + + } +} + sub traverse { my $self = shift; my ($callback, @args) = @_; @@ -160,11 +204,11 @@ =head1 VERSION -version 0.32 +version 0.33 =head1 SYNOPSIS - use Path::Class qw(file); # Export a short constructor + use Path::Class; # Exports file() by default my $file = file('foo', 'bar.txt'); # Path::Class::File object my $file = Path::Class::File->new('foo', 'bar.txt'); # Same thing @@ -388,7 +432,7 @@ The default C<iomode> is C<r>. -Lines can also be automatically splitted, mimicking the perl command-line +Lines can also be automatically split, mimicking the perl command-line option C<-a> by using the C<split> parameter. If this parameter is used, each line will be returned as an array ref. @@ -445,6 +489,14 @@ Generally overridden whenever this class is subclassed. +=item $file->copy_to( $dest ); + +Copies the C<$file> to C<$dest>. + +=item $file->move_to( $dest ); + +Moves the C<$file> to C<$dest>. + =back =head1 AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/lib/Path/Class.pm new/Path-Class-0.33/lib/Path/Class.pm --- old/Path-Class-0.32/lib/Path/Class.pm 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/lib/Path/Class.pm 2013-12-12 04:47:52.000000000 +0100 @@ -2,7 +2,7 @@ package Path::Class; { - $Path::Class::VERSION = '0.32'; + $Path::Class::VERSION = '0.33'; } { @@ -34,7 +34,7 @@ =head1 VERSION -version 0.32 +version 0.33 =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/t/03-filesystem.t new/Path-Class-0.33/t/03-filesystem.t --- old/Path-Class-0.32/t/03-filesystem.t 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/t/03-filesystem.t 2013-12-12 04:47:52.000000000 +0100 @@ -1,10 +1,8 @@ - use strict; use Test::More; use File::Temp qw(tmpnam tempdir); -use File::Spec; -plan tests => 83; +plan tests => 101; use_ok 'Path::Class'; @@ -192,6 +190,9 @@ my $content = $file->slurp( iomode => '<:raw'); is( $content, "Line1\r\nLine2" ); + + $file->remove; + ok not -e $file; } { @@ -307,4 +308,51 @@ $dir = Path::Class::tempdir(CLEANUP => 1); isa_ok $dir, 'Path::Class::Dir'; -}; +} + +# copy_to() +{ + my $file1 = file('t', 'file1'); + my $file2 = file('t', 'file2'); + $file1->spew("some contents"); + ok -e $file1; + + my $copy = $file1->copy_to($file2); + + isa_ok $copy, "Path::Class::File"; + is($copy->stringify, $file2->stringify, "same file"); + + ok -e $file2; + is($file2->slurp, "some contents"); + + my $dir = dir('t', 'dir'); + $dir->mkpath; + $file1->copy_to($dir); + my $dest = $dir->file($file1->basename); + ok -e $dest; + is($dest->slurp, "some contents"); + + $_->remove for ($file1, $file2); + $dir->rmtree; + ok( ! -e $_, "$_ should be removed") for ($file1, $file2, $dir); +} + +# move_to() +{ + my $file1 = file('t', 'file1'); + my $src = file('t', 'file1'); + + my $file2 = file('t', 'file2'); + $file1->spew("some contents"); + ok -e $file1; + + my $move = $file1->move_to($file2); + ok -e $file2; + is($file2->slurp, "some contents"); + ok ! -e $src; + + is($file1->stringify, $file2->stringify); + + $file2->remove; + ok( ! -e $_, "$_ should be gone") for ($file1, $file2); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Path-Class-0.32/t/04-subclass.t new/Path-Class-0.33/t/04-subclass.t --- old/Path-Class-0.32/t/04-subclass.t 2013-03-19 02:55:05.000000000 +0100 +++ new/Path-Class-0.33/t/04-subclass.t 2013-12-12 04:47:52.000000000 +0100 @@ -9,14 +9,14 @@ { package My::File; - use base qw(Path::Class::File); + use parent qw(Path::Class::File); sub dir_class { return "My::Dir" } } { package My::Dir; - use base qw(Path::Class::Dir); + use parent qw(Path::Class::Dir); sub file_class { return "My::File" } } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
