[Bps-public-commit] r15409 - in Prophet/trunk/lib/Prophet: Replica
jesse at bestpractical.com
jesse at bestpractical.com
Sat Aug 23 22:28:20 EDT 2008
Author: jesse
Date: Sat Aug 23 22:28:19 2008
New Revision: 15409
Modified:
Prophet/trunk/lib/Prophet/Replica.pm
Prophet/trunk/lib/Prophet/Replica/prophet.pm
Log:
* Not quite as slick as I'd hoped. revert
Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica.pm Sat Aug 23 22:28:19 2008
@@ -1,6 +1,7 @@
package Prophet::Replica;
use Moose;
use Params::Validate qw(:all);
+use Path::Class;
use constant state_db_uuid => 'state';
@@ -560,7 +561,7 @@
my %args = validate( @_, { path => 1, } );
require Prophet::ReplicaExporter;
- my $exporter = Prophet::ReplicaExporter->new({target_path => $args{'path'}, source_replica => $self});
+ my $exporter = Prophet::ReplicaExporter->new({target_path => dir($args{'path'}), source_replica => $self});
$exporter->export();
}
Modified: Prophet/trunk/lib/Prophet/Replica/prophet.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/prophet.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica/prophet.pm Sat Aug 23 22:28:19 2008
@@ -4,7 +4,10 @@
use Params::Validate qw(:all);
use LWP::Simple ();
use Path::Class;
-use JSON qw(from_json to_json);
+use Digest::SHA1 qw(sha1_hex);
+use File::Find::Rule;
+use Data::UUID;
+use JSON;
has '+db_uuid' => (
@@ -600,8 +603,7 @@
} elsif ( $args{'data'} ) {
$content = to_json($args{'data'}, { canonical => 1, pretty=> 0, utf8=>1} );
}
- require Digest::SHA1;
- my $fingerprint = Digest::SHA1::sha1_hex($content);
+ my $fingerprint = sha1_hex($content);
my $content_filename = file(
$args{'cas_dir'},
$self->_hashed_dir_name($fingerprint)
@@ -870,7 +872,6 @@
my $self = shift;
my %args = validate( @_ => { type => 1 } );
- require File::Find::Rule;
#return just the filenames, which, File::Find::Rule doesn't seem capable of
my @record_uuids = map { my @path = split( qr'/', $_ ); pop @path }
File::Find::Rule->file->maxdepth(3)->in(
@@ -886,7 +887,6 @@
sub list_types {
my $self = shift;
- require File::Find::Rule;
return [ map { my @path = split( qr'/', $_ ); pop @path }
File::Find::Rule->mindepth(1)->maxdepth(1)
->in( dir( $self->fs_root, $self->record_dir ) ) ];
More information about the Bps-public-commit
mailing list