Skip to content

Instantly share code, notes, and snippets.

@zph
Created October 28, 2014 12:09
Show Gist options
  • Select an option

  • Save zph/b8bccb746010a850a9a8 to your computer and use it in GitHub Desktop.

Select an option

Save zph/b8bccb746010a850a9a8 to your computer and use it in GitHub Desktop.
source /usr/local/share/chruby/chruby.sh
# RUBIES+=(~/.rvm/rubies/*)
source /usr/local/share/chruby/auto.sh
# Credit: https://github.com/postmodern/chruby/wiki/Implementing-an-'after-use'-hook
save_function()
{
local ORIG_FUNC="$(declare -f $1)"
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEWNAME_FUNC"
}
save_function chruby old_chruby
chruby() {
old_chruby $*
PATHS_TO_PREFIX_BEFORE_CHRUBY="./.bundle/.binstubs"
local modified_path=$(echo $PATH | sed 's/:.\/.bundle\/.binstubs//')
export PATH=${PATHS_TO_PREFIX_BEFORE_CHRUBY}:$modified_path
}
chruby 2.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment