amakawa / redic

Lightweight Redis Client
MIT License
120 stars 14 forks source link

Allow a URI instead of a String as configuration parameter #10

Closed niko closed 4 years ago

niko commented 9 years ago

https://github.com/amakawa/redic/blob/master/lib/redic/client.rb#L21 should check if url is a URI and only try to parse it otherwise.

Right now I'm contructing the URI using URI::Generic.build out of the configuration parameters (as they happen to be a Hash with host, port, db values and I can't change that all over the system). I find it strange that I have to call #to_s on the URI only to have it parsed again.

cyx commented 9 years ago

Hi Niko,

That is strange. The main usecase and motivation for doing a URI stems from 12factor.net.

@soveran thoughts?

On Wed, Jul 22, 2015 at 12:27 AM, Niko Dittmann notifications@github.com wrote:

https://github.com/amakawa/redic/blob/master/lib/redic/client.rb#L21 should check if url is a URI and only try to parse it otherwise.

Right now I'm contructing the URI using URI::Generic.build out of the configuration parameters (as they happen to be a Hash with host, port, db values and I can't change that all over the system). I find it strange that I have to call #to_s on the URI only to have it parsed again.

— Reply to this email directly or view it on GitHub https://github.com/amakawa/redic/issues/10.

soveran commented 4 years ago

Closing this of inactivity.