Permalink
Browse files

up

  • Loading branch information...
1 parent e5ed012 commit 8a732b787039794aa88fc1c7bf062ce3d3b4c502 @t9md committed Dec 28, 2013
Showing with 32 additions and 0 deletions.
  1. +32 −0 Rakefile
View
@@ -0,0 +1,32 @@
+desc "zip"
+task :zip do
+ version = File.read("VERSION").chomp
+ dirname = File.basename( File.dirname(File.expand_path(__FILE__)))
+ zipname = "#{dirname}-#{version}.zip"
+ sh "zip -r #{zipname} README.md autoload doc plugin -x doc/tags"
+end
+
+desc "release"
+task :release => [:tag, :zip]
+
+desc "tag"
+task :tag do
+ version = File.read("VERSION").chomp
+ ver_s = "v#{version}"
+ sh "git tag -a #{ver_s} -m '#{ver_s}'"
+ sh "git push -u origin master #{ver_s}"
+end
+
+desc "versub"
+task :versub do
+ version = File.read("VERSION").chomp
+ files = Dir.glob('{doc,autoload,plugin}/**').select do |f|
+ File.file? f
+ end
+ files.delete('doc/tags')
+ files.each do |fname|
+ lines = File.readlines(fname)
+ lines.map! { |l| l.sub(/Version: (.*)/, "Version: #{version}") }
+ File.open(fname,'w') {|f| f.puts lines }
+ end
+end

0 comments on commit 8a732b7

Please sign in to comment.