Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments fix for --no-doc's #11

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions etc/rbenv.d/install/default-gems.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,40 @@ install_default_gems() {

gem_name="${line[0]}"
gem_version="${line[1]}"
gem_no_document="${line[2]}"
gem_install="install"

if [ "$gem_version" == "--pre" ]; then
args=( --pre )
elif [ -n "$gem_version" ]; then
args=( --version "$gem_version" )
if [[ "$VERSION_NAME" =~ "1.9.3" ]] ; then
nodocs="--no-ri --no-rdoc"
else
args=()
nodocs="--no-document"
fi

arguments=""
if [ "$gem_name" == "specific_install" -a "$gem_version" != "--no-document" ]; then
gem_install="specific_install"
gem_name=""
arguments="$gem_version"
else
if [ "$gem_version" == "--pre" ]; then
arguments=" --pre "
elif [ "$gem_version" == "--no-document" ]; then
arguments=" $nodocs "
elif [ -n "$gem_version" ]; then
arguments=" --version '$gem_version' "
fi

if [ "$gem_no_document" == "--no-document" ]; then
arguments="$arguments $nodocs "
fi
fi

args=( ${arguments} )

# Invoke `gem install` in the just-installed Ruby. Point its
# stdin to /dev/null or else it'll read from our default-gems
# file.
RBENV_VERSION="$VERSION_NAME" rbenv-exec gem install "$gem_name" "${args[@]}" < /dev/null || {
RBENV_VERSION="$VERSION_NAME" rbenv-exec gem "$gem_install" "$gem_name" "${args[@]}" < /dev/null || {
echo "rbenv: error installing gem \`$gem_name'"
} >&2

Expand Down