Skip to content

Commit

Permalink
Merge pull request jf#9 from drewolson/active
Browse files Browse the repository at this point in the history
Add active command
  • Loading branch information
jamis committed Sep 8, 2011
2 parents 6372b27 + c784cdd commit b637722
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bin/rbenv-gemset
Expand Up @@ -4,6 +4,25 @@ set -e
RBENV_GEMSET_VERSION="0.1.0"

case "$1" in
"active")
if [ -e "/etc/rbenv.d/util/gemset.bash" ]; then
source "/etc/rbenv.d/util/gemset.bash"
elif [ -e "${HOME}/.rbenv/rbenv.d/util/gemset.bash" ]; then
source "${HOME}/.rbenv/rbenv.d/util/gemset.bash"
else
echo "unable to find gemset plugin in /etc/rbenv.d or ${HOME}/.rbenv/rbenv.d" >&2
exit 1
fi

if [ -n "$(active_gemsets)" ]; then
for gemset in $(active_gemsets); do
echo "${gemset}"
done
else
echo "no active gemsets" >&2
fi
;;

"create")
RBENV_VERSION="$2"
if [ -z "${RBENV_VERSION}" ]; then
Expand Down

0 comments on commit b637722

Please sign in to comment.