forked from ghazel/ruby-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rvmrc
27 lines (21 loc) · 765 Bytes
/
.rvmrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
environment_id="ruby-1.9.3@pg"
rvmdir=${rvm_path:-$HOME/.rvm}
gemset_file=".rvm.gems"
if [[ -d "${rvmdir}/environments" && -s "${rvmdir}/environments/$environment_id" ]]; then
echo "Using ${environment_id}"
. "${rvmdir}/environments/$environment_id"
if [[ -s "${rvmdir}/hooks/after_use" ]]; then
. "${rvmdir}/hooks/after_use"
fi
else
# If the environment file has not yet been created, use the RVM CLI to select.
if ! rvm --create use "$environment_id"; then
echo "Failed to create RVM environment '${environment_id}'."
fi
fi
if [[ -s "$gemset_file" ]]; then
rvm gemset import "$gemset_file"
fi