diff options
| author | Robin Edwards <robin.ge@gmail.com> | 2013-02-18 13:06:05 +0000 |
|---|---|---|
| committer | Robin Edwards <robin.ge@gmail.com> | 2013-02-18 13:06:05 +0000 |
| commit | 934be43b4b662bc15c04544f445a030ff716336e (patch) | |
| tree | 69440a3fa5e988c70d9abbda0907c4c79fff56c3 /lib/Net/Riak/Role/REST.pm | |
| parent | Merge pull request #20 from Mainframe2008/06063f56bb11f06593b114316f34f338fe5... (diff) | |
| download | net-riak-934be43b4b662bc15c04544f445a030ff716336e.tar.gz | |
Clean up pull request
Diffstat (limited to 'lib/Net/Riak/Role/REST.pm')
| -rw-r--r-- | lib/Net/Riak/Role/REST.pm | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/lib/Net/Riak/Role/REST.pm b/lib/Net/Riak/Role/REST.pm index 92ea3ae..73b3c2a 100644 --- a/lib/Net/Riak/Role/REST.pm +++ b/lib/Net/Riak/Role/REST.pm @@ -1,7 +1,4 @@ package Net::Riak::Role::REST; -{ - $Net::Riak::Role::REST::VERSION = '0.1600'; -} # ABSTRACT: role for REST operations @@ -11,9 +8,8 @@ use Moose::Role; use MooseX::Types::Moose 'Bool'; use Net::Riak::Types qw/HTTPResponse HTTPRequest/; use Data::Dump 'pp'; -use Data::Dumper; -with qw/Net::Riak::Role::REST::Bucket - Net::Riak::Role::REST::Object +with qw/Net::Riak::Role::REST::Bucket + Net::Riak::Role::REST::Object Net::Riak::Role::REST::Link Net::Riak::Role::REST::MapReduce Net::Riak::Role::REST::Search @@ -41,8 +37,8 @@ has disable_return_body => ( has ssl => ( is => 'rw', - isa => Bool, - default => 0 + isa => Bool, + default => 0 ); sub _build_path { @@ -72,9 +68,9 @@ sub send_request { my ($self, $req) = @_; $self->http_request($req); - + my $r = $self->useragent->request($req); - + $self->http_response($r); if ($ENV{RIAK_VERBOSE}) { @@ -95,7 +91,7 @@ sub all_buckets { my $self = shift; my $request = $self->new_request('GET', [$self->prefix], {buckets => 'true'}); my $response = $self->send_request($request); - die "Failed to fetch buckets.. are you running riak 0.14+?" + die "Failed to fetch buckets.. are you running riak 0.14+?" unless $response->is_success; my $resp = JSON::decode_json($response->content); return ref ($resp->{buckets}) eq 'ARRAY' ? @{$resp->{buckets}} : (); @@ -111,28 +107,3 @@ sub stats { } 1; - -__END__ -=pod - -=head1 NAME - -Net::Riak::Role::REST - role for REST operations - -=head1 VERSION - -version 0.1600 - -=head1 AUTHOR - -franck cuny <franck@lumberjaph.net>, robin edwards <robin.ge@gmail.com> - -=head1 COPYRIGHT AND LICENSE - -This software is copyright (c) 2011 by linkfluence. - -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - -=cut - |
