[Bast-commits] r8225 - in DBIx-Class/0.08/branches/native_traits: .
lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/Replicated
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sat Jan 2 17:31:44 GMT 2010
Author: rafl
Date: 2010-01-02 17:31:43 +0000 (Sat, 02 Jan 2010)
New Revision: 8225
Modified:
DBIx-Class/0.08/branches/native_traits/Makefile.PL
DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated.pm
DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
Log:
Port replicated storage from MXAH to native traits.
Modified: DBIx-Class/0.08/branches/native_traits/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/native_traits/Makefile.PL 2010-01-02 17:30:12 UTC (rev 8224)
+++ DBIx-Class/0.08/branches/native_traits/Makefile.PL 2010-01-02 17:31:43 UTC (rev 8225)
@@ -48,8 +48,7 @@
requires 'Data::Dumper::Concise' => '1.000';
my %replication_requires = (
- 'Moose', => '0.87',
- 'MooseX::AttributeHelpers' => '0.21',
+ 'Moose', => '0.90',
'MooseX::Types', => '0.16',
'namespace::clean' => '0.11',
'Hash::Merge', => '0.11',
Modified: DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
===================================================================
--- DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm 2010-01-02 17:30:12 UTC (rev 8224)
+++ DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm 2010-01-02 17:31:43 UTC (rev 8225)
@@ -1,7 +1,6 @@
package DBIx::Class::Storage::DBI::Replicated::Pool;
use Moose;
-use MooseX::AttributeHelpers;
use DBIx::Class::Storage::DBI::Replicated::Replicant;
use List::Util 'sum';
use Scalar::Util 'reftype';
@@ -125,26 +124,31 @@
has 'replicants' => (
is=>'rw',
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
isa=>HashRef['Object'],
default=>sub {{}},
- provides => {
- 'set' => 'set_replicant',
- 'get' => 'get_replicant',
- 'empty' => 'has_replicants',
- 'count' => 'num_replicants',
- 'delete' => 'delete_replicant',
- 'values' => 'all_replicant_storages',
+ handles => {
+ 'set_replicant' => 'set',
+ 'get_replicant' => 'get',
+ 'has_replicants' => 'is_empty',
+ 'num_replicants' => 'count',
+ 'delete_replicant' => 'delete',
+ 'all_replicant_storages' => 'values',
},
);
+around has_replicants => sub {
+ my ($orig, $self) = @_;
+ return !$self->$orig;
+};
+
has next_unknown_replicant_id => (
is => 'rw',
- metaclass => 'Counter',
+ traits => ['Counter'],
isa => Int,
default => 1,
- provides => {
- inc => 'inc_unknown_replicant_id'
+ handles => {
+ 'inc_unknown_replicant_id' => 'inc',
},
);
Modified: DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated.pm
===================================================================
--- DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated.pm 2010-01-02 17:30:12 UTC (rev 8224)
+++ DBIx-Class/0.08/branches/native_traits/lib/DBIx/Class/Storage/DBI/Replicated.pm 2010-01-02 17:31:43 UTC (rev 8225)
@@ -7,8 +7,7 @@
## use, so we explicitly test for these.
my %replication_required = (
- 'Moose' => '0.87',
- 'MooseX::AttributeHelpers' => '0.21',
+ 'Moose' => '0.90',
'MooseX::Types' => '0.16',
'namespace::clean' => '0.11',
'Hash::Merge' => '0.11'
@@ -119,8 +118,7 @@
Replicated Storage has additional requirements not currently part of L<DBIx::Class>
- Moose => '0.87',
- MooseX::AttributeHelpers => '0.20',
+ Moose => '0.90',
MooseX::Types => '0.16',
namespace::clean => '0.11',
Hash::Merge => '0.11'
More information about the Bast-commits
mailing list