[Bps-public-commit] Prophet - A disconnected, replicated p2p database branch, master, updated. b902f95e6b327e72489334997ca87a90d4d5355c
jesse
jesse at bestpractical.com
Mon Feb 9 21:36:56 EST 2009
The branch, master has been updated
via b902f95e6b327e72489334997ca87a90d4d5355c (commit)
from 80c18a719958eeb3d8013e84a2a74bfcc0bf3d29 (commit)
Summary of changes:
lib/Prophet/CLI/Command/Publish.pm | 16 ++++------------
lib/Prophet/CLI/Command/Push.pm | 5 +++--
lib/Prophet/Replica/prophet.pm | 5 +++--
lib/Prophet/Replica/sqlite.pm | 3 ++-
4 files changed, 12 insertions(+), 17 deletions(-)
- Log -----------------------------------------------------------------
commit b902f95e6b327e72489334997ca87a90d4d5355c
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Feb 9 21:36:33 2009 -0500
Remove use of Class::Method::Modifiers for great dependency justice
diff --git a/lib/Prophet/CLI/Command/Publish.pm b/lib/Prophet/CLI/Command/Publish.pm
index 79fd5bd..0149fc2 100644
--- a/lib/Prophet/CLI/Command/Publish.pm
+++ b/lib/Prophet/CLI/Command/Publish.pm
@@ -7,18 +7,14 @@ with 'Prophet::CLI::CollectionCommand';
use File::Path;
use File::Spec;
-before run => sub {
+sub run {
my $self = shift;
+
die "Please specify a --to.\n" unless $self->has_arg('to');
# set the temp directory where we will do all of our work, which will be
# published via rsync
$self->set_arg(path => $self->tempdir);
-};
-
-around run => sub {
- my $orig = shift;
- my $self = shift;
my $export_html = $self->has_arg('html');
my $export_replica = $self->has_arg('replica');
@@ -34,13 +30,9 @@ around run => sub {
# otherwise, do the normal prophet export this replica
if ($export_replica) {
print "Exporting a clone of this replia\n";
- $self->$orig(@_)
+ $self->SUPER::run(@_)
}
-};
-# the tempdir is populated, now publish it
-after run => sub {
- my $self = shift;
my $from = $self->arg('path');
my $to = $self->arg('to');
@@ -51,7 +43,7 @@ after run => sub {
);
print "Publication complete.\n";
-};
+}
sub export_html {
my $self = shift;
diff --git a/lib/Prophet/CLI/Command/Push.pm b/lib/Prophet/CLI/Command/Push.pm
index ce448b4..34f39a1 100644
--- a/lib/Prophet/CLI/Command/Push.pm
+++ b/lib/Prophet/CLI/Command/Push.pm
@@ -2,14 +2,15 @@ package Prophet::CLI::Command::Push;
use Any::Moose;
extends 'Prophet::CLI::Command::Merge';
-before run => sub {
+sub run {
my $self = shift;
die "Please specify a --to.\n" if !$self->has_arg('to');
$self->set_arg(from => $self->app_handle->default_replica_type.":file://".$self->handle->fs_root);
$self->set_arg(db_uuid => $self->handle->db_uuid);
-};
+ $self->SUPER::run(@_);
+}
__PACKAGE__->meta->make_immutable;
no Any::Moose;
diff --git a/lib/Prophet/Replica/prophet.pm b/lib/Prophet/Replica/prophet.pm
index 9b2366e..db58637 100644
--- a/lib/Prophet/Replica/prophet.pm
+++ b/lib/Prophet/Replica/prophet.pm
@@ -382,14 +382,15 @@ sub set_replica_uuid {
}
-before set_db_uuid => sub {
+sub set_db_uuid {
my $self = shift;
my $uuid = shift;
$self->_write_file(
path => 'database-uuid',
content => $uuid
);
-};
+ $self->SUPER::set_db_uuid($uuid);
+}
=head1 Internals of record handling
diff --git a/lib/Prophet/Replica/sqlite.pm b/lib/Prophet/Replica/sqlite.pm
index 78d3fd4..7793e24 100644
--- a/lib/Prophet/Replica/sqlite.pm
+++ b/lib/Prophet/Replica/sqlite.pm
@@ -327,10 +327,11 @@ sub set_replica_uuid {
}
-before set_db_uuid => sub {
+sub set_db_uuid {
my $self = shift;
my $uuid = shift;
$self->store_local_metadata( 'database-uuid', => $uuid);
+ $self->SUPER::set_db_uuid($uuid);
};
=head1 Internals of record handling
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list