-
Notifications
You must be signed in to change notification settings - Fork 6
/
Rakefile
32 lines (29 loc) · 827 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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