Add rbfu support.

Prompts can now display the currently active Ruby version set by rbfu, a tool similar to RVM and rbenv.
This commit is contained in:
Hendrik Mans
2012-01-24 14:30:01 +01:00
parent 12167fb1df
commit d356ecb14b
2 changed files with 10 additions and 1 deletions

View File

@@ -27,6 +27,9 @@ VIRTUALENV_THEME_PROMPT_SUFFIX='|'
RBENV_THEME_PROMPT_PREFIX=' |'
RBENV_THEME_PROMPT_SUFFIX='|'
RBFU_THEME_PROMPT_PREFIX=' |'
RBFU_THEME_PROMPT_SUFFIX='|'
function scm {
if [[ -d .git ]]; then SCM=$SCM_GIT
elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT
@@ -123,6 +126,12 @@ function rbenv_version_prompt {
fi
}
function rbfu_version_prompt {
if [[ $RBFU_RUBY_VERSION ]]; then
echo -e "${RBFU_THEME_PROMPT_PREFIX}${RBFU_RUBY_VERSION}${RBFU_THEME_PROMPT_SUFFIX}"
fi
}
function virtualenv_prompt {
if which virtualenv &> /dev/null; then
virtualenv=$([ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`") || return