mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-10-14 15:49:09 +00:00
ruby: Cleanup and optimize 'ruby' module
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
This commit is contained in:
committed by
Indrajit Raychaudhuri
parent
afe59b293b
commit
37443368c1
@@ -6,11 +6,22 @@ aliases.
|
||||
## Local Gem Installation
|
||||
|
||||
When a Ruby version manager is not detected, local gems are installed in
|
||||
_`~/.gems`_; otherwise, they are installed according to the manager.
|
||||
_`~/.gem`_; otherwise, they are installed according to the manager.
|
||||
|
||||
## rbenv
|
||||
|
||||
An alternative RVM is to use [_rbenv_][2], which allows for switching between
|
||||
multiple, isolated Ruby installations in the home directory.
|
||||
|
||||
While it is not as feature rich as RVM, it is not loaded into the shell and is
|
||||
not known to cause conflicts with shell scripts.
|
||||
|
||||
This will be loaded automatically if _rbenv_ is installed to `$RBENV_ROOT`,
|
||||
_`~/.rbenv`_, or if the `rbenv` command is on the path.
|
||||
|
||||
## rvm
|
||||
|
||||
An alternative to the above is to use [The Ruby Version Manager (_rvm_)][2],
|
||||
An alternative to the above is to use [The Ruby Version Manager (_rvm_)][3],
|
||||
which allows for managing multiple, isolated Ruby installations and gem sets in
|
||||
the home directory.
|
||||
|
||||
@@ -20,17 +31,6 @@ may conflict with shell scripts.
|
||||
Load this module as late as possible when using RVM since RVM will complain if
|
||||
it is not first in `$PATH`.
|
||||
|
||||
## rbenv
|
||||
|
||||
An alternative RVM is to use [_rbenv_][3], which allows for switching between
|
||||
multiple, isolated Ruby installations in the home directory.
|
||||
|
||||
While it is not as feature rich as RVM, it is not loaded into the shell and is
|
||||
not known to cause conflicts with shell scripts.
|
||||
|
||||
This will be loaded automatically if _rbenv_ is installed to `$RBENV_ROOT`,
|
||||
_`~/.rbenv`_, or if the `rbenv` command is on the path.
|
||||
|
||||
## chruby
|
||||
|
||||
Yet another alternative is [_chruby_][4], which is simpler than both _rvm_ and
|
||||
@@ -99,8 +99,8 @@ _The authors of this module should be contacted via the [issue tracker][6]._
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: https://www.ruby-lang.org
|
||||
[2]: https://rvm.io
|
||||
[3]: https://github.com/sstephenson/rbenv
|
||||
[2]: https://github.com/rbenv/rbenv
|
||||
[3]: https://rvm.io
|
||||
[4]: https://github.com/postmodern/chruby
|
||||
[5]: https://gembundler.com
|
||||
[6]: https://github.com/sorin-ionescu/prezto/issues
|
||||
|
Reference in New Issue
Block a user