Permalink
Browse files

add a Rake task to release the project

  • Loading branch information...
1 parent 190e37b commit 9a9e35849d2ff730d44dcbd8fd30af7a25e12c7a @senny committed Feb 10, 2013
Showing with 24 additions and 0 deletions.
  1. +24 −0 Rakefile
View
@@ -0,0 +1,24 @@
+desc "create a new release"
+task 'release' do
+ current_version = run('git tag').split(/\n/).last.strip
+ puts "What version do you want to release? (current: #{current_version})"
+ version = STDIN.gets.strip
+ version_tag = "v%s" % version
+
+ if run('git tag').split(/\n/).include?(version_tag)
+ raise("This tag has already been committed to the repo.")
+ end
+
+ rbenv_contents = File.read('rbenv.el')
+ File.write('rbenv.el', rbenv_contents.gsub("Version: #{current_version}", "Version: #{version}"))
+
+ run "git commit -a -m \"prepare #{version}\""
+
+ run "git tag -a -m \"Version #{version}\" #{version_tag}"
+ run "git push origin"
+ run "git push origin --tags"
+end
+
+def run(command)
+ `#{command}`
+end

0 comments on commit 9a9e358

Please sign in to comment.