rbenv-ruby-build/bin/rbenv-install
2011-09-23 09:08:53 -05:00

32 lines
No EOL
612 B
Bash
Executable file

#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x
# Provide rbenv completions
if [ "$1" = "--complete" ]; then
exec ruby-build --definitions
fi
if [ -z "$RBENV_ROOT" ]; then
RBENV_ROOT="${HOME}/.rbenv"
fi
DEFINITION="$1"
case "$DEFINITION" in
"" | -* )
{ echo "usage: rbenv install VERSION"
echo " rbenv install /path/to/definition"
echo
echo "Available versions:"
ruby-build --definitions | sed 's/^/ /'
echo
} >&2
exit 1
;;
esac
VERSION_NAME="${DEFINITION##*/}"
PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
ruby-build "$DEFINITION" "$PREFIX"
rbenv rehash