Skip to content

Instantly share code, notes, and snippets.

@warmwaffles
Created August 19, 2013 19:43
Show Gist options
  • Save warmwaffles/6273177 to your computer and use it in GitHub Desktop.
Save warmwaffles/6273177 to your computer and use it in GitHub Desktop.
#!/bin/bash
function show_usage() {
echo "Usage: prep <gemset> [ruby=2.0.0] [directory=gemset]"
echo " - <gemset> the directory it is in. If it is not in that directory"
echo " please specify one."
echo " - [ruby] the version of ruby you want to use. Default is 2.0.0"
echo " - [directory] the directory the gemset. Default is the gemset"
}
if [ -z "$1" ]
then
show_usage
exit 1
fi
gemset=$1
version="2.0.0"
if [ -n "$2" ]
then
version=$2
fi
directory=$gemset
if [ -n "$3" ]
then
directory=$3
fi
echo "VERSION=$version"
echo $version > $directory/.ruby-version
echo "GEMSET=$gemset"
echo $gemset > $directory/.ruby-gemset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment