X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=8a2a27b48ea86088c1555c8f24a7b1e8e930f219;hp=15e4a68118086600f2018e2e0e8eb3242aa8198f;hb=4be535b191e65b338b0c7d62b7c6acad83f7d455;hpb=fbcc39ad23f2bbecf5d84c9ba581e6af86fcd460 diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 15e4a68..8a2a27b 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -127,18 +127,17 @@ Returns a tempdir for class. If create is true it will try to create the path. sub class2tempdir { my $class = shift || ''; my $create = shift || 0; - my @parts = split '::', lc $class; + my @parts = split '::', lc $class; my $tmpdir = dir( File::Spec->tmpdir, @parts )->cleanup; - if ( $create && ! -e $tmpdir ) { + if ( $create && !-e $tmpdir ) { eval { $tmpdir->mkpath }; - if ( $@ ) { + if ($@) { Catalyst::Exception->throw( - message => qq/Couldn't create tmpdir '$tmpdir', "$@"/ - ); + message => qq/Couldn't create tmpdir '$tmpdir', "$@"/ ); } } @@ -167,6 +166,7 @@ sub home { { $home = $subdir; } + # clean up relative path: # MyApp/script/.. -> MyApp my ($lastdir) = $home->dir_list( -1, 1 ); @@ -202,13 +202,12 @@ sub reflect_actions { my $class = shift; my $actions = []; eval '$actions = $class->_action_cache'; - - if ( $@ ) { - Catalyst::Exception->throw( - message => qq/Couldn't reflect actions of component "$class", "$@"/ - ); + + if ($@) { + Catalyst::Exception->throw( message => + qq/Couldn't reflect actions of component "$class", "$@"/ ); } - + return $actions; }