Base rbenv plugin on the rbenv in the path.

Rather than do our own searching, this gives the user full control of
the PATH variable and of the search order for rbenv.  It's also probably
faster, since we let zsh do the searching for us.
This commit is contained in:
Peter Jaros 2012-05-17 15:07:50 -04:00
commit 34bebc1ec5

View file

@ -1,9 +1,5 @@
FOUND_RBENV=0
for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
FOUND_RBENV=1
export RBENV_ROOT=$rbenvdir
export PATH=${rbenvdir}/bin:$PATH
if [[ $+commands[rbenv] -eq 1 ]] ; then
eval "$(rbenv init -)"
alias rubies="rbenv versions"
@ -33,11 +29,8 @@ for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
echo "$(current_ruby)"
fi
}
fi
done
unset rbenvdir
if [ $FOUND_RBENV -eq 0 ] ; then
else
alias rubies='ruby -v'
function gemsets() { echo 'not supported' }
function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" }