[jifty-devel] Fix for Jifty::Util->make_path() problem
Jesse Vincent
jesse at bestpractical.com
Sun May 7 13:37:55 EDT 2006
On Sun, May 07, 2006 at 01:32:10PM -0400, Sean E. Millichamp wrote:
> I just tried to create a new Action template with 'jifty action --name'
> with the latest SVN update and got the following error:
I think the "bigger" problem is our inconsistent use:
./lib/Jifty/Handler.pm: Jifty::Util->make_path( Jifty::Util->absolute_path($_) );
./lib/Jifty/Script/Action.pm: Jifty::Util::make_path($dir);
./lib/Jifty/Script/Model.pm: Jifty::Util::make_path($dir);
./lib/Jifty/Action/Devel/FileEditor.pm: Jifty::Util->make_path( File::Basename::dirname( $dest ) );
./blib/lib/Jifty/Action/Devel/FileEditor.pm: Jifty::Util->make_path( File::Basename::dirname( $dest ) );
./blib/lib/Jifty/Script/Action.pm: Jifty::Util::make_path($dir);
./blib/lib/Jifty/Script/Model.pm: Jifty::Util::make_path($dir) unless (-d $dir);
./blib/lib/Jifty/Handler.pm: Jifty::Util->make_path( Jifty::Util->absolute_path($_) );
I'm going to fix the subroutine calls to method calls, since it feels a bit more consistent.
But nice catch. I'd misunderstood the issue when it was first reported last night.
> WARN - Use of uninitialized value in -d
> at /usr/lib/perl5/site_perl/5.8.8/Jifty/Util.pm line 163.
>
> WARN - Use of uninitialized value in -d
> at /usr/lib/perl5/5.8.8/File/Path.pm line 159.
>
> fileparse(): need a valid pathname at /usr/lib/perl5/5.8.8/File/Path.pm
> line 160
>
> I did some grepping through the source and it seemed that the "my $self
> = shift" was always unnecessary in Jifty::Util::make_path() since it was
> never called as an object.
>
> Here is a patch against r1017 to remove that line.
>
> Sean
>
> --
> Sean E. Millichamp, Enertron LLC, 586-757-1200 x102
>
> Index: lib/Jifty/Util.pm
> ===================================================================
> --- lib/Jifty/Util.pm (revision 1017)
> +++ lib/Jifty/Util.pm (working copy)
> @@ -158,7 +158,6 @@
> =cut
>
> sub make_path {
> - my $self = shift;
> my $whole_path = shift;
> return 1 if (-d $whole_path);
> File::Path::mkpath([$whole_path]);
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
More information about the jifty-devel
mailing list