Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created May 21, 2010 08:50
Show Gist options
  • Save vangberg/408632 to your computer and use it in GitHub Desktop.
Save vangberg/408632 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
gemish() {
check_gem() {
if [ -n "$2" ]; then
gem list $1 | grep "^$1 " | grep -q "\($2\)"
else
gem list $1 | grep -q "^$1 "
fi
}
install_gem() {
cmd="gem install --user-install --no-ri --no-rdoc $1"
if [ -n "$2" ]; then
$cmd --version $2
else
$cmd
fi
}
if check_gem $1 $2; then
echo "gemish: exists: $1 $2"
else
echo "gemish: installing: $1 $2"
install_gem $1 $2
fi
}
gemish json 1.4.3
gemish sinatra 1.0
gemish bcrypt-ruby 2.1.2
gemish twitter 0.9.4
gemish rest-client 1.5.0
gemish typhoeus 0.1.27
gemish json 1.2.4
gemish redis 1.0.7
gemish resque 1.8.2
gemish flickr_fu 0.3.0
gemish twitter 0.9.5
gemish bcrypt-ruby 2.1.2
gemish pony 1.0
gemish mini_fb 1.0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment