Add chruby and chruby-auto plugins
* chruby.bash loads chruby * chruby-auto.bash loads chruby and enables auto-switching * add chruby_version_prompt() function for displaying ruby version * inspired by https://gist.github.com/rssvihla/6153455
This commit is contained in:
5
plugins/available/chruby-auto.bash
Normal file
5
plugins/available/chruby-auto.bash
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
cite about-plugin
|
||||||
|
about-plugin 'load chruby + auto-switching (from /usr/local/share/chruby)'
|
||||||
|
|
||||||
|
source /usr/local/share/chruby/chruby.sh
|
||||||
|
source /usr/local/share/chruby/auto.sh
|
||||||
4
plugins/available/chruby.bash
Normal file
4
plugins/available/chruby.bash
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
cite about-plugin
|
||||||
|
about-plugin 'load chruby (from /usr/local/share/chruby)'
|
||||||
|
|
||||||
|
source /usr/local/share/chruby/chruby.sh
|
||||||
@@ -132,8 +132,18 @@ function rbfu_version_prompt {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function chruby_version_prompt {
|
||||||
|
if declare -f -F chruby &> /dev/null; then
|
||||||
|
if declare -f -F chruby_auto &> /dev/null; then
|
||||||
|
chruby_auto
|
||||||
|
fi
|
||||||
|
chruby=$(ruby --version | awk '{print $1, $2;}') || return
|
||||||
|
echo -e "$CHRUBY_THEME_PROMPT_PREFIX$chruby$CHRUBY_THEME_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function ruby_version_prompt {
|
function ruby_version_prompt {
|
||||||
echo -e "$(rbfu_version_prompt)$(rbenv_version_prompt)$(rvm_version_prompt)"
|
echo -e "$(rbfu_version_prompt)$(rbenv_version_prompt)$(rvm_version_prompt)$(chruby_version_prompt)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function virtualenv_prompt {
|
function virtualenv_prompt {
|
||||||
|
|||||||
Reference in New Issue
Block a user