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

jesse at bestpractical.com jesse at bestpractical.com
Sat Aug 23 22:21:04 EDT 2008


Author: jesse
Date: Sat Aug 23 22:21:00 2008
New Revision: 15408

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

Log:
* removing some unused deps

Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica.pm	Sat Aug 23 22:21:00 2008
@@ -1,8 +1,6 @@
 package Prophet::Replica;
 use Moose;
 use Params::Validate qw(:all);
-use Data::UUID;
-use Path::Class;
 
 use constant state_db_uuid => 'state';
 
@@ -562,7 +560,7 @@
     my %args = validate( @_, { path => 1, } );
     require Prophet::ReplicaExporter;
 
-    my $exporter = Prophet::ReplicaExporter->new({target_path => dir($args{'path'}), source_replica => $self});
+    my $exporter = Prophet::ReplicaExporter->new({target_path => $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:21:00 2008
@@ -4,9 +4,7 @@
 use Params::Validate qw(:all);
 use LWP::Simple ();
 use Path::Class;
-use Digest::SHA1 qw(sha1_hex);
-use File::Find::Rule;
-use JSON;
+use JSON qw(from_json to_json);
 
 
 has '+db_uuid' => (
@@ -602,7 +600,8 @@
     } elsif ( $args{'data'} ) {
         $content = to_json($args{'data'}, { canonical => 1, pretty=> 0, utf8=>1}  );
     }
-    my $fingerprint = sha1_hex($content);
+    require Digest::SHA1;
+    my $fingerprint = Digest::SHA1::sha1_hex($content);
     my $content_filename = file(
         $args{'cas_dir'},
             $self->_hashed_dir_name($fingerprint)
@@ -871,6 +870,7 @@
     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,6 +886,7 @@
 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