From 079342587f176b5b5578266062ee683e5ce9b73c Mon Sep 17 00:00:00 2001 From: Damien Pollet Date: Sun, 10 Feb 2013 17:52:54 +0100 Subject: [PATCH] Override default gem list location Setting $RBENV_DEFAULT_GEMS overrides the default location ($RBENV_ROOT/default-gems) --- etc/rbenv.d/install/default-gems.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/rbenv.d/install/default-gems.bash b/etc/rbenv.d/install/default-gems.bash index 2455887..902184c 100644 --- a/etc/rbenv.d/install/default-gems.bash +++ b/etc/rbenv.d/install/default-gems.bash @@ -8,7 +8,10 @@ install_default_gems() { # Only install default gems after successfully installing Ruby. [ "$STATUS" = "0" ] || return 0 - if [ -f "${RBENV_ROOT}/default-gems" ]; then + local default_gems + default_gems="${RBENV_DEFAULT_GEMS:-${RBENV_ROOT}/default-gems}" + + if [ -f "${default_gems}" ]; then local line gem_name gem_version args # Read gem names and versions from $RBENV_ROOT/default-gems. @@ -38,6 +41,6 @@ install_default_gems() { echo "rbenv: error installing gem \`$gem_name'" } >&2 - done < "${RBENV_ROOT}/default-gems" + done < "${default_gems}" fi }