Skip to content

Commit

Permalink
'rvm gemset list' now has a '=>' for the currently used gemset
Browse files Browse the repository at this point in the history
  • Loading branch information
docwhat committed Feb 23, 2011
1 parent c0294f7 commit 1c9e691
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scripts/gemsets
Expand Up @@ -225,10 +225,21 @@ gemset_list()

if [[ -n "${rvm_ruby_string:-""}" ]] ; then

ls "${rvm_gems_path:-"$rvm_path/gems"}/" \
| awk -F"${rvm_gemset_separator:-"@"}" \
"/${rvm_ruby_string}${rvm_gemset_separator:-"@"}/{print \$2}" \
2>/dev/null
# 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:-@}}"

# Figure out the active gemsets for this version.
for gemset in "${rvm_gems_path:-${rvm_path}/gems}/${rvm_ruby_string}${rvm_gemset_separator:-@}"*
do
gemset="${gemset##*${rvm_gemset_separator:-@}}"
if [[ "${gemset}" = "${current_gemset}" ]]; then
echo "=> ${gemset}"
else
echo " ${gemset}"
fi
done

else
rvm_error "\$rvm_ruby_string is not set!"
Expand Down

0 comments on commit 1c9e691

Please sign in to comment.