Skip to content

Commit

Permalink
realpath has problems on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 5, 2017
1 parent 9908e20 commit fd3cf43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Changes
@@ -1,6 +1,6 @@

7.28 2017-03-05
- Added copy_to, realpath and sibling methods to Mojo::File.
7.28 2017-03-06
- Added copy_to and sibling methods to Mojo::File.
- Added dir option to list_tree method in Mojo::File.
- Improved app generator command to generate a config file.
(tudorconstantin)
Expand Down
8 changes: 0 additions & 8 deletions lib/Mojo/File.pm
Expand Up @@ -91,8 +91,6 @@ sub open {

sub path { __PACKAGE__->new(@_) }

sub realpath { $_[0]->new(Cwd::realpath ${$_[0]}) }

sub remove_tree {
my $self = shift;
File::Path::remove_tree $$self, @_;
Expand Down Expand Up @@ -369,12 +367,6 @@ Open file with L<IO::File>.
use Fcntl qw(O_CREAT O_EXCL O_RDWR);
my $handle = path('/home/sri/test.pl')->open(O_RDWR | O_CREAT | O_EXCL);
=head2 realpath
my $realpath = $path->realpath;
Resolve the path with L<Cwd> and return the result as a L<Mojo::File> object.
=head2 remove_tree
$path = $path->remove_tree;
Expand Down
6 changes: 1 addition & 5 deletions t/mojo/file.t
@@ -1,7 +1,7 @@
use Mojo::Base -strict;

use Test::More;
use Cwd qw(getcwd realpath);
use Cwd 'getcwd';
use Fcntl 'O_RDONLY';
use File::Basename qw(basename dirname);
use File::Spec::Functions qw(abs2rel canonpath catfile rel2abs splitdir);
Expand Down Expand Up @@ -41,10 +41,6 @@ is path('file.t')->to_abs, rel2abs('file.t'), 'same path';
is path('test.txt')->to_abs->to_rel(getcwd),
abs2rel(rel2abs('test.txt'), getcwd), 'same path';

# Resolved
is path(__FILE__)->sibling('..', 'lib')->realpath,
realpath(catfile(scalar dirname(__FILE__), '..', 'lib')), 'same path';

# Basename
is path('file.t')->to_abs->basename, basename(rel2abs 'file.t'), 'same path';
is path('file.t')->to_abs->basename('.t'), basename(rel2abs('file.t'), '.t'),
Expand Down

0 comments on commit fd3cf43

Please sign in to comment.