Skip to content

Commit

Permalink
Fix #48; bump version up to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jf committed Sep 23, 2013
1 parent b14e643 commit 2cd80ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
16 changes: 14 additions & 2 deletions etc/rbenv.d/rehash/gemset.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
shopt -s nullglob

RBENV_GEMSET_DIR="$(dirname "$(rbenv-gemset file 2>/dev/null)" 2>/dev/null)"
PROJECT_GEMSET_LIST="${RBENV_ROOT}/versions/$(rbenv-version-name)/gemsets/.project-gemsets"
project_gemset='\..+'
OLDIFS="$IFS"
IFS=$' \t\n'
gemset_bin=(${RBENV_ROOT}/versions/*/gemsets/*/bin/*)
for gemset in $(rbenv-gemset active 2>/dev/null); do
if [[ $gemset =~ $project_gemset ]]; then
mkdir -p "$PROJECT_GEMSET_LIST"
gemset=${RBENV_GEMSET_DIR}/$gemset
link=${PROJECT_GEMSET_LIST}/${gemset////__}
ln -sf "$gemset" "$link"
fi
done
IFS="$OLDIFS"

cd "$SHIM_PATH"
make_shims ${gemset_bin[@]}
gemset_bin=(${RBENV_ROOT}/versions/*/gemsets/*/bin/*)
make_shims "${gemset_bin[@]}" "${RBENV_ROOT}/versions/*/gemsets/.project-gemsets/*/bin/*"
cd "$CUR_PATH"
18 changes: 14 additions & 4 deletions etc/rbenv.d/which/gemset.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ else
RBENV_GEMSET_ROOT="$(rbenv-prefix)/gemsets"
fi

RBENV_GEMSET_DIR="$(dirname "$(rbenv-gemset file 2>/dev/null)" 2>/dev/null)"
project_gemset='\..+'
OLDIFS="$IFS"
IFS=$' \t\n'
for gemset in $(rbenv-gemset active 2>/dev/null); do
command="${RBENV_GEMSET_ROOT}/${gemset}/bin/$RBENV_COMMAND"
if [ -x "$command" ]; then
RBENV_COMMAND_PATH="$command"
break
if [[ $gemset =~ $project_gemset ]]; then
command="${RBENV_GEMSET_DIR}/${gemset}/bin/$RBENV_COMMAND"
if [ -x "$command" ]; then
RBENV_COMMAND_PATH="$command"
break
fi
else
command="${RBENV_GEMSET_ROOT}/${gemset}/bin/$RBENV_COMMAND"
if [ -x "$command" ]; then
RBENV_COMMAND_PATH="$command"
break
fi
fi
done
IFS="$OLDIFS"
2 changes: 1 addition & 1 deletion libexec/rbenv-gemset
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

RBENV_GEMSET_VERSION="0.4.0"
RBENV_GEMSET_VERSION="0.4.1"

# Provide rbenv completions
if [ "$1" = "--complete" ]; then
Expand Down

0 comments on commit 2cd80ed

Please sign in to comment.