-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding convenience method to parse Redis version #502
Conversation
Thanks! I don't have a Redis installation to test, so I was wondering if all lines of the info string are of the form "key: value" and if it would be safer to iterate over all lines to find the one with "redis_version" instead of assuming the second line. Or does the spec define that the version must be there anyway? |
Np! Referring to the documentation of Redis (http://redis.io/commands/info) it has to be on line 2 in the output of INFO. I also thought about a solution to iterate over all lines but I think this would be some kind of overkill for the version retrievement. Another improvement would be to write a method which returns a specific attribute of the INFO - this would iterate over all lines anyway. |
OK according to the docs, it seems like for a fully robust implementation it would be necessary to also parse the section headers. I think a good future idea would be to change the Until such a more general facility is there, though, the fixed line method should be fine. The only thing I'd change is to rename |
@s-ludwig is it even possible to name a method "version" in D ? I just tried it does not built on win32 dmd... |
and a "Version" method would be violating the dlang style guide. I would suggest calling it |
Of course you are right :) The official convention would be to use |
i vote in favor of |
Considering the original name, I change my vote to |
Okay, looks good to go! Thanks again! (that Travic CI error can safely be ignored) |
Adding convenience method to parse Redis version
No description provided.