From bef797c23c03ac69ca6d95e056b5da33976a9582 Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Mon, 20 Sep 2010 21:55:05 -0600 Subject: [PATCH] Added a rvm_with_gemset function to lib/rvm.zsh to print out the ruby along with the gemset ex.: ruby-1.9.2@rails3 --- lib/rvm.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) 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" +}