Changes:
- Honor `$RBENV_ROOT` or `RVM_DIR` if set but, no need to set it
explicitly if not set. Instead, let the respective initialization
scripts take care of that.
- Reverse `rbenv` vs `rvm` selection order, preferring `rbenv` instead.
- Check for availability of `rbenv` or `rvm` function instead of command
to validate requirements. In a properly configured and initialized
shell, `rbenv` or `rvm` will be available as function.
- Adhere to more idiomatic Zsh operation and minimize redundant syntaxes.
For additional rationale, see: https://github.com/rbenv/rbenv/wiki/Why-rbenv%3F
Set PATH variables to allow gems such as Bundler to be found and for the
`ruby-info` function to properly work.
A default Ruby must be set in ~/.ruby-version; for more information, see
https://github.com/postmodern/chruby#default-ruby.
Signed-off-by: Sorin Ionescu <sorin.ionescu@gmail.com>
Defining it breaks gems for all users who neither use RVM nor rbenv,
but have a different default Ruby version nonetheless.
Signed-off-by: Sorin Ionescu <sorin.ionescu@gmail.com>