info
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 23 Mar 2009 11:44:25 +0000 (11:44 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 23 Mar 2009 11:44:25 +0000 (11:44 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@51 447b33ff-793d-4489-8442-9bea7d161be5

lib/Redis.pm
t/01-Redis.t

index 7d2e692..29c2746 100644 (file)
@@ -595,6 +595,25 @@ sub shutdown {
        $self->_sock_send( 'SHUTDOWN' );
 }
 
        $self->_sock_send( 'SHUTDOWN' );
 }
 
+=head1 Remote server control commands
+
+=head2 info
+
+  my $info_hash = $r->info;
+
+=cut
+
+sub info {
+       my $self = shift;
+       my $info = $self->_sock_result_bulk( 'INFO' );
+       my $hash;
+       foreach my $l ( split(/\r\n/, $info ) ) {
+               my ($n,$v) = split(/:/, $l, 2);
+               $hash->{$n} = $v;
+       }
+       return $hash;
+}
+
 =head1 AUTHOR
 
 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
 =head1 AUTHOR
 
 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
index 7a990ce..211f743 100755 (executable)
@@ -4,6 +4,7 @@ use warnings;
 use strict;
 
 use Test::More tests => 106;
 use strict;
 
 use Test::More tests => 106;
+use Data::Dump qw/dump/;
 
 use lib 'lib';
 
 
 use lib 'lib';
 
@@ -176,7 +177,13 @@ diag "Persistence control commands";
 ok( $o->save, 'save' );
 ok( $o->bgsave, 'bgsave' );
 ok( $o->lastsave, 'lastsave' );
 ok( $o->save, 'save' );
 ok( $o->bgsave, 'bgsave' );
 ok( $o->lastsave, 'lastsave' );
-ok( $o->shutdown, 'shutdown' );
+#ok( $o->shutdown, 'shutdown' );
+diag "shutdown not tested";
+
+diag "Remote server control commands";
+
+ok( my $info = $o->info, 'info' );
+diag dump( $info );
 
 diag "Connection handling";
 
 
 diag "Connection handling";