Updated script generation
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index b7bb450..9e73489 100644 (file)
@@ -38,14 +38,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 +261,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<Path::Class> 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 +694,7 @@ perldoc <a href="http://cpansearch.perl.org/dist/Catalyst/lib/Catalyst/Manual.po
                      </li>
                  </ul>
                  <h2>In conclusion</h2>
-                 <p>The Catalyst team hope you will enjoy using Catalyst as much 
+                 <p>The Catalyst team hopes you will enjoy using Catalyst as much 
                     as we enjoyed making it. Please contact us if you have ideas
                     for improvement or other feedback.</p>
              </div>
@@ -1536,6 +1551,15 @@ sub write {
     return $c->engine->write( $c, @_ );
 }
 
+=item version
+
+Returns the Catalyst version number. mostly useful for powered by messages
+in template systems.
+
+=cut
+
+sub version { return $Catalyst::VERSION }
+
 =back
 
 =head1 CASE SENSITIVITY