Created
October 28, 2014 12:09
-
-
Save zph/b8bccb746010a850a9a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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