Skip to content

Instantly share code, notes, and snippets.

@revans
Created January 28, 2010 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save revans/288960 to your computer and use it in GitHub Desktop.
Save revans/288960 to your computer and use it in GitHub Desktop.
Build a gem, using jeweler, based on a branch.
desc "Install Gem based on a branch (e.g. rake gemify[master] or rake gemify)."
task :gemify, :branch do |task, args|
branch = args[:branch].nil? || args[:branch] == '' ? 'master' : args[:branch]
puts "Going to checkout the #{branch} branch and build the gem for it."
# run commands
`rm -rf package`
`git checkout master`
`git pull origin #{branch}`
`git checkout #{branch}`
`rake build`
`rake install`
# let the user know it is completed
puts "Completed."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment