[Jifty-commit] r742 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Mar 26 05:47:00 EST 2006


Author: jesse
Date: Sun Mar 26 05:47:00 2006
New Revision: 742

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Config.pm

Log:
 r10484 at hualien:  jesse | 2006-03-26 12:55:59 +0900
 * As requested by Alex, we no longer write DefaultStaticRoot and DefaultTemplateRoot
   into config files


Modified: jifty/trunk/lib/Jifty/Config.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Config.pm	(original)
+++ jifty/trunk/lib/Jifty/Config.pm	Sun Mar 26 05:47:00 2006
@@ -137,6 +137,9 @@
     # Whatever's in the stash overrides anything we guess
     $self->stash( Hash::Merge::merge( $self->guess, $self->stash ));
 
+    # There are a couple things we want to guess that we don't want
+    # getting stuck in a default config file for an app
+    $self->stash( Hash::Merge::merge( $self->defaults, $self->stash));
 
     # Finally, check for global postload hooks (these are used by the
     # test harness)
@@ -226,8 +229,6 @@
             Mailer     => 'Sendmail',
             MailerArgs => [],
             Web        => {
-                DefaultStaticRoot => Jifty::Util->share_root . '/web/static',
-                DefaultTemplateRoot => Jifty::Util->share_root . '/web/templates',
                 Port => '8888',
                 BaseURL => 'http://localhost',
                 SessionDir  => "var/session",
@@ -248,6 +249,28 @@
 
 }
 
+
+=head2 defaults
+
+We have a couple default values that shouldn't be included in the
+"guessed" config, as that routine is used when initializing a new 
+application. Generally, these are platform-specific file locations.
+
+=cut
+
+sub defaults {
+    my $self = shift;
+    return {
+        framework => {
+            Web => {
+                DefaultStaticRoot => Jifty::Util->share_root . '/web/static',
+                DefaultTemplateRoot => Jifty::Util->share_root . '/web/templates',
+            }
+        }
+    };
+
+}
+
 =head2 load_file PATH
 
 Loads a YAML configuration file and returns a hashref to that file's


More information about the Jifty-commit mailing list