diff --git a/lib/rvm.zsh b/lib/rvm.zsh index 597be1b33..58ae153f6 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -4,4 +4,15 @@ function rvm_prompt_info() { echo "($ruby_version)" } +# get the name of the ruby as well as the gemset +# from http://snipplr.com/view.php?codeview&id=36724 +function rvm_with_gemset { + local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') + [ "$gemset" != "" ] && gemset="@$gemset" + # local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') + local version=$(~/.rvm/bin/rvm-prompt s i v) + [ "$version" != "" ] && version="$version" + local full="$version$gemset" + [ "$full" != "" ] && echo "$full" +}