Partial matches produce very surprising results
I have many rubies, including 2.0.0 and 2.2.0-dev. Unexpectedly (to me), chruby 2.0 chooses 2.2.0-dev instead of 2.0.0. Is this expected or documented?
$ chruby
1.8.7
1.8.7-p358
1.9.3
1.9.3-p545
2.0.0
2.0.0-p481
2.1.0
2.1.1
2.1.2
* 2.2.0-dev
jruby-1.7.9
$ chruby 2.0
$ ruby -v
ruby 2.2.0dev (2014-09-12 trunk 47552) [x86_64-darwin13]
That is definitely not right. It appears the fuzzy matching is matching the 2.2.0 part.
@indirect checkout the sequential_version_matching branch.
👍
On Oct 23, 2014, at 10:46 PM, Postmodern [email protected] wrote:
@indirect checkout the sequential_version_matching branch.
— Reply to this email directly or view it on GitHub.
I'm running into this as well:
➜ chruby 2.0 && ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin12.0]
➜ chruby 2.0.0 && ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12.5.0]
Hit this now in #500, with Ruby 3.0.6 and 3.3.0 installed. Similar to the OP, chruby 3.0 is picking 3.3.0 over 3.0.6.
@postmodern Your branch there in https://github.com/postmodern/chruby/issues/291#issuecomment-60347106 seems like a great fix. Any reason it didn't become a pull request?