2014-01-06 01:57:09 -07:00
|
|
|
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
|
|
|
|
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
|
|
|
|
virtualenv_prompt_info {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# oh-my-zsh supports an rvm prompt by default
|
2013-12-30 18:11:02 -07:00
|
|
|
# get the name of the rvm ruby version
|
|
|
|
function rvm_prompt_info() {
|
|
|
|
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
|
|
|
|
local rvm_prompt
|
|
|
|
rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
|
|
|
|
[[ "${rvm_prompt}x" == "x" ]] && return 1
|
|
|
|
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
|
|
|
|
}
|
|
|
|
|
2014-01-06 01:57:09 -07:00
|
|
|
# use this to enable users to see their ruby version, no matter which
|
|
|
|
# version management system they use
|
2013-12-30 18:11:02 -07:00
|
|
|
function ruby_prompt_info() {
|
|
|
|
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
|
|
|
|
}
|