TaKO8Ki / frum

A little bit fast and modern Ruby version manager written in Rust
MIT License
628 stars 15 forks source link

Add automatic version detection/switching #84

Closed bkuhlmann closed 3 years ago

bkuhlmann commented 3 years ago

Overview

Would it be possible to support automatic version switching much like chruby's auto-switching?

Screenshots/Screencasts

The following captures the problem of having to manually switch Ruby versions when switching between projects:

https://user-images.githubusercontent.com/50245/126048754-17938534-9ac8-4e32-ae65-54ef068568aa.mp4

Steps to Recreate

Run the following:

frum --frum-dir "$HOME/.cache/frum" install 3.0.0
frum --frum-dir "$HOME/.cache/frum" install 3.0.2
printf "%s\n" "3.0.2" > $HOME/.ruby-version
mkdir zero
printf "%s\n" "3.0.0" > "zero/.ruby-version"
cd zero
cd ..
cd zero

Notice that Frum never detects the correct version (global versus local).

Desired Behavior

As shown in the screencast and steps above, Frum doesn't distinguish between the global, system-wide Ruby version of 3.0.2 versus the local project version of 3.0.0. You have to manually set the Ruby version you desire each time you switch a directory.

Environment

TaKO8Ki commented 3 years ago

@bkuhlmann Thank you for opening the issue! You can set frum-dir as an environment variable like the following capture. And I think this way solve the problem. I'm sorry I forgot to mention this feature in README. I'm going to add a description to README.

https://user-images.githubusercontent.com/41065217/126057215-002fc8ee-5989-4a84-ac2e-f358891c2b81.mov

bkuhlmann commented 3 years ago

:bow: Takayuki. Ah, this is excellent to learn! Yes, adding this information to the README would be most welcome. 😄 By the way, thanks for the work on this project. Looking forward to making more use of Frum in all of my projects.

TaKO8Ki commented 3 years ago

@bkuhlmann I'm glad to hear that :) I'll keep on making frum better. I've added this information to README in https://github.com/TaKO8Ki/frum/pull/86.

bkuhlmann commented 3 years ago

:information_source: I'm enjoying Frum and switched all systems to using it then decided to update my article on Ruby Version Managers to default to Frum instead of chruby. 😄