Added pod
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index c5c315e..46f6bae 100644 (file)
@@ -444,6 +444,12 @@ Returns or takes a hashref containing the application's configuration.
 
     __PACKAGE__->config({ db => 'dsn:SQLite:foo.db' });
 
+You can also use a L<YAML> config file like myapp.yml in your
+applications home directory.
+
+    ---
+    db: dsn:SQLite:foo.db
+
 =head2 $c->debug
 
 Overload to enable debug messages (same as -Debug option).
@@ -575,9 +581,9 @@ sub setup {
     $class->setup_home( delete $flags->{home} );
 
     # YAML config support
-    my $confpath =
-      $class->path_to(
-        Catalyst::Utils::appprefix( ref $class || $class ) . '.yml' );
+    my $confpath = $class->config->{file}
+      || $class->path_to(
+        ( Catalyst::Utils::appprefix( ref $class || $class ) . '.yml' ) );
     my $conf = {};
     $conf = YAML::LoadFile($confpath) if -f $confpath;
     my $oldconf = $class->config;