From 691e20852799b8fd56756cb20edf35781ee6c07c Mon Sep 17 00:00:00 2001 From: Zeh Rizzatti Date: Thu, 20 Dec 2012 20:35:54 -0300 Subject: [PATCH] Add rbenv rehash zstyle option --- modules/ruby/init.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index b287cbb2..cbd4cfa2 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -5,6 +5,14 @@ # Authors: Sorin Ionescu # +local _rbenv_rehash +zstyle -s ':prezto:module:ruby:rbenv' rehash '_rbenv_rehash' || _rbenv_rehash='yes' +if [[ "$_rbenv_rehash" == (N|n)(O|o) ]]; then + $_rbenv_rehash='--no-rehash' +else + $_rbenv_rehash='' +fi + # Load RVM into the shell session. if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then # Unset AUTO_NAME_DIRS since auto adding variable-stored paths to ~ list @@ -17,11 +25,11 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then # Load manually installed rbenv into the shell session. elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then path=("$HOME/.rbenv/bin" $path) - eval "$(rbenv init - --no-rehash zsh)" + eval "$(rbenv init - $_rbenv_rehash zsh)" # Load package manager installed rbenv into the shell session. elif (( $+commands[rbenv] )); then - eval "$(rbenv init - --no-rehash zsh)" + eval "$(rbenv init - $_rbenv_rehash zsh)" # Install local gems according to operating system conventions. else