Skip to content

Commit eb4a2c5

Browse files
committed
update ruby
1 parent ffd68fd commit eb4a2c5

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.rvmrc

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
77
# Only full ruby name is supported here, for short names use:
8-
# echo "rvm use 1.9.3" > .rvmrc
9-
environment_id="ruby-1.9.3-p194@bootstrap-wysihtml5"
8+
# echo "rvm use 2.0.0" > .rvmrc
9+
environment_id="ruby-2.0.0-p195@wysihtml5"
1010

1111
# Uncomment the following lines if you want to verify rvm version per project
12-
# rvmrc_rvm_version="1.13.5 (master)" # 1.10.1 seams as a safe start
12+
# rvmrc_rvm_version="1.20.13 (master)" # 1.10.1 seams as a safe start
1313
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
1414
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
1515
# return 1
@@ -23,8 +23,20 @@ if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
2323
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
2424
then
2525
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26-
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
27-
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
26+
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
27+
do
28+
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
29+
then \. "${__hook}" || true
30+
fi
31+
done
32+
unset __hook
33+
if (( ${rvm_use_flag:=1} >= 2 )) # display only when forced
34+
then
35+
if [[ $- == *i* ]] # check for interactive shells
36+
then printf "%b" "Using: \E[32m$GEM_HOME\E[0m" # show the user the ruby and gemset they are using in green
37+
else printf "%b" "Using: $GEM_HOME" # don't use colors in non-interactive shells
38+
fi
39+
fi
2840
else
2941
# If the environment file has not yet been created, use the RVM CLI to select.
3042
rvm --create "$environment_id" || {

0 commit comments

Comments
 (0)