Skip to content

Commit 0fe6cd8

Browse files
committed
Update rvmrc
1 parent 2d4a7a7 commit 0fe6cd8

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

.rvmrc

+16-33
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,30 @@
33
# This is an RVM Project .rvmrc file, used to automatically load the ruby
44
# development environment upon cd'ing into the directory
55

6-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
76
environment_id="ruby-1.9.3@mongrel2"
87

9-
#
10-
# Uncomment following line if you want options to be set only for given project.
11-
#
12-
# PROJECT_JRUBY_OPTS=( --1.9 )
13-
14-
#
15-
# First we attempt to load the desired environment directly from the environment
16-
# file. This is very fast and efficient compared to running through the entire
17-
# CLI and selector. If you want feedback on which environment was used then
18-
# insert the word 'use' after --create as this triggers verbose mode.
19-
#
208
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
21-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
22-
then
23-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
9+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]; then
10+
echo "Using ${environment_id}"
11+
. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
2412

25-
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
26-
then
27-
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
28-
fi
13+
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]; then
14+
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
15+
fi
2916
else
30-
# If the environment file has not yet been created, use the RVM CLI to select.
31-
if ! rvm --create "$environment_id"
32-
then
33-
echo "Failed to create RVM environment '${environment_id}'."
34-
exit 1
35-
fi
17+
# If the environment file has not yet been created, use the RVM CLI to select.
18+
if ! rvm --create use "$environment_id"
19+
then
20+
echo "Failed to create RVM environment '${environment_id}'."
21+
exit 1
22+
fi
3623
fi
3724

38-
#
39-
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
40-
# it be automatically loaded. Uncomment the following and adjust the filename if
41-
# necessary.
42-
#
4325
filename=".rvm.gems"
44-
if [[ -s "$filename" ]]; then
45-
rvm gemset import "$filename"
26+
if [[ -s "$filename" ]]; then
27+
rvm gemset import "$filename"
4628
fi
4729

48-
30+
echo "The future belongs to the dogs."
31+
echo
4932

0 commit comments

Comments
 (0)