[Bps-public-commit] r13807 - in sd/trunk/lib/App/SD/Replica: Hiveminder

jesse at bestpractical.com jesse at bestpractical.com
Fri Jul 4 09:50:50 EDT 2008


Author: jesse
Date: Fri Jul  4 09:50:47 2008
New Revision: 13807

Modified:
   sd/trunk/lib/App/SD/Replica/Hiveminder.pm
   sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm

Log:
* more sd moose cleanup

Modified: sd/trunk/lib/App/SD/Replica/Hiveminder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/Hiveminder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/Hiveminder.pm	Fri Jul  4 09:50:47 2008
@@ -1,14 +1,12 @@
-use warnings;
-use strict;
-
 package App::SD::Replica::Hiveminder;
 use Moose;
-extends qw/Prophet::ForeignReplica/;
+extends 'Prophet::ForeignReplica';
 use Params::Validate qw(:all);
 use UNIVERSAL::require;
 use URI;
 use Memoize;
 use Prophet::ChangeSet;
+use File::Temp 'tempdir';
 
 has hm => ( isa => 'Str', is => 'rw');
 has hm_url => ( isa => 'Str', is => 'rw');
@@ -25,13 +23,11 @@
 
 =cut
 
-use File::Temp 'tempdir';
 
 sub setup {
     my $self = shift;
 
     require Net::Jifty;
-    require App::SD::Replica::Hiveminder::PullEncoder;
     my ($server) = $self->{url} =~ m/^(.*?)$/
         or die "Can't parse hiveminder server spec";
     my $uri = URI->new($server);
@@ -81,6 +77,7 @@
 
     my $first_rev = ( $args{'after'} + 1 ) || 1;
 
+    require App::SD::Replica::Hiveminder::PullEncoder;
     my $recoder = App::SD::Replica::Hiveminder::PullEncoder->new( { sync_source => $self } );
     for my $task ( @{ $self->find_matching_tasks } ) {
         $args{callback}->($_)

Modified: sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm	Fri Jul  4 09:50:47 2008
@@ -1,14 +1,14 @@
-use warnings;
-use strict;
-
 package App::SD::Replica::Hiveminder::PullEncoder;
-use base qw/Class::Accessor/;
+use Moose;
 use Params::Validate qw(:all);
 use UNIVERSAL::require;
 
 use Memoize;
 
-__PACKAGE__->mk_accessors(qw/sync_source/);
+has sync_source => (
+    isa => 'App::SD::Replica::Hiveminder',
+    is => 'rw',
+);
 
 our $DEBUG = $Prophet::Handle::DEBUG;
 



More information about the Bps-public-commit mailing list