Browse files

Fixing bucket creation

  • Loading branch information...
1 parent c2ea4c5 commit f4b80e5944b50a550c0d14d4508521c4e0afe7d5 @kthakore committed Dec 10, 2011
Showing with 8 additions and 7 deletions.
  1. +4 −3 lib/Roose.pm
  2. +0 −3 lib/Roose/Engine/Base.pm
  3. +3 −0 t/basic.t
  4. +1 −1 t/lib/RooseT.pm
View
7 lib/Roose.pm
@@ -8,12 +8,13 @@ use Net::Riak;
use MooseX::Singleton;
use Moose::Util::TypeConstraints;
use Carp;
+use Data::Dumper;
has '_bucket' => (is => 'rw', isa => 'HashRef[Net::Riak::Bucket]');
has '_client' => (
is => 'rw',
- isa => 'Net::Riak::Client'
+ isa => 'Net::Riak'
);
has '_args' => ( is => 'rw',
@@ -37,8 +38,8 @@ sub connect {
my %params = @_ || %{ $self->_args};
my $key = delete( $params{'-class'} ) || 'default';
$self->_client( Net::Riak->new(%params) ) unless ref $self->_client;
-
- $self->_bucket( { $key => $self->_client->bucket( $params{key} ) } );
+ $self->_bucket( { $key => $self->_client->bucket( $params{bucket_name} ) } );
+ return $self->_bucket->{$key};
}
sub disconnect {
View
3 lib/Roose/Engine/Base.pm
@@ -25,9 +25,6 @@ sub find_one {}
sub query {}
sub bucket {
my ($self, $new_buck) = @_;
- my $connection = $self->connection;
-
- warn Dumper $connection;
}
sub expand {}
View
3 t/basic.t
@@ -26,6 +26,9 @@ package main;
my $homer = Person->new( name => 'Homer Simpson' );
my $id = $homer->save;
+ diag 'Bucket of homer:'. $homer->bucket;
+ diag $bucket;
+
}
done_testing();
View
2 t/lib/RooseT.pm
@@ -7,7 +7,7 @@ sub bucket { return $bucket }
$ENV{ROOSE_SKIP} and plan skip_all => 'ROOSE_SKIP is set. Test skipped'.
eval {
- $bucket = Roose->bucket( $ENV{ROOSEDB} ? split( /,/, $ENV{ROOSEDB} ) : '_mongoose_testing' )
+ $bucket = Roose->bucket( $ENV{ROOSEDB} ? split( /,/, $ENV{ROOSEDB} ) : '_roose_testing' )
};
if( $@ ) {
$ENV{ROOSE_SKIP} = 1;

0 comments on commit f4b80e5

Please sign in to comment.