Skip to content
Browse files

[padrino] Added a bump rake task which accepts a version and regenera…

…tes gemspec and commits the files
  • Loading branch information...
1 parent 4fe081c commit c3d10d1f92a61e33c49733f0181c7deff13c8d17 @nesquena nesquena committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 Rakefile
View
13 Rakefile
@@ -1,3 +1,5 @@
+# rake bump version=X.X.X && rake publish
+
require 'pathname'
require 'rake/clean'
require 'rake/rdoctask'
@@ -89,6 +91,17 @@ task :pdoc => :rdoc do
FileUtils.rm_rf "doc"
end
+desc "Bumps the version number based on given version"
+task :bump, [:version] do |t, args|
+ raise "Please specify version=x.x.x !" unless args.version
+ version_path = File.dirname(__FILE__) + '/padrino-core/lib/padrino-core/version.rb'
+ version_text = File.read(version_path).sub(/VERSION = '[\d\.]+'/, "VERSION = '#{args.version}'")
+ puts "Updating Padrino to version #{args.version}."
+ File.open(version_path, 'w') { |f| f.puts version_text }
+ Rake::Task['gemspec'].invoke
+ Rake::Task['commit'].invoke("Bumped version to #{args.version.to_s}")
+end
+
desc "Release all padrino gems"
task :publish do
puts "Pushing to Gemcutter..."

0 comments on commit c3d10d1

Please sign in to comment.
Something went wrong with that request. Please try again.