robbyrussell/oh-my-zsh — Issue #962: Only show rvm_prompt if not using default ruby
Author: autodidakto
Created: 2012-02-22 10:50:58+00:00
State: open

In my bash prompt, I displayed the current ruby version only if it wasn't the default for rvm. Is there a way to do this with the rvm_prompt/rvm plugin? Here's the function I used:

````bash
function __my_rvm_ruby_version {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
[ "$version" == "1.9.3" ] && version=""
local full="$version$gemset"
[ "$full" != "" ] && echo "$full "
}
````