X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=f4dd6747f9540b297a2c8faae57ad5f1c7f49cbb;hb=dbd6b243d9481d628842f8cda4f5c7c604fbac33;hp=b7bb450d67408523b6e23799bfd2b3d63e7eb540;hpb=00e6a2b71197b3b79b6d62a1c8154b7ca6702d2f;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b7bb450..f4dd674 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -10,6 +10,7 @@ use Catalyst::Request; use Catalyst::Request::Upload; use Catalyst::Response; use Catalyst::Utils; +use JSAN::Parse::FileDeps; use NEXT; use Text::ASCIITable; use Path::Class; @@ -38,14 +39,12 @@ our $DETACH = "catalyst_detach\n"; require Module::Pluggable::Fast; # Helper script generation -our $CATALYST_SCRIPT_GEN = 8; +our $CATALYST_SCRIPT_GEN = 9; __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log/; -our $VERSION = '5.49_01'; - -sub version { return $Catalyst::VERSION } +our $VERSION = '5.49_02'; sub import { my ( $class, @arguments ) = @_; @@ -263,6 +262,23 @@ sub forward { my $c = shift; $c->dispatcher->forward( $c, @_ ) } Accessor to the namespace of the current action +=item $c->path_to(@path) + +Merges C<@path> with $c->config->{home} and returns a L object. + +For example: + + $c->path_to( 'db', 'sqlite.db' ); + +=cut + +sub path_to { + my ( $c, @path ) = @_; + my $path = dir( $c->config->{home}, @path ); + if ( -d $path ) { return $path } + else { return file( $c->config->{home}, @path ) } +} + =item $c->setup Setup. @@ -679,7 +695,7 @@ perldoc