Permalink
Browse files

Added Christian's function to utility.

  • Loading branch information...
wayneeseguin committed Feb 23, 2011
1 parent 71a2e44 commit b9957e16fccbdf46be146a005d2e380b56fb5ebe
Showing with 17 additions and 4 deletions.
  1. +1 −4 scripts/gemsets
  2. +16 −0 scripts/utility
View
@@ -225,10 +225,7 @@ gemset_list()
if [[ -n "${rvm_ruby_string:-""}" ]] ; then
- # What's the current gemset?
- local current_gemset="${GEM_HOME:-}"
- # We only care about the stuff to the right of the separator.
- current_gemset="${current_gemset##*${rvm_gemset_separator:-@}}"
+ local current_gemset=$(__rvm_current_gemset)
# Figure out the active gemsets for this version.
for gemset in "${rvm_gems_path:-${rvm_path}/gems}/${rvm_ruby_string}${rvm_gemset_separator:-@}"* ; do
View
@@ -1186,6 +1186,22 @@ __rvm_strip()
return $?
}
+__rvm_current_gemset()
+{
+ # Fetch the current gemset via GEM_HOME
+ local current_gemset="${GEM_HOME:-}"
+
+ # We only care about the stuff to the right of the separator.
+ current_gemset="${current_gemset##*${rvm_gemset_separator:-@}}"
+
+ if [[ "${current_gemset}" = "${GEM_HOME:-}" ]] ; then
+ echo ''
+ else
+ echo "${current_gemset}"
+ fi
+}
+
+
__rvm_using_gemset_globalcache()
{
"$rvm_path/scripts/db" "$rvm_path/config/user" \

0 comments on commit b9957e1

Please sign in to comment.