chruby.el
chruby.el copied to clipboard
Approximate/fuzzy ruby versions may mismatch
The original chruby command allows specifying "fuzzy" ruby versions without the patch number, e.g. 2.4 which will load the highest matching available version from the 2.4 series.
Unfortunately, chruby.el does not understand this, and can actually mismatch if there's another version of ruby available which contains the "fuzzy" substring. Concretely, if you have 2.2.4 and 2.4.1 installed, calling chruby-use-corresponding when .ruby-version contains 2.4 will activate 2.2.4, not 2.4.1.
I'm a totally elisp newbie, but I think the fix will be on this line: https://github.com/plexus/chruby.el/blob/3eddd2f5fc2ac979b496394c74e4aee436b64a28/chruby.el#L82
Hi @lazyatom, thanks for the suggestion. This seems like a useful addition. I'd be happy to review a pull request if someone feels like tackling this.