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

This commit is contained in:
JT Zemp 2010-09-20 21:55:05 -06:00
commit bef797c23c

View file

@ -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"
}