[Jifty-commit] jifty branch, master, updated. jifty-1.01209-1-g787e19f

Jifty commits jifty-commit at lists.jifty.org
Fri Dec 10 11:54:33 EST 2010


The branch, master has been updated
       via  787e19fe8c41227d1fb0fd1bb23fc97cf1efe374 (commit)
      from  6dbafd4aff3a5a0e7164a5218ca9a907bef4a86b (commit)

Summary of changes:
 lib/Jifty/Script/App.pm |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 787e19fe8c41227d1fb0fd1bb23fc97cf1efe374
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Dec 10 11:51:39 2010 -0500

    Point users to perldoc Jifty::Config in the new app config file
    
    This resolves [rt.cpan.org #24787].

diff --git a/lib/Jifty/Script/App.pm b/lib/Jifty/Script/App.pm
index 0bf189c..4ba0322 100644
--- a/lib/Jifty/Script/App.pm
+++ b/lib/Jifty/Script/App.pm
@@ -199,9 +199,18 @@ sub _write_config {
     my $cfg = Jifty::Config->new(load_config => 0);
     my $default_config = $cfg->initial_config($self->dist_name);
     my $file = join("/",$self->prefix, 'etc','config.yml');
+
+    # Open the file ourselves so we can print a comment to it before the
+    # default YAML config
+    open my $fh, '>', $file
+        or die "Can't create configuration file '$file': $!\n";
+    binmode $fh, ':utf8';
+
     print("Creating configuration file $file\n");
-    Jifty::YAML::DumpFile($file => $default_config);
 
+    print $fh "# See perldoc Jifty::Config for more information about config files\n";
+    Jifty::YAML::DumpFile($fh => $default_config);
+    close $fh;
 }
 
 

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list