Skip to content

Instantly share code, notes, and snippets.

@nakajima
Created January 6, 2011 23:35
Show Gist options
  • Select an option

  • Save nakajima/768851 to your computer and use it in GitHub Desktop.

Select an option

Save nakajima/768851 to your computer and use it in GitHub Desktop.
Release whatever gem exists in whatever directory you're in
#!/usr/bin/env ruby
gemspec = Dir['*.gemspec'].first
gemspec || abort("You need to have a gem spec in this directory.")
system("gem build #{gemspec}")
gemfile = Dir['*.gem'].sort.last
system("gem push #{gemfile}") && system("rm #{gemfile}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment