From 73b0e05368c6f37ba398c149a4671c32c0b027b5 Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Tue, 15 Sep 2015 17:34:10 +0100 Subject: [PATCH 1/2] Adding rbenv support for RVM branch, though now without rbenv-gemset support. --- bullet-train.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 70a311c..93b4fef 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -345,6 +345,8 @@ prompt_rvm() { then prompt_segment $BULLETTRAIN_RVM_BG $BULLETTRAIN_RVM_FG $BULLETTRAIN_RVM_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.*$//')" fi } From 5a364bad20f3f013efa9ea079a91056848086cfc Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Thu, 17 Sep 2015 11:56:17 +0100 Subject: [PATCH 2/2] Unified naming for ruby section. Theme and Readme updated. --- README.md | 12 ++++++------ bullet-train.zsh-theme | 32 +++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1b79404..70a9cbd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 93b4fef..81eaa02 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -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