Skip to content
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

Add a note about full/trimmed ruby version in legacy file #101

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

azhi
Copy link
Contributor

@azhi azhi commented Feb 20, 2019

Related to asdf-vm/asdf#352.
This PR only documents current behaviour.

@Stratus3D
Copy link
Member

Do any version managers support the .ruby-version without a complete version? It doesn't look like rbenv supports it.

@azhi
Copy link
Contributor Author

azhi commented Feb 22, 2019

Yep, rvm does. It is mentioned in install docs https://rvm.io/rvm/basics#installing-rubies, under NOTE:

If you use just the Major.Minor version numbers, RVM checks for, and uses, what is the most current
patchlevel in its $rvm_path/config/db for that Major.Minor version.

@Stratus3D
Copy link
Member

Stratus3D commented Feb 22, 2019

I'm looking at:

https://rvm.io/workflow/projects
https://gist.github.com/fnichol/1912050

And I do not see anything about .ruby-version supporting versions that only specify major and minor version numbers.

@azhi
Copy link
Contributor Author

azhi commented Feb 25, 2019

It isn't explicitly mentioned in the docs, but gist you provided had some discussion on the matter.

https://gist.github.com/fnichol/1912050#gistcomment-628554 (this and following 5-6 comments), https://gist.github.com/fnichol/1912050#gistcomment-804032, https://gist.github.com/fnichol/1912050#gistcomment-1315733.

TL;DR is chruby supports fuzzy matching - any substring in .ruby-version will match rubies containt it, rvm supports specifying major.minor - latest installed major.minor.patch will be picked, while rbenv is strongly against the idea and supports only full version.

A little demonstration to confirm rvm supports this:

$ mkdir -p /tmp/ruby-version-test
$ cd /tmp/ruby-version-test
$ rvm current
ruby-2.5.0
$ echo "2.6" > .ruby-version
$ cd ./
$ rvm current
ruby-2.6.1

I think note in this PR would help rvm and chruby users when migrating.

@Stratus3D
Copy link
Member

My point is I'd rather not document this in the readme since it's not something that is explicit in the .ruby-version document. That document is the most canonical document on the .ruby-version format, even if it is a bit vague. I'd rather only document things it specifies that we do not support. Fuzzy matching isn't something we support, and I'm not sure we will ever support fuzzy matching in the .ruby-version file, so I don't want users to get the wrong impression.

It may be helpful to let people coming from rvm know that they will they may have to change the format of their version strings. If you want to reword it so it's clear that the note only pertains to users coming from rvm I think that would be better.

@azhi
Copy link
Contributor Author

azhi commented Feb 26, 2019

Fair enough, changed the wording to mention migrating from rvm/chruby.
Does it look better?

@Stratus3D Stratus3D merged commit 144e915 into asdf-vm:master Feb 28, 2019
@Stratus3D
Copy link
Member

Thanks! Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants