mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 11:50:38 +01:00
Rbenv gemsets
This commit is contained in:
@@ -13,7 +13,7 @@ simplicity, showing information only when it's relevant.
|
|||||||
|
|
||||||
It currently shows:
|
It currently shows:
|
||||||
- Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
|
- Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
|
||||||
- Current Ruby version using Rbenv or chruby; version and gemset when on RVM
|
- Current Ruby version using chruby; version and gemset when on RVM or Rbenv
|
||||||
- Current Node.js version, through NVM
|
- Current Node.js version, through NVM
|
||||||
- Git status
|
- Git status
|
||||||
- Timestamp
|
- Timestamp
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ prompt_dir() {
|
|||||||
|
|
||||||
# RUBY
|
# RUBY
|
||||||
# RVM: only shows RUBY info if on a gemset that is not the default one
|
# RVM: only shows RUBY info if on a gemset that is not the default one
|
||||||
# RBENV: shows current ruby version active in the shell
|
# RBENV: shows current ruby version active in the shell; also with non-global gemsets if any is active
|
||||||
# CHRUBY: shows current ruby version active in the shell
|
# CHRUBY: shows current ruby version active in the shell
|
||||||
prompt_ruby() {
|
prompt_ruby() {
|
||||||
if [[ $BULLETTRAIN_RUBY_SHOW == false ]]; then
|
if [[ $BULLETTRAIN_RUBY_SHOW == false ]]; then
|
||||||
@@ -364,14 +364,19 @@ prompt_ruby() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v rvm-prompt > /dev/null 2>&1; then
|
if command -v rvm-prompt > /dev/null 2>&1; then
|
||||||
if [[ ! -n $(rvm gemset list | grep "=> (default)") ]]
|
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
|
||||||
then
|
|
||||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
|
|
||||||
fi
|
|
||||||
elif command -v chruby > /dev/null 2>&1; then
|
elif command -v chruby > /dev/null 2>&1; then
|
||||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(chruby | sed -e 's/ \* //')"
|
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(chruby | sed -e 's/ \* //')"
|
||||||
elif command -v rbenv > /dev/null 2>&1; then
|
elif command -v rbenv > /dev/null 2>&1; then
|
||||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
|
current_gemset() {
|
||||||
|
echo "$(rbenv gemset active 2&>/dev/null | sed -e 's/ global$//')"
|
||||||
|
}
|
||||||
|
|
||||||
|
if $(rbenv gemset version > /dev/null) && [[ -n $(current_gemset) ]]; then
|
||||||
|
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"@"$(current_gemset)"
|
||||||
|
else
|
||||||
|
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user