Skip to content

Instantly share code, notes, and snippets.

@tra38
Created January 4, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tra38/da6954ba8a62041d4973 to your computer and use it in GitHub Desktop.
Save tra38/da6954ba8a62041d4973 to your computer and use it in GitHub Desktop.
which gem
gem () {
\typeset result
(
\typeset rvmrc
rvm_rvmrc_files=("/etc/rvmrc" "$HOME/.rvmrc")
if [[ -n "${rvm_prefix:-}" ]] && ! [[ "$HOME/.rvmrc" -ef "${rvm_prefix}/.rvmrc" ]]
then
rvm_rvmrc_files+=("${rvm_prefix}/.rvmrc")
fi
for rvmrc in "${rvm_rvmrc_files[@]}"
do
[[ -s "${rvmrc}" ]] && source "${rvmrc}" || true
done
unset rvm_rvmrc_files
command gem "$@"
) || result=$?
hash -r
return ${result:-0}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment