rvm/rvm

Suggestion: terse automatic Ruby switch warning

Aberta

#4.911 aberto em 15 de abr. de 2020

 (5 comentários) (0 reação) (0 responsável)Shell (976 forks)batch import
featuregood first issuehelp wanted

Métricas do repositório

Stars
 (4.405 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 5h) (3 fundiu PRs em 30d)

Description

It seems that the current behavior when rvm automatically switches Ruby versions is to do it silently if it's by .ruby-version or, if it's because of a Gemfile, display that three-line warning about how Heroku does it too and with instructions on how not to show that warning again.

I think .ruby-version switching the Ruby version silently is not great, because it requires that the user remembers that there is a .ruby-version in the directory, which version it is set to use, and that the switch is automatic. At least the first two things can easily be forgotten by someone who deals with many projects.

The Gemfile warning in my opinion goes the opposite way by being too verbose, while not providing the most useful information: which version of Ruby is now active. Sure, an rvm list is easy enough, but it is even easier not having to issue a command at all.

I think showing a message like RVM: switched to ruby-2.4.9 (Gemfile) or RVM: switched to ruby-2.7.1 (.ruby-version) or RVM: switched to ruby-2.7.0 (default) when leaving a directory containing a .ruby-version file or a Gemfile, perhaps also including the active gemset if pertinent, would be better. It keeps the user aware that the interpreter was switched, it informs the user which interpreter was switched to, and it tells the user why that happened, all in a single short line.

Instructions on how to disable the warning probably don't need to be displayed again after the first time, since one of the problems I see with the current Gemfile warning is how verbose it is.

Guia do colaborador