Skip to content

Commit a132c77

Browse files
committed
Add multiple Ruby manager support.
1 parent fe35538 commit a132c77

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

bashrc

+21-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,27 @@ if command -v src-hilite-lesspipe.sh >/dev/null ; then
11821182
fi
11831183

11841184
# Conditional support for Ruby Version Manager (RVM)
1185-
safe_source_first "${HOME}/.rvm/scripts/rvm" "/usr/local/lib/rvm"
1185+
case "$RUBY_MANAGER" in
1186+
chruby)
1187+
if command -v brew >/dev/null ; then
1188+
safe_source_first "$(brew --prefix)/opt/chruby/share/chruby/chruby.sh" \
1189+
"/usr/local/share/chruby/chruby.sh"
1190+
else
1191+
safe_source_first "/usr/local/share/chruby/chruby.sh"
1192+
fi
1193+
;;
1194+
rbenv)
1195+
for d in "${HOME}/.rbenv/bin" "/usr/local/rvm/bin" ; do
1196+
if [ -d "$d" ] ; then
1197+
export PATH="$d:$PATH" ; break
1198+
fi
1199+
done ; unset d
1200+
eval "$(rbenv init -)"
1201+
;;
1202+
rvm|*)
1203+
safe_source_first "${HOME}/.rvm/scripts/rvm" "/usr/local/lib/rvm"
1204+
;;
1205+
esac
11861206

11871207
# Number of commands to remember in the command history
11881208
export HISTSIZE=10000

bashrc.local.site

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#---------------------------------------------------------------
99
# Set Global Environment Variables
1010
#---------------------------------------------------------------
11+
#RUBY_MANAGER=
1112

1213

1314
#---------------------------------------------------------------

0 commit comments

Comments
 (0)