6496acf58bf8531809490b52e34811f74a27cc7c

Author
Brent Faulkner <brent.faulkner@mosaic.com>
Committer
Brent Faulkner <brent.faulkner@mosaic.com>
Date

Message

adding rbenv support to all the rvm themes

Diff

  1diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme
  2index 1f66f1ec36e50a75f6f8503b5ec3a08bb66c0da0..4a1b1b3861d7f70e7471ec94b2854182f47c0773 100644
  3--- a/themes/alanpeabody.zsh-theme
  4+++ b/themes/alanpeabody.zsh-theme
  5@@ -1,7 +1,14 @@
  6 
  7 local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
  8 local pwd='%{$fg[blue]%}%~%{$reset_color%}'
  9-local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
 10+local rvm=''
 11+if which rvm-prompt &> /dev/null; then
 12+  rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
 13+else
 14+  if which rbenv &> /dev/null; then
 15+    rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
 16+  fi
 17+fi
 18 local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
 19 local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
 20 
 21@@ -19,4 +26,3 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
 22 
 23 PROMPT="${user} ${pwd}$ "
 24 RPROMPT="${return_code} ${git_branch} ${rvm}"
 25-
 26diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
 27index 5642eaeb86001bd4d4257f89f63b76cd0ab43842..2157204778f6c346569e4f69d638ce7c792a685f 100644
 28--- a/themes/bira.zsh-theme
 29+++ b/themes/bira.zsh-theme
 30@@ -3,7 +3,14 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
 31 
 32 local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
 33 local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
 34-local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
 35+local rvm_ruby=''
 36+if which rvm-prompt &> /dev/null; then
 37+  rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
 38+else
 39+  if which rbenv &> /dev/null; then
 40+    rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
 41+  fi
 42+fi
 43 local git_branch='$(git_prompt_info)%{$reset_color%}'
 44 
 45 PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
 46diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme
 47index 2473cd230e9f95e303bd0f5ff4c4434b020e4bfe..b2759a1b0fe9d7f05b04f34baac42de073b8092a 100644
 48--- a/themes/crunch.zsh-theme
 49+++ b/themes/crunch.zsh-theme
 50@@ -29,7 +29,13 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗"
 51 
 52 # Our elements:
 53 CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}"
 54-CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
 55+if which rvm-prompt &> /dev/null; then
 56+  CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
 57+else
 58+  if which rbenv &> /dev/null; then
 59+    CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
 60+  fi
 61+fi
 62 CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) "
 63 CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ "
 64 
 65diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme
 66index eef32e998221760ca1eea9a4bd13e7474dcd80fe..e9b4f852a36d45c65e634b9209da8d40f95867de 100644
 67--- a/themes/dallas.zsh-theme
 68+++ b/themes/dallas.zsh-theme
 69@@ -3,7 +3,13 @@
 70 # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
 71 DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}"
 72 # Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
 73-DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
 74+if which rvm-prompt &> /dev/null; then
 75+  DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
 76+else
 77+  if which rbenv &> /dev/null; then
 78+    DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}"
 79+  fi
 80+fi
 81 # Grab the current machine name: muscato
 82 DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
 83 # Grab the current filepath, use shortcuts: ~/Desktop
 84diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme
 85index 83664515adf78e8b3136f68e4a2e8bdd7c2f2d14..db2529990be4c95dce739357ec7633b7844b718f 100644
 86--- a/themes/eastwood.zsh-theme
 87+++ b/themes/eastwood.zsh-theme
 88@@ -1,6 +1,10 @@
 89 #RVM settings
 90 if [[ -s ~/.rvm/scripts/rvm ]] ; then 
 91   RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
 92+else
 93+  if which rbenv &> /dev/null; then
 94+    RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1"
 95+  fi
 96 fi
 97 
 98 ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
 99diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
100index 17cf597086c2cd501f928ddaf6b287ab6a1687cb..26e5471761d6b54fa17f28a76f489ea6e48eea11 100644
101--- a/themes/fino.zsh-theme
102+++ b/themes/fino.zsh-theme
103@@ -25,7 +25,14 @@ function box_name {
104 }
105 
106 
107-local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}'
108+local rvm_ruby=''
109+if which rvm-prompt &> /dev/null; then
110+  rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}'
111+else
112+  if which rbenv &> /dev/null; then
113+    rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
114+  fi
115+fi
116 local current_dir='${PWD/#$HOME/~}'
117 local git_info='$(git_prompt_info)'
118 
119diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
120index f9406dd966d1132f556ad3cb120b4a542cdd88d8..3eac14867e68cfbcc965a58b0f1978d2a7094f5b 100644
121--- a/themes/gallois.zsh-theme
122+++ b/themes/gallois.zsh-theme
123@@ -15,7 +15,11 @@ git_custom_status() {
124 if [[ -s ~/.rvm/scripts/rvm ]] ; then 
125   RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
126 else
127-  RPS1='$(git_custom_status) $EPS1'
128+  if which rbenv &> /dev/null; then
129+    RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
130+  else
131+    RPS1='$(git_custom_status) $EPS1'
132+  fi
133 fi
134 
135 PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
136diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
137index a170a13d0b435e835244c1cb945dbf07f4474beb..2f0c4b917a18d7023d1bc26d7f3235a58a6ca8a8 100644
138--- a/themes/jonathan.zsh-theme
139+++ b/themes/jonathan.zsh-theme
140@@ -10,7 +10,7 @@ function theme_precmd {
141     PR_PWDLEN=""
142 
143     local promptsize=${#${(%):---(%n@%m:%l)---()--}}
144-    local rubyprompt=`rvm_prompt_info`
145+    local rubyprompt=`rvm_prompt_info || rbenv_prompt_info`
146     local rubypromptsize=${#${rubyprompt}}
147     local pwdsize=${#${(%):-%~}}
148 
149@@ -113,7 +113,7 @@ setprompt () {
150     PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
151 $PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
152 $PR_GREEN%$PR_PWDLEN<...<%~%<<\
153-$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
154+$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
155 $PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\
156 $PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\
157 
158diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
159index 6bed1a70e46716437afb494ed699c724bd8df670..142e768380e23b1d0b11b4b63fc4ca31a2b43867 100644
160--- a/themes/josh.zsh-theme
161+++ b/themes/josh.zsh-theme
162@@ -10,7 +10,7 @@ function josh_prompt {
163   prompt=" "
164 
165   branch=$(current_branch)
166-  ruby_version=$(rvm_prompt_info)
167+  ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
168   path_size=${#PWD}
169   branch_size=${#branch}
170   ruby_size=${#ruby_version}
171@@ -31,7 +31,7 @@ function josh_prompt {
172     prompt=" $prompt"
173   done
174   
175-  prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
176+  prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)"
177   
178   echo $prompt
179 }
180diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme
181index 4eb410233f96bbfa0f43b47122964eaee3ee893f..0453767613524b9b8d55ad480db8232d0628d438 100644
182--- a/themes/macovsky-ruby.zsh-theme
183+++ b/themes/macovsky-ruby.zsh-theme
184@@ -1,7 +1,14 @@
185 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
186 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
187 
188-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
189+if which rvm-prompt &> /dev/null; then
190+  PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
191+else
192+  if which rbenv &> /dev/null; then
193+    PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
194+  fi
195+fi
196+
197 RPS1="${return_code}"
198 
199 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
200diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme
201index 4eb410233f96bbfa0f43b47122964eaee3ee893f..b6978b9290fce5b6a5b27509cdcef12c9d507e0a 100644
202--- a/themes/macovsky.zsh-theme
203+++ b/themes/macovsky.zsh-theme
204@@ -1,7 +1,13 @@
205 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
206 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
207 
208-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
209+if which rvm-prompt &> /dev/null; then
210+  PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
211+else
212+  if which rbenv &> /dev/null; then
213+    PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
214+  fi
215+fi
216 RPS1="${return_code}"
217 
218 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
219diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme
220index 310357b4586efe5b43594277c7ee88f48a2f7152..bc2b9b22465fdde33561b496104e395f3972bc30 100644
221--- a/themes/murilasso.zsh-theme
222+++ b/themes/murilasso.zsh-theme
223@@ -1,7 +1,7 @@
224 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
225 local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
226 local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
227-local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
228+local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}'
229 local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
230 
231 PROMPT="${user_host}:${current_dir} ${rvm_ruby}
232diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme
233index c49df972eb6af42a2de689a7d3cc42d648e02443..c5864d9b8d81641dafea787ef6b4af4573890525 100644
234--- a/themes/nebirhos.zsh-theme
235+++ b/themes/nebirhos.zsh-theme
236@@ -4,6 +4,10 @@
237 # Get the current ruby version in use with RVM:
238 if [ -e ~/.rvm/bin/rvm-prompt ]; then
239     RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} "
240+else
241+  if which rbenv &> /dev/null; then
242+    RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} "
243+  fi
244 fi
245 
246 # Get the host name (first 4 chars)
247diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme
248index 16eeb53162d0531aaca9a6fb4cfa5f76579149b0..0be816de0af852876b34a9ee817a81cd7fc97f4e 100644
249--- a/themes/superjarin.zsh-theme
250+++ b/themes/superjarin.zsh-theme
251@@ -1,5 +1,11 @@
252 # Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
253-JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
254+if which rvm-prompt &> /dev/null; then
255+  JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
256+else
257+  if which rbenv &> /dev/null; then
258+    JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}"
259+  fi
260+fi
261 
262 # Grab the current filepath, use shortcuts: ~/Desktop
263 # Append the current git branch, if in a git repository
264diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
265index f50657db2c909def178fa5762def0f9ab613157d..c87f6455851df07b2659688761be347199244c97 100644
266--- a/themes/suvash.zsh-theme
267+++ b/themes/suvash.zsh-theme
268@@ -12,8 +12,15 @@ function collapse_pwd {
269     echo $(pwd | sed -e "s,^$HOME,~,")
270 }
271 
272-PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} 
273+if which rvm-prompt &> /dev/null; then
274+  PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} 
275 $(virtualenv_info)$(prompt_char) '
276+else
277+  if which rbenv &> /dev/null; then
278+    PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} 
279+$(virtualenv_info)$(prompt_char) '
280+  fi
281+fi
282 
283 
284 ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
285diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme
286index 182d8a34fd0ae8cb9f08658fb68e3fc1ec84138d..4019d0a51d134791ac2b7097c86babfa331d9175 100644
287--- a/themes/wuffers.zsh-theme
288+++ b/themes/wuffers.zsh-theme
289@@ -2,4 +2,4 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}["
290 ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
291 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}"
292 
293-PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} '
294+PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current 2>/dev/null || rbenv version-name 2>/dev/null)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} '
295diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
296index 3dff29c9c71cfaac9f0d67d0b7fb752e6224edc1..574e0cec3b17b8549d4a66dc81b8b0b8a2262b8e 100644
297--- a/themes/zhann.zsh-theme
298+++ b/themes/zhann.zsh-theme
299@@ -1,5 +1,13 @@
300 PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
301-RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
302+
303+if which rvm-prompt &> /dev/null; then
304+  RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
305+else
306+  if which rbenv &> /dev/null; then
307+    RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}'
308+  fi
309+fi
310+
311 
312 ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
313 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"