Created
June 12, 2011 18:31
-
-
Save dcuddeback/1021857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
{ | |
DEFAULT="\033[0m" | |
CYAN="\033[0;36m" | |
ruby_string="1.9.2" | |
gemset_name=$(git remote show -n origin | grep -i url | head -n 1 | sed 's;.*/;;g' | sed 's;\.git$;;') | |
# setup RVM environment | |
rvm use --create "${ruby_string}@${gemset_name}" | |
if [[ -f Gemfile ]] | |
then | |
# setup Bundler | |
if ! gem list | grep -q bundler | |
then | |
echo -e "${CYAN}The rubygem 'bundler' is not installed, installing it now.${DEFAULT}" | |
gem install bundler | |
fi | |
# install gems | |
echo -e "${CYAN}Bundling your gems this may take a few minutes on a fresh clone.${DEFAULT}" | |
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d' | |
fi | |
} >&2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment