[Bps-public-commit] r16286 - in Prophet/trunk/lib/Prophet: Replica

jesse at bestpractical.com jesse at bestpractical.com
Sun Oct 12 18:01:14 EDT 2008


Author: jesse
Date: Sun Oct 12 18:01:14 2008
New Revision: 16286

Modified:
   Prophet/trunk/lib/Prophet/App.pm
   Prophet/trunk/lib/Prophet/Replica/prophet.pm

Log:
* started make it possible to have an 'after-initialization' hook


Modified: Prophet/trunk/lib/Prophet/App.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/App.pm	(original)
+++ Prophet/trunk/lib/Prophet/App.pm	Sun Oct 12 18:01:14 2008
@@ -11,7 +11,7 @@
         my $self = shift;
         my $root = $ENV{'PROPHET_REPO'} || dir($ENV{'HOME'}, '.prophet');
         my $type = $self->default_replica_type;
-        return Prophet::Replica->new({ url => $type.':file://' . $root, app_handle => $self});
+        return Prophet::Replica->new({ url => $type.':file://' . $root, app_handle => $self, after_initialize => sub { $self->set_database_defaults} });
     },
 );
 
@@ -120,6 +120,14 @@
     return ( $INC{$path} ? 1 : 0);
 }
 
+sub setting {
+    my $self = shift;
+    my $uuid = shift;
+    return Prophet::DatabaseSetting->new( handle => $self->handle, uuid => $uuid);
+}
+
+
+
 __PACKAGE__->meta->make_immutable;
 no Moose;
 

Modified: Prophet/trunk/lib/Prophet/Replica/prophet.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/prophet.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/prophet.pm	Sun Oct 12 18:01:14 2008
@@ -210,7 +210,7 @@
 
 =head2 BUILD
 
-Open a connection to the SVN source identified by C<$self->url>.
+Open a connection to the prophet replica source identified by C<$self->url>.
 
 =cut
 
@@ -278,7 +278,7 @@
         die "We can only create file: based prophet replicas. It looks like you're trying to create " . $self->url;
     } else {
         die "Prophet couldn't find a replica at \"".$self->url."\"\n\n".
-            "Please check the number and dial again.\n";
+            "Please check the URL and try again.\n";
         
     }
 
@@ -306,6 +306,7 @@
         path    => 'replica-version',
         content => '1'
     );
+    $self->after_initialize->($self);
 }
 
 sub latest_sequence_no {



More information about the Bps-public-commit mailing list