Skip Menu |
 

This queue is for tickets about the Catalyst-Model-File CPAN distribution.

Report information
The Basics
Id: 33373
Status: new
Priority: 0/
Queue: Catalyst-Model-File

People
Owner: Nobody in particular
Requestors: joshua.mcadams [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.06
Fixed in: (no value)



Subject: sub change_dir possibly broken
Download (untitled) / with headers
text/plain 1.1k
It looks like the last line in sub change_dir is stripping the configured root_dir off of the path and actually changing to a directory relative to root '/'. The 05cd.t seems to confirm this. $model->cd('sub', 'dir'); is(Path::Class::dir('/sub/dir'), $model->pwd, "pwd is correct"); This passes even though the model should (if i'm understanding it right) have changed to a directory within $ENV{MODEL_FILE_DIR}. The line of code that seems to be causing this in File.pm is: $self->{directory} = $self->{_dir}->relative($self->{root_dir})->absolute('/'); It looks like changing it to the line below would fix things. $self->{directory} = $self->{_dir}->relative($self->{root_dir})->absolute(); Here is what I used to test that assertion: --(0)> perl -MPath::Class::Dir -e 'print Path::Class::Dir->new("var", "files")->subdir("sub")->subdir("dir")->relative("var/files")->absolute("/"), "\n"' /sub/dir --(joshua@joshua-mcadams-powerbook-g4-12)-(~/Development/files/Files/lib/Catalyst/Model)-- --(0)> perl -MPath::Class::Dir -e 'print Path::Class::Dir->new("var", "files")->subdir("sub")->subdir("dir")->relative("var/files")->absolute(), "\n"' /Users/joshua/Development/files/Files/lib/Catalyst/Model/sub/dir


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.