Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Christian's function to utility.

  • Loading branch information...
commit b9957e16fccbdf46be146a005d2e380b56fb5ebe 1 parent 71a2e44
@wayneeseguin wayneeseguin authored
Showing with 17 additions and 4 deletions.
  1. +1 −4 scripts/gemsets
  2. +16 −0 scripts/utility
View
5 scripts/gemsets
@@ -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
16 scripts/utility
@@ -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" \
Please sign in to comment.
Something went wrong with that request. Please try again.