[Bps-public-commit] r11384 - in SVN-PropDB: . doc t

jesse at bestpractical.com jesse at bestpractical.com
Wed Apr 2 05:06:30 EDT 2008


Author: jesse
Date: Wed Apr  2 05:06:18 2008
New Revision: 11384

Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/doc/todo
   SVN-PropDB/lib/Prophet/Collection.pm
   SVN-PropDB/t/create.t

Log:
 r28973 at 31b:  jesse | 2008-04-01 18:41:21 -1000
  * now we can use collection as an array


Modified: SVN-PropDB/doc/todo
==============================================================================
--- SVN-PropDB/doc/todo	(original)
+++ SVN-PropDB/doc/todo	Wed Apr  2 05:06:18 2008
@@ -3,8 +3,6 @@
 
 - test byzantine sync behaviour
 
-- prompt for resolution of conflicts
-- handle file_conflict
 - handle conflicting conflict resolutions
 
 
@@ -50,3 +48,6 @@
 - record conflict resolution data 
 - reuse conflict resolution data on repeated resolve
 - ability to 'pull' conflicting updates from a remote db
+- prompt for resolution of conflicts
+- handle file_conflict
+

Modified: SVN-PropDB/lib/Prophet/Collection.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Collection.pm	(original)
+++ SVN-PropDB/lib/Prophet/Collection.pm	Wed Apr  2 05:06:18 2008
@@ -1,9 +1,12 @@
 use warnings;
 use strict;
-
 package Prophet::Collection;
 use Params::Validate;
 use base qw/Class::Accessor/;
+
+use overload '@{}' => \&as_array_ref, fallback => 1;
+
+
 __PACKAGE__->mk_accessors(qw'handle type');
 use Prophet::Record;
 

Modified: SVN-PropDB/t/create.t
==============================================================================
--- SVN-PropDB/t/create.t	(original)
+++ SVN-PropDB/t/create.t	Wed Apr  2 05:06:18 2008
@@ -31,7 +31,7 @@
 my $people = Prophet::Collection->new( handle => $cxn, type => 'Person');
 $people->matching(sub { (shift->prop( 'species')||'') ne 'cat'});
 is($#{$people->as_array_ref}, 1);
-my @people= @{$people->as_array_ref};
+my @people= @$people;
 is_deeply([ sort map {$_->prop('name')} @people], [qw(Jesse Kaia)]);
 
 my $cats = Prophet::Collection->new( handle => $cxn, type => 'Person');



More information about the Bps-public-commit mailing list