4 ms·
Great stuff! Also, for the extremely anal, uri-redis is aware of the database number: require 'uri-redis' conf = URI.parse 'redis://localhost:6379/1'
by delano 16y ago
Great stuff!
Also, for the extremely anal, uri-redis is aware of the database number:
require 'uri-redis'
conf = URI.parse 'redis://localhost:6379/1'
conf.host # => localhost
conf.port # => 6379
conf.db # => 1
- soveran 16y agoRedis also manages URLs directly: Redis.connect('redis://localhost:6379/1') works as expected.
- waratuman 16y agoI had no idea! And I've been parsing them myself all this time.
- malomalo 16y agoDoes that work with passwords?
- soveran 16y agoYes, works as expected.
- darkhelmetlive 16y agoThat should be Redis.connect(:url => 'redis://localhost:6379/1')