r74974 - in /trunk/libpath-class-perl: ./ debian/ lib/Path/ lib/Path/Class/ t/
ghedo-guest at users.alioth.debian.org
ghedo-guest at users.alioth.debian.org
Tue May 31 14:15:03 UTC 2011
Author: ghedo-guest
Date: Tue May 31 14:14:55 2011
New Revision: 74974
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74974
Log:
* New upstream release
* Add myself to Uploaders
* Bump Standards-Version to 3.9.2 (no changes needed)
* Move perl to B-D-I
* Add libmodule-build-perl to B-D-I
Added:
trunk/libpath-class-perl/LICENSE
- copied unchanged from r74973, branches/upstream/libpath-class-perl/current/LICENSE
trunk/libpath-class-perl/t/author-critic.t
- copied unchanged from r74973, branches/upstream/libpath-class-perl/current/t/author-critic.t
Removed:
trunk/libpath-class-perl/t/file-spec-tests
Modified:
trunk/libpath-class-perl/Build.PL
trunk/libpath-class-perl/Changes
trunk/libpath-class-perl/MANIFEST
trunk/libpath-class-perl/META.yml
trunk/libpath-class-perl/Makefile.PL
trunk/libpath-class-perl/README
trunk/libpath-class-perl/SIGNATURE
trunk/libpath-class-perl/debian/changelog
trunk/libpath-class-perl/debian/control
trunk/libpath-class-perl/dist.ini
trunk/libpath-class-perl/lib/Path/Class.pm
trunk/libpath-class-perl/lib/Path/Class/Dir.pm
trunk/libpath-class-perl/lib/Path/Class/Entity.pm
trunk/libpath-class-perl/lib/Path/Class/File.pm
Modified: trunk/libpath-class-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/Build.PL?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/Build.PL (original)
+++ trunk/libpath-class-perl/Build.PL Tue May 31 14:14:55 2011
@@ -1,34 +1,46 @@
-use Module::Build;
+use strict;
+use warnings;
-my $b = Module::Build->new
- (
- module_name => 'Path::Class',
- license => 'perl',
- requires => {
- 'File::Spec' => 0.87,
- 'File::Spec::Mac' => 1.3,
- 'IO::Dir' => 0,
- 'IO::File' => 0,
- 'File::stat' => 0,
- 'File::Path' => 0,
- 'overload' => 0,
- 'Cwd' => 0,
- },
- build_requires => {
- 'Test::More' => 0,
- 'File::Temp' => 0,
- },
- create_makefile_pl => 'traditional',
- create_readme => 1,
- meta_merge => {
- resources => {
- repository => 'http://perl-path-class.googlecode.com/svn/trunk',
- homepage => 'http://code.google.com/p/perl-path-class',
- bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Path-Class',
- },
- },
- sign => 1,
- );
+use Module::Build 0.3601;
-$b->create_build_script;
+
+my %module_build_args = (
+ 'build_requires' => {
+ 'Module::Build' => '0.3601',
+ 'Test' => '0',
+ 'Test::More' => '0'
+ },
+ 'configure_requires' => {
+ 'ExtUtils::MakeMaker' => '6.30',
+ 'Module::Build' => '0.3601'
+ },
+ 'dist_abstract' => 'Cross-platform path specification manipulation',
+ 'dist_author' => [
+ 'Ken Williams <kwilliams at cpan.org>'
+ ],
+ 'dist_name' => 'Path-Class',
+ 'dist_version' => '0.24',
+ 'license' => 'perl',
+ 'module_name' => 'Path::Class',
+ 'recommends' => {},
+ 'recursive_test_files' => 1,
+ 'requires' => {
+ 'Carp' => '0',
+ 'Cwd' => '0',
+ 'Exporter' => '0',
+ 'File::Path' => '0',
+ 'File::Spec' => '0.87',
+ 'File::Temp' => '0',
+ 'File::stat' => '0',
+ 'IO::Dir' => '0',
+ 'IO::File' => '0',
+ 'overload' => '0'
+ },
+ 'script_files' => []
+);
+
+
+my $build = Module::Build->new(%module_build_args);
+
+$build->create_build_script;
Modified: trunk/libpath-class-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/Changes?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/Changes (original)
+++ trunk/libpath-class-perl/Changes Tue May 31 14:14:55 2011
@@ -1,4 +1,13 @@
Revision history for Perl extension Path::Class.
+
+0.24 Sat May 28 20:52:39 CDT 2011
+
+ - Added a tempfile() method for Dir objects, which provides an
+ interface to File::Temp. [RT#60485]
+
+ - Fixed a non-helpful fatal error message when calling resolve() on a
+ path that doesn't exist. Now dies with the proper "No such file or
+ directory" message & exit status. [GRAF]
0.23 - Sun Dec 26 13:35:53 CST 2010
Modified: trunk/libpath-class-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/MANIFEST?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/MANIFEST (original)
+++ trunk/libpath-class-perl/MANIFEST Tue May 31 14:14:55 2011
@@ -1,6 +1,7 @@
Build.PL
Changes
INSTALL
+LICENSE
MANIFEST
META.yml
Makefile.PL
@@ -15,4 +16,4 @@
t/02-foreign.t
t/03-filesystem.t
t/04-subclass.t
-t/file-spec-tests
+t/author-critic.t
Modified: trunk/libpath-class-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/META.yml?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/META.yml (original)
+++ trunk/libpath-class-perl/META.yml Tue May 31 14:14:55 2011
@@ -3,22 +3,26 @@
author:
- 'Ken Williams <kwilliams at cpan.org>'
build_requires:
- File::Temp: 0
+ Module::Build: 0.3601
+ Test: 0
Test::More: 0
configure_requires:
- ExtUtils::MakeMaker: 6.31
+ ExtUtils::MakeMaker: 6.30
+ Module::Build: 0.3601
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
+generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.102400'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Path-Class
requires:
+ Carp: 0
Cwd: 0
+ Exporter: 0
File::Path: 0
File::Spec: 0.87
- File::Spec::Mac: 1.3
+ File::Temp: 0
File::stat: 0
IO::Dir: 0
IO::File: 0
@@ -26,4 +30,4 @@
resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Path-Class
repository: http://perl-path-class.googlecode.com/svn/trunk
-version: 0.23
+version: 0.24
Modified: trunk/libpath-class-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/Makefile.PL?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/Makefile.PL (original)
+++ trunk/libpath-class-perl/Makefile.PL Tue May 31 14:14:55 2011
@@ -4,7 +4,7 @@
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker 6.30;
@@ -12,27 +12,31 @@
'ABSTRACT' => 'Cross-platform path specification manipulation',
'AUTHOR' => 'Ken Williams <kwilliams at cpan.org>',
'BUILD_REQUIRES' => {
- 'File::Temp' => '0',
+ 'Module::Build' => '0.3601',
+ 'Test' => '0',
'Test::More' => '0'
},
'CONFIGURE_REQUIRES' => {
- 'ExtUtils::MakeMaker' => '6.31'
+ 'ExtUtils::MakeMaker' => '6.30',
+ 'Module::Build' => '0.3601'
},
'DISTNAME' => 'Path-Class',
'EXE_FILES' => [],
'LICENSE' => 'perl',
'NAME' => 'Path::Class',
'PREREQ_PM' => {
+ 'Carp' => '0',
'Cwd' => '0',
+ 'Exporter' => '0',
'File::Path' => '0',
'File::Spec' => '0.87',
- 'File::Spec::Mac' => '1.3',
+ 'File::Temp' => '0',
'File::stat' => '0',
'IO::Dir' => '0',
'IO::File' => '0',
'overload' => '0'
},
- 'VERSION' => '0.23',
+ 'VERSION' => '0.24',
'test' => {
'TESTS' => 't/*.t'
}
Modified: trunk/libpath-class-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/README?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/README (original)
+++ trunk/libpath-class-perl/README Tue May 31 14:14:55 2011
@@ -1,127 +1,13 @@
-NAME
- Path::Class - Cross-platform path specification manipulation
-SYNOPSIS
- use Path::Class;
-
- my $dir = dir('foo', 'bar'); # Path::Class::Dir object
- my $file = file('bob', 'file.txt'); # Path::Class::File object
-
- # Stringifies to 'foo/bar' on Unix, 'foo\bar' on Windows, etc.
- print "dir: $dir\n";
-
- # Stringifies to 'bob/file.txt' on Unix, 'bob\file.txt' on Windows
- print "file: $file\n";
-
- my $subdir = $dir->subdir('baz'); # foo/bar/baz
- my $parent = $subdir->parent; # foo/bar
- my $parent2 = $parent->parent; # foo
-
- my $dir2 = $file->dir; # bob
- # Work with foreign paths
- use Path::Class qw(foreign_file foreign_dir);
- my $file = foreign_file('Mac', ':foo:file.txt');
- print $file->dir; # :foo:
- print $file->as_foreign('Win32'); # foo\file.txt
-
- # Interact with the underlying filesystem:
-
- # $dir_handle is an IO::Dir object
- my $dir_handle = $dir->open or die "Can't read $dir: $!";
-
- # $file_handle is an IO::File object
- my $file_handle = $file->open($mode) or die "Can't read $file: $!";
+This archive contains the distribution Path-Class,
+version 0.24:
-DESCRIPTION
- `Path::Class' is a module for manipulation of file and directory
- specifications (strings describing their locations, like
- `'/home/ken/foo.txt'' or `'C:\Windows\Foo.txt'') in a cross-platform
- manner. It supports pretty much every platform Perl runs on, including
- Unix, Windows, Mac, VMS, Epoc, Cygwin, OS/2, and NetWare.
+ Cross-platform path specification manipulation
- The well-known module `File::Spec' also provides this service, but it's
- sort of awkward to use well, so people sometimes avoid it, or use it in
- a way that won't actually work properly on platforms significantly
- different than the ones they've tested their code on.
+This software is copyright (c) 2011 by Ken Williams.
- In fact, `Path::Class' uses `File::Spec' internally, wrapping all the
- unsightly details so you can concentrate on your application code.
- Whereas `File::Spec' provides functions for some common path
- manipulations, `Path::Class' provides an object-oriented model of the
- world of path specifications and their underlying semantics.
- `File::Spec' doesn't create any objects, and its classes represent the
- different ways in which paths must be manipulated on various platforms
- (not a very intuitive concept). `Path::Class' creates objects
- representing files and directories, and provides methods that relate
- them to each other. For instance, the following `File::Spec' code:
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
- my $absolute = File::Spec->file_name_is_absolute(
- File::Spec->catfile( @dirs, $file )
- );
- can be written using `Path::Class' as
-
- my $absolute = Path::Class::File->new( @dirs, $file )->is_absolute;
-
- or even as
-
- my $absolute = file( @dirs, $file )->is_absolute;
-
- Similar readability improvements should happen all over the place when
- using `Path::Class'.
-
- Using `Path::Class' can help solve real problems in your code too - for
- instance, how many people actually take the "volume" (like `C:' on
- Windows) into account when writing `File::Spec'-using code? I thought
- not. But if you use `Path::Class', your file and directory objects will
- know what volumes they refer to and do the right thing.
-
- The guts of the `Path::Class' code live in the `Path::Class::File' and
- `Path::Class::Dir' modules, so please see those modules' documentation
- for more details about how to use them.
-
- EXPORT
-
- The following functions are exported by default.
-
- file
- A synonym for `Path::Class::File->new'.
-
- dir A synonym for `Path::Class::Dir->new'.
-
- If you would like to prevent their export, you may explicitly pass an
- empty list to perl's `use', i.e. `use Path::Class ()'.
-
- The following are exported only on demand.
-
- foreign_file
- A synonym for `Path::Class::File->new_foreign'.
-
- foreign_dir
- A synonym for `Path::Class::Dir->new_foreign'.
-
-Notes on Cross-Platform Compatibility
- Although it is much easier to write cross-platform-friendly code with
- this module than with `File::Spec', there are still some issues to be
- aware of.
-
- * Some platforms, notably VMS and some older versions of DOS (I
- think), all filenames must have an extension. Thus if you create a
- file called foo/bar and then ask for a list of files in the
- directory foo, you may find a file called bar. instead of the bar
- you were expecting. Thus it might be a good idea to use an extension
- in the first place.
-
-AUTHOR
- Ken Williams, KWILLIAMS at cpan.org
-
-COPYRIGHT
- Copyright (c) Ken Williams. All rights reserved.
-
- This library is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
-SEE ALSO
- Path::Class::Dir, Path::Class::File, File::Spec
-
Modified: trunk/libpath-class-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/SIGNATURE?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/SIGNATURE (original)
+++ trunk/libpath-class-perl/SIGNATURE Tue May 31 14:14:55 2011
@@ -14,27 +14,28 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 3e94b50826015fe7ac1e769cadd656b53317d4ab Build.PL
-SHA1 1923d4e05cce842d978a78536a958388a3675873 Changes
+SHA1 ea792bf52b566bff462a76a5d4d50433e0b527ea Build.PL
+SHA1 247c8647d187a81327719ee36cf6d4f9703db733 Changes
SHA1 066a2dba8084a0c2a7e4b6996ad21872bc16beb5 INSTALL
-SHA1 f4f533d5ba595558e925934701b6a624c1ae263a MANIFEST
-SHA1 8d450b38f6346a82944f17f0b25be8c8d2a49df7 META.yml
-SHA1 c56ae13703aa3a30404e13a4b321818fc865b8f2 Makefile.PL
-SHA1 a7b1cdcddb8679dff993b475939abcfb73076afb README
-SHA1 b40373e05544adc4447c5fad2509368fc6213b03 dist.ini
-SHA1 e3b4393203382a6a4194a6ec852942f8898c8a61 lib/Path/Class.pm
-SHA1 1aa682b45c70d04aecc6ba2b9cf7402650abbf5a lib/Path/Class/Dir.pm
-SHA1 16c0113abd50b90bb9aa739fa5ee4b549e0ffbe1 lib/Path/Class/Entity.pm
-SHA1 0ea60757f1483cb4287adcdf33c4c8233ba3fd90 lib/Path/Class/File.pm
+SHA1 da0b89eff79e9d5128ab28d63e099b840cca39bf LICENSE
+SHA1 52cb7d3f48ff3c95c8459535d1bd6e123ec44501 MANIFEST
+SHA1 fb09dac402763a91c50f3e1949a51813f509afdb META.yml
+SHA1 ce72ebc3d68832477effb18bc248d92211874f14 Makefile.PL
+SHA1 243b575c9d7769d2cfd29c189ec2be8c883c4ece README
+SHA1 a6ebbb825cd8d9c406a02ac08f3b7680d5d285f2 dist.ini
+SHA1 07aaa412631cc8e6ea4276b3f3ea1fffbe5065f5 lib/Path/Class.pm
+SHA1 8d6415121b20b7a701290105646ac48f0f691b5b lib/Path/Class/Dir.pm
+SHA1 0549c1d2150621445a31f7688b2f5a878bb662f2 lib/Path/Class/Entity.pm
+SHA1 8193c8bd639e4e5c01bbaf4f173970fa3a992507 lib/Path/Class/File.pm
SHA1 212c128d87fa012c36016210e6e9213112fc3c23 t/01-basic.t
SHA1 a42f4b07e4c42e7a59b960b13c5466d7cd82e17a t/02-foreign.t
SHA1 ff702cdbf0bb4c25959cbc5a5c7db17772b7aa5b t/03-filesystem.t
SHA1 a163d4cf70142b45974ed39c78571e7ce2ba5a7f t/04-subclass.t
-SHA1 2c32aa5691540466533ae7c06753160f020818e9 t/file-spec-tests
+SHA1 fa45d6e6ab1cd421349dea4ef527bfd5cdc8a09e t/author-critic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
-iD8DBQFNF5rDgrvMBLfvlHYRAvbMAJ98sj5UZ5yLj0FkiXyu7P/NHq0vGACgnry1
-iuQgkpeJgSCL7Ljh0hfJRcQ=
-=Fky1
+iD8DBQFN4acwgrvMBLfvlHYRAmIXAKC4w/k04B/Pm3pj3AUHDLUBxEKmFgCgpr+J
+vFWvOuqcL5jRV9XPXUxGOCI=
+=+Fzk
-----END PGP SIGNATURE-----
Modified: trunk/libpath-class-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/debian/changelog?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/debian/changelog (original)
+++ trunk/libpath-class-perl/debian/changelog Tue May 31 14:14:55 2011
@@ -1,3 +1,13 @@
+libpath-class-perl (0.24-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Add myself to Uploaders
+ * Bump Standards-Version to 3.9.2 (no changes needed)
+ * Move perl to B-D-I
+ * Add libmodule-build-perl to B-D-I
+
+ -- Alessandro Ghedini <al3xbio at gmail.com> Tue, 31 May 2011 16:06:24 +0200
+
libpath-class-perl (0.23-1) unstable; urgency=low
[ Ansgar Burchardt ]
@@ -18,8 +28,8 @@
* debian/copyright: Refresh to revision 135 of DEP5 format-
specification for machine-readable copyright file. Explicitly point
to GPL-1 license text in common-licenses.
- * debian/control:
- - Drop alternate Build-Depends on perl (>= 5.10) | libmodule-build-perl
+ * debian/control:
+ - Drop alternate Build-Depends on perl (>= 5.10) | libmodule-build-perl
as stable has the required versions and oldstable is gone.
- Remove the Build-Depends-Indep field. perl Build-Depends already
satisfied.
@@ -90,8 +100,8 @@
- Build-Depends on debhelper (>= 7).
- Drop Build-Depends on libmodule-build-perl
* debian/rules: use tiny rules file and use Makefile.PL now.
- * debian/compat: Set debhelper compatibility level to 7.
- * debian/copyright: switch to new machine readable format.
+ * debian/compat: Set debhelper compatibility level to 7.
+ * debian/copyright: switch to new machine readable format.
-- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com> Wed, 17 Jun 2009 22:15:32 +0200
Modified: trunk/libpath-class-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/debian/control?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/debian/control (original)
+++ trunk/libpath-class-perl/debian/control Tue May 31 14:14:55 2011
@@ -1,11 +1,14 @@
Source: libpath-class-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 8), perl
+Build-Depends: debhelper (>= 8)
+Build-Depends-Indep: perl,
+ libmodule-build-perl (>= 0.3601)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Salvatore Bonaccorso <carnil at debian.org>,
- Jonathan Yu <jawnsy at cpan.org>, Ansgar Burchardt <ansgar at debian.org>
-Standards-Version: 3.9.1
+ Jonathan Yu <jawnsy at cpan.org>, Ansgar Burchardt <ansgar at debian.org>,
+ Alessandro Ghedini <al3xbio at gmail.com>
+Standards-Version: 3.9.2
Homepage: http://search.cpan.org/dist/Path-Class/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libpath-class-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libpath-class-perl/
Modified: trunk/libpath-class-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/dist.ini?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/dist.ini (original)
+++ trunk/libpath-class-perl/dist.ini Tue May 31 14:14:55 2011
@@ -1,37 +1,25 @@
name = Path-Class
-version = 0.23
+version = 0.24
author = Ken Williams <kwilliams at cpan.org>
license = Perl_5
copyright_holder = Ken Williams
-[GatherDir]
+[@Basic]
[PkgVersion]
[PodVersion]
-[TestRelease]
-[ConfirmRelease]
-[UploadToCPAN]
+[PruneFiles]
+match = ~$
+match = ^Path-Class
-[MetaYAML]
-[MakeMaker]
-[PruneCruft]
-[Manifest]
[Signature]
-
[Bugtracker]
[Repository]
+[ModuleBuild]
-[Prereqs]
-File::Spec = 0.87
-File::Spec::Mac = 1.3
-IO::Dir = 0
-IO::File = 0
-File::stat = 0
-File::Path = 0
-overload = 0
-Cwd = 0
+[CriticTests]
+;[PodCoverageTests]
-[Prereqs / TestRequires]
-Test::More = 0
-File::Temp = 0
+[AutoPrereqs]
+skip = ^English$
Modified: trunk/libpath-class-perl/lib/Path/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/lib/Path/Class.pm?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/lib/Path/Class.pm (original)
+++ trunk/libpath-class-perl/lib/Path/Class.pm Tue May 31 14:14:55 2011
@@ -1,13 +1,18 @@
+use strict;
+
package Path::Class;
BEGIN {
- $Path::Class::VERSION = '0.23';
+ $Path::Class::VERSION = '0.24';
}
- at ISA = qw(Exporter);
- at EXPORT = qw(file dir);
- at EXPORT_OK = qw(file dir foreign_file foreign_dir);
+{
+ ## no critic
+ no strict 'vars';
+ @ISA = qw(Exporter);
+ @EXPORT = qw(file dir);
+ @EXPORT_OK = qw(file dir foreign_file foreign_dir);
+}
-use strict;
use Exporter;
use Path::Class::File;
use Path::Class::Dir;
@@ -27,7 +32,7 @@
=head1 VERSION
-version 0.23
+version 0.24
=head1 SYNOPSIS
Modified: trunk/libpath-class-perl/lib/Path/Class/Dir.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/lib/Path/Class/Dir.pm?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/lib/Path/Class/Dir.pm (original)
+++ trunk/libpath-class-perl/lib/Path/Class/Dir.pm Tue May 31 14:14:55 2011
@@ -1,15 +1,17 @@
+use strict;
+
package Path::Class::Dir;
BEGIN {
- $Path::Class::Dir::VERSION = '0.23';
-}
-
-use strict;
+ $Path::Class::Dir::VERSION = '0.24';
+}
+
use Path::Class::File;
use Carp();
use base qw(Path::Class::Entity);
use IO::Dir ();
use File::Path ();
+use File::Temp ();
# updir & curdir on the local machine, for screening them out in
# children(). Note that they don't respect 'foreign' semantics.
@@ -207,6 +209,7 @@
my $next = $self->{dh}->read;
unless (defined $next) {
delete $self->{dh};
+ ## no critic
return undef;
}
@@ -254,6 +257,11 @@
return !!(-d $self and (-e $other or -l $other) and $self->subsumes($other));
}
+sub tempfile {
+ my $self = shift;
+ return File::Temp::tempfile(@_, DIR => $self->stringify);
+}
+
1;
__END__
@@ -263,7 +271,7 @@
=head1 VERSION
-version 0.23
+version 0.24
=head1 SYNOPSIS
@@ -590,6 +598,37 @@
This method is mainly provided for consistency with
C<Path::Class::File>'s C<remove()> method.
+=item $dir->tempfile(...)
+
+An interface to C<File::Temp>'s C<tempfile()> function. Just like
+that function, if you call this in a scalar context, the return value
+is the filehandle and the file is C<unlink>ed as soon as possible
+(which is immediately on Unix-like platforms). If called in a list
+context, the return values are the filehandle and the filename.
+
+The given directory is passed as the C<DIR> parameter.
+
+Here's an example of pretty good usage which doesn't allow race
+conditions, won't leave yucky tempfiles around on your filesystem,
+etc.:
+
+ my $fh = $dir->tempfile;
+ print $fh "Here's some data...\n";
+ seek($fh, 0, 0);
+ while (<$fh>) { do something... }
+
+Or in combination with a C<fork>:
+
+ my $fh = $dir->tempfile;
+ print $fh "Here's some more data...\n";
+ seek($fh, 0, 0);
+ if ($pid=fork()) {
+ wait;
+ } else {
+ something($_) while <$fh>;
+ }
+
+
=item $dir_or_file = $dir->next()
A convenient way to iterate through directory contents. The first
Modified: trunk/libpath-class-perl/lib/Path/Class/Entity.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/lib/Path/Class/Entity.pm?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/lib/Path/Class/Entity.pm (original)
+++ trunk/libpath-class-perl/lib/Path/Class/Entity.pm Tue May 31 14:14:55 2011
@@ -1,10 +1,11 @@
+use strict;
+
package Path::Class::Entity;
BEGIN {
- $Path::Class::Entity::VERSION = '0.23';
+ $Path::Class::Entity::VERSION = '0.24';
}
-use strict;
-use File::Spec;
+use File::Spec 0.87;
use File::stat ();
use Cwd;
@@ -30,6 +31,7 @@
die "Invalid system type '$type'" unless ($type) = $type =~ /^(\w+)$/; # Untaint
my $spec = "File::Spec::$type";
+ ## no critic
eval "require $spec; 1" or die $@;
return $spec;
}
@@ -61,7 +63,8 @@
sub resolve {
my $self = shift;
- my $cleaned = $self->new( Cwd::realpath($self->stringify) );
+ die $! unless -e $self; # No such file or directory
+ my $cleaned = $self->new( scalar Cwd::realpath($self->stringify) );
# realpath() always returns absolute path, kind of annoying
$cleaned = $cleaned->relative if $self->is_relative;
@@ -93,7 +96,7 @@
=head1 VERSION
-version 0.23
+version 0.24
=head1 DESCRIPTION
Modified: trunk/libpath-class-perl/lib/Path/Class/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpath-class-perl/lib/Path/Class/File.pm?rev=74974&op=diff
==============================================================================
--- trunk/libpath-class-perl/lib/Path/Class/File.pm (original)
+++ trunk/libpath-class-perl/lib/Path/Class/File.pm Tue May 31 14:14:55 2011
@@ -1,9 +1,10 @@
+use strict;
+
package Path::Class::File;
BEGIN {
- $Path::Class::File::VERSION = '0.23';
-}
-
-use strict;
+ $Path::Class::File::VERSION = '0.24';
+}
+
use Path::Class::Dir;
use base qw(Path::Class::Entity);
use Carp;
@@ -103,7 +104,7 @@
=head1 VERSION
-version 0.23
+version 0.24
=head1 SYNOPSIS
More information about the Pkg-perl-cvs-commits
mailing list