Skip to content

Instantly share code, notes, and snippets.

@i-e-b
Created May 24, 2012 15:47
Show Gist options
  • Select an option

  • Save i-e-b/2782328 to your computer and use it in GitHub Desktop.

Select an option

Save i-e-b/2782328 to your computer and use it in GitHub Desktop.
Neat gem checker and installer
function MissingGem($name) {return ((gem list --local) -match "$name").Length -lt 1}
# list gem names:
("vagrant", "bundler") | %{
if (MissingGem($_)) {& "gem install $_"} else {echo "$_ already installed"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment