Unified naming for ruby section. Theme and Readme updated.

This commit is contained in:
Viktor (Icon) VAD
2015-09-17 11:56:17 +01:00
parent 73b0e05368
commit 5a364bad20
2 changed files with 23 additions and 21 deletions

View File

@@ -13,7 +13,7 @@ simplicity, showing information only when it's relevant.
It currently shows:
- Current Python virtualenv
- Current Ruby version and gemset, through RVM
- Current Ruby version using Rbenv; version and gemset when on RVM
- Current Node.js version, through NVM
- Git status
- Timestamp
@@ -153,14 +153,14 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|`BULLETTRAIN_NVM_FG`|`white`|Foreground color
|`BULLETTRAIN_NVM_PREFIX`|`"⬡ "`|Prefix of the segment
### Ruby RVM
### Ruby RVM/Rbenv
|Variable|Default|Meaning
|--------|-------|-------|
|`BULLETTRAIN_RVM_SHOW`|`true`|Show/hide that segment
|`BULLETTRAIN_RVM_BG`|`magenta`|Background color
|`BULLETTRAIN_RVM_FG`|`white`|Foreground color
|`BULLETTRAIN_RVM_PREFIX`|`"♦"`|Prefix of the segment
|`BULLETTRAIN_RUBY_SHOW`|`true`|Show/hide that segment
|`BULLETTRAIN_RUBY_BG`|`magenta`|Background color
|`BULLETTRAIN_RUBY_FG`|`white`|Foreground color
|`BULLETTRAIN_RUBY_PREFIX`|`"♦"`|Prefix of the segment
### Dir

View File

@@ -79,18 +79,18 @@ if [ ! -n "${BULLETTRAIN_NVM_PREFIX+1}" ]; then
BULLETTRAIN_NVM_PREFIX="⬡ "
fi
# RMV
if [ ! -n "${BULLETTRAIN_RVM_SHOW+1}" ]; then
BULLETTRAIN_RVM_SHOW=true
# RUBY
if [ ! -n "${BULLETTRAIN_RUBY_SHOW+1}" ]; then
BULLETTRAIN_RUBY_SHOW=true
fi
if [ ! -n "${BULLETTRAIN_RVM_BG+1}" ]; then
BULLETTRAIN_RVM_BG=magenta
if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then
BULLETTRAIN_RUBY_BG=magenta
fi
if [ ! -n "${BULLETTRAIN_RVM_FG+1}" ]; then
BULLETTRAIN_RVM_FG=white
if [ ! -n "${BULLETTRAIN_RUBY_FG+1}" ]; then
BULLETTRAIN_RUBY_FG=white
fi
if [ ! -n "${BULLETTRAIN_RVM_PREFIX+1}" ]; then
BULLETTRAIN_RVM_PREFIX=♦️
if [ ! -n "${BULLETTRAIN_RUBY_PREFIX+1}" ]; then
BULLETTRAIN_RUBY_PREFIX=♦️
fi
# DIR
@@ -334,19 +334,21 @@ prompt_dir() {
prompt_segment $BULLETTRAIN_DIR_BG $BULLETTRAIN_DIR_FG $dir
}
# RVM: only shows RVM info if on a gemset that is not the default one
prompt_rvm() {
if [[ $BULLETTRAIN_RVM_SHOW == false ]] then
# RUBY
# RVM: only shows RUBY info if on a gemset that is not the default one
# RBENV: shows current ruby version active in the shell
prompt_ruby() {
if [[ $BULLETTRAIN_RUBY_SHOW == false ]] then
return
fi
if which rvm-prompt &> /dev/null; then
if [[ ! -n $(rvm gemset list | grep "=> (default)") ]]
then
prompt_segment $BULLETTRAIN_RVM_BG $BULLETTRAIN_RVM_FG $BULLETTRAIN_RVM_PREFIX" $(rvm-prompt i v g)"
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
fi
elif which rbenv &> /dev/null; then
prompt_segment $BULLETTRAIN_RVM_BG $BULLETTRAIN_RVM_FG $BULLETTRAIN_RVM_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
fi
}
@@ -437,7 +439,7 @@ build_prompt() {
RETVAL=$?
prompt_time
prompt_status
prompt_rvm
prompt_ruby
prompt_virtualenv
prompt_nvm
prompt_context