-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
~/.ruby-version sets default ruby only for home directory tree #85
Conversation
Oh, and thank you very much for the great project! chruby seems to make all that you need and nothing extra for ruby version management. The biggest problem so far is that I keep typing |
Ah good point. This was some-what intentional to reuse the sub-directory behaviour for the "default" Ruby. We can change it use |
OK, I can take a look later. |
Going to try to include this behaviour in 0.3.3. |
I already started to hack something up a while ago. I pushed it now to my default-ruby-version branch. Feel free to comment, use, cherry-pick, ignore, etc. I can also change this issue to pull request based on that branch if you want. Tests are now quite dependent on the system configuration. I'll open another issue with my findings. |
@postmodern do you have any comments on this? I'm actually not using the auto-switcher myself at the moment so this is not an issue for me personally. |
I need to get around to merge your code this weekend. |
Extract probing of one directory level to own function, so we can later use it to set default ruby from ~/.ruby-version.
Set RUBY_VERSION_FILE also if .ruby-version is invalid, so that we don't try to use it again and again. Otherwise error messages are printed after each command. The downside is that the .ruby-version won't be automatically read after fixed. But we do not read modified valid .ruby-files, either.
I like this idea. I'm considering rewriting |
I like this idea. I just got bitten by this exact issue and was thinking of making a pull request until I noticed this issue. I think it's fair to assume that it fallback to Any update on this yet? |
This would be great. I'd hate to have to put a |
I would love this patch or something like it to make it in. I often forget to Is there anything I can do to make this patch or one like it make it into chruby? |
Here's a stab at supporting ~/.ruby-version without changing the function structure, just to see what that might look like: havenwood@47c6b6c |
@havenwood That patch works well on my system with ZSH. |
Support for a |
The "Default Ruby" section in the Readme indicates that ~/.ruby-version would set the default ruby the same way as calling
chruby
. Actually it only sets it for the home directory and its subdirectories.I'm not sure if this is a problem for anyone, but maybe the wording in the readme should be tweaked a bit? If a true default value is wanted then
chruby_auto
should try to find and use ~/.ruby-version as a fallback before resetting to system ruby.