forked from scottwb/bunny-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rvmrc
35 lines (26 loc) · 1.02 KB
/
.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
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
#
# Based on the example from: http://rvm.beginrescueend.com/workflow/rvmrc/
#
ruby_string="ruby-1.9.3-p194"
gemset_name="bunny-mock"
if rvm list strings | grep -q "${ruby_string}" ; then
# Load or create the specified environment
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
else
rvm --create "${ruby_string}@${gemset_name}"
fi
# Ensure that Bundler is installed, install it if it is not.
if ! command -v bundle ; then
echo "Installing bundler"
gem install bundler
fi
# Bundle while reducing excess noise.
echo "Making sure bundle is up-to-date..."
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
else
# Notify the user to install the desired interpreter before proceeding.
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
fi