Changeset 219
- Timestamp:
- 04/06/07 20:39:30 (2 years ago)
- Files:
-
- trunk/src/core/IO-All/Changes (modified) (1 diff)
- trunk/src/core/IO-All/META.yml (modified) (1 diff)
- trunk/src/core/IO-All/lib/IO/All.pm (modified) (2 diffs)
- trunk/src/core/IO-All/t/file_spec.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/core/IO-All/Changes
r45 r219 1 --- 2 version: 0.37 3 date: Fri Apr 6 18:04:27 JST 2007 4 changes: 5 - make catdir work with current dir in addition to other args. 6 - make catfile work with current dir in addition to other args. 7 --- 1 8 version: 0.36 2 9 date: Mon Oct 16 14:48:58 PDT 2006 trunk/src/core/IO-All/META.yml
r45 r219 5 5 generated_by: hand 6 6 distribution_type: module 7 version: 0.3 67 version: 0.37 8 8 name: IO-All 9 9 author: Ingy döt Net <ingy@cpan.org> trunk/src/core/IO-All/lib/IO/All.pm
r45 r219 7 7 sub Carp::carp; 8 8 use IO::All::Base -base; 9 our $VERSION = '0.3 6';9 our $VERSION = '0.37'; 10 10 use File::Spec(); 11 11 use Symbol(); … … 413 413 #=============================================================================== 414 414 sub canonpath {my $self = shift; File::Spec->canonpath($self->pathname) } 415 sub catdir {my $self = shift; $self->new->dir(File::Spec->catdir(@_)) } 416 sub catfile {my $self = shift; $self->new->file(File::Spec->catfile(@_)) } 415 sub catdir { 416 my $self = shift; 417 my @args = grep defined, $self->name, @_; 418 io->dir(File::Spec->catdir(@args)); 419 } 420 sub catfile { 421 my $self = shift; 422 my @args = grep defined, $self->name, @_; 423 io->file(File::Spec->catfile(@args)); 424 } 417 425 sub join {my $self = shift; $self->catfile(@_) } 418 426 sub curdir {my $self = shift; $self->new->dir(File::Spec->curdir) } trunk/src/core/IO-All/t/file_spec.t
r45 r219 2 2 use strict; 3 3 use warnings; 4 use Test::More tests => 2 2;4 use Test::More tests => 28; 5 5 use IO::All; 6 6 use IO_All_Test; … … 35 35 is(io('/foo/bar/baz')->abs2rel('/foo'), f 'bar/baz'); 36 36 is(io('foo/bar/baz')->rel2abs('/moo'), f '/moo/foo/bar/baz'); 37 38 is(io->dir('doo/foo')->catdir('goo', 'hoo'), f 'doo/foo/goo/hoo'); 39 is(io->dir->catdir('goo', 'hoo'), f 'goo/hoo'); 40 is(io->catdir('goo', 'hoo'), f 'goo/hoo'); 41 42 is(io->file('doo/foo')->catfile('goo', 'hoo'), f 'doo/foo/goo/hoo'); 43 is(io->file->catfile('goo', 'hoo'), f 'goo/hoo'); 44 is(io->catfile('goo', 'hoo'), f 'goo/hoo');
