[Bps-public-commit] Prophet branch, config-gitlike, updated. 6e48c78ac98acf607203a2fac0f3b5067ddc13db

jesse jesse at bestpractical.com
Mon Jul 6 16:16:34 EDT 2009


The branch, config-gitlike has been updated
       via  6e48c78ac98acf607203a2fac0f3b5067ddc13db (commit)
      from  a7251c33620357a9be0efb748983363287ec6d9e (commit)

Summary of changes:
 lib/Prophet/Config.pm |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 6e48c78ac98acf607203a2fac0f3b5067ddc13db
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Jul 6 16:16:17 2009 -0400

    Extract a method from what was otherwise kind of a giant ball of goo

diff --git a/lib/Prophet/Config.pm b/lib/Prophet/Config.pm
index dfc79af..292d9a7 100644
--- a/lib/Prophet/Config.pm
+++ b/lib/Prophet/Config.pm
@@ -182,6 +182,22 @@ override load => sub  {
         # does happen, we get the positive benefit of writing the
         # config format to it.
         if ( $content !~ /\[/ ) {
+
+            $self->convert_ancient_config_file($file);
+        }
+
+    }
+
+    Prophet::CLI->start_pager();
+
+    # Do a regular load.
+    $self->SUPER::load;
+};
+
+
+sub convert_ancient_config_file {
+            my $self = shift;
+            my $file = shift;
             print "Detected old format config file $file. Converting to ".
                   "new format... ";
 
@@ -246,20 +262,13 @@ override load => sub  {
             print "done.\nOld config can be found at $backup_file; "
                   ,"new config is $file.\n\n";
 
-            Prophet::CLI->start_pager();
-        }
-
-    }
+}
 
-    # Do a regular load.
-    $self->SUPER::load;
-};
 
 sub _deprecated_repo_config_names {
     my $self = shift;
 
-    my %filenames = ( File::Spec->catfile( $self->app_handle->handle->fs_root =>
-            'prophetrc' ) => 1 );
+    my %filenames = ( File::Spec->catfile( $self->app_handle->handle->fs_root => 'prophetrc' ) => 1 );
 
     return wantarray ? %filenames : \%filenames;
 };

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



More information about the Bps-public-commit mailing list