[Bast-commits] r8719 - in DBIx-Class/0.08/trunk/lib/DBIx/Class:
Optional Storage/DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Feb 16 10:09:58 GMT 2010
Author: caelum
Date: 2010-02-16 10:09:58 +0000 (Tue, 16 Feb 2010)
New Revision: 8719
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Optional/Dependencies.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated.pm
Log:
use OO interface of Hash::Merge for ::DBI::Replicated
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Optional/Dependencies.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Optional/Dependencies.pm 2010-02-15 18:45:05 UTC (rev 8718)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Optional/Dependencies.pm 2010-02-16 10:09:58 UTC (rev 8719)
@@ -33,7 +33,7 @@
req => {
%$moose_basic,
'namespace::clean' => '0.11',
- 'Hash::Merge' => '0.11',
+ 'Hash::Merge' => '0.12',
},
pod => {
title => 'Storage::Replicated',
@@ -151,7 +151,7 @@
rdbms_asa => {
req => {
- grep $_, @ENV{qw/DBICTEST_SYBASE_ASA_DSN DBICTEST_SYBASE_ASA_ODBC_DSN/}
+ (scalar grep $_, @ENV{qw/DBICTEST_SYBASE_ASA_DSN DBICTEST_SYBASE_ASA_ODBC_DSN/})
? (
'DateTime::Format::Strptime' => 0,
) : ()
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated.pm 2010-02-15 18:45:05 UTC (rev 8718)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated.pm 2010-02-16 10:09:58 UTC (rev 8719)
@@ -14,7 +14,7 @@
use DBIx::Class::Storage::DBI::Replicated::Types qw/BalancerClassNamePart DBICSchema DBICStorageDBI/;
use MooseX::Types::Moose qw/ClassName HashRef Object/;
use Scalar::Util 'reftype';
-use Hash::Merge 'merge';
+use Hash::Merge;
use List::Util qw/min max/;
use namespace::clean -except => 'meta';
@@ -384,10 +384,12 @@
my $wantarray = wantarray;
+ my $merge = Hash::Merge->new;
+
my %opts;
for my $arg (@$info) {
next unless (reftype($arg)||'') eq 'HASH';
- %opts = %{ merge($arg, \%opts) };
+ %opts = %{ $merge->merge($arg, \%opts) };
}
delete $opts{dsn};
@@ -396,7 +398,7 @@
if $opts{pool_type};
$self->pool_args(
- merge((delete $opts{pool_args} || {}), $self->pool_args)
+ $merge->merge((delete $opts{pool_args} || {}), $self->pool_args)
);
$self->pool($self->_build_pool)
@@ -408,7 +410,7 @@
if $opts{balancer_type};
$self->balancer_args(
- merge((delete $opts{balancer_args} || {}), $self->balancer_args)
+ $merge->merge((delete $opts{balancer_args} || {}), $self->balancer_args)
);
$self->balancer($self->_build_balancer)
@@ -553,7 +555,8 @@
$self->throw_exception('too many hashrefs in connect_info')
if @hashes > 2;
- my %opts = %{ merge(reverse @hashes) };
+ my $merge = Hash::Merge->new;
+ my %opts = %{ $merge->merge(reverse @hashes) };
# delete them
splice @$r, $i+1, ($#{$r} - $i), ();
@@ -566,7 +569,7 @@
delete $master_opts{dbh_maker};
# merge with master
- %opts = %{ merge(\%opts, \%master_opts) };
+ %opts = %{ $merge->merge(\%opts, \%master_opts) };
# update
$r->[$i] = \%opts;
More information about the Bast-commits
mailing list