forked from flyerhzm/chinese_pinyin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
46 lines (38 loc) · 1.16 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "bundler"
Bundler.setup
require "rake"
require 'rake/testtask'
require "rdoc/task"
require "chinese_pinyin/version"
task :build do
system "gem build chinese_pinyin.gemspec"
end
task :install => :build do
system "sudo gem install chinese_pinyin-#{ChinesePinyin::VERSION}.gem"
end
task :release => :build do
puts "Tagging #{ChinesePinyin::VERSION}..."
system "git tag -a #{ChinesePinyin::VERSION} -m 'Tagging #{ChinesePinyin::VERSION}'"
puts "Pushing to Github..."
system "git push --tags"
puts "Pushing to rubygems.org..."
system "gem push chinese_pinyin-#{ChinesePinyin::VERSION}.gem"
end
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the chinese_pinyin plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the chinese_pinyin plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ChinesePinyin'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end