Browse Source

Cleaned up minor cruft in the Ruby plugin.

Use path helpers where appropriate.
Removed an unnecessary if statement.
master
Sorin Ionescu 13 years ago
parent
commit
7849948ead
  1. 16
      plugins/ruby/init.zsh

16
plugins/ruby/init.zsh

@ -1,7 +1,7 @@
# Install local gems according to Mac OS X conventions. # Install local gems according to Mac OS X conventions.
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
export GEM_HOME=$HOME/Library/Ruby/Gems/1.8 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. # gem is slow; cache its output.
cache_file="${0:h}/cache.zsh" cache_file="${0:h}/cache.zsh"
@ -12,6 +12,12 @@ if [[ "$OSTYPE" == darwin* ]]; then
source "$cache_file" source "$cache_file"
fi fi
unset cache_file 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 fi
# Loads RVM into the shell session. # Loads RVM into the shell session.
@ -29,11 +35,3 @@ if [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then
eval "$(rbenv init -)" eval "$(rbenv init -)"
fi 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

Loading…
Cancel
Save