ryanlecompte / redis_failover

redis_failover is a ZooKeeper-based automatic master/slave failover solution for Ruby.
http://github.com/ryanlecompte/redis_failover
MIT License
539 stars 65 forks source link

Always include redis-db in client description #53

Closed jzaleski closed 11 years ago

jzaleski commented 11 years ago

We operate in an environment with multiple databases per redis cluster. While developing and in the production console it is useful to see what database we are currently connected to.

With this patch, calls to "inspect" on "RedisFailover::Client" instances will include the database in the description. I was on the fence about omitting the db when it was nil/zero but decided to keep it in (I went with a hybrid of the "redis-rb" and "redis-cli" output).

I also created a new test in the "client_spec" for this change.

ryanlecompte commented 11 years ago

Very useful addition. Thanks!