From 7849948ead481897fd21e458e43c203b4893b8cd Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 28 Dec 2011 16:33:44 -0500 Subject: [PATCH] Cleaned up minor cruft in the Ruby plugin. Use path helpers where appropriate. Removed an unnecessary if statement. --- plugins/ruby/init.zsh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/plugins/ruby/init.zsh b/plugins/ruby/init.zsh index bca092c..bf7f469 100644 --- a/plugins/ruby/init.zsh +++ b/plugins/ruby/init.zsh @@ -1,7 +1,7 @@ # Install local gems according to Mac OS X conventions. if [[ "$OSTYPE" == darwin* ]]; then export GEM_HOME=$HOME/Library/Ruby/Gems/1.8 - export PATH=$GEM_HOME/bin:$PATH + path=("$GEM_HOME/bin" $path) # gem is slow; cache its output. cache_file="${0:h}/cache.zsh" @@ -12,6 +12,12 @@ if [[ "$OSTYPE" == darwin* ]]; then source "$cache_file" fi unset cache_file + + # Set environment variables for launchd processes. + for env_var in GEM_PATH GEM_HOME; do + launchctl setenv "$env_var" "${(P)env_var}" &! + done + unset env_var fi # Loads RVM into the shell session. @@ -29,11 +35,3 @@ if [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then eval "$(rbenv init -)" fi -# Set environment variables for launchd processes. -if [[ "$OSTYPE" == darwin* ]]; then - for env_var in GEM_PATH GEM_HOME; do - launchctl setenv "$env_var" "${(P)env_var}" &! - done - unset env_var -fi -