-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
55 lines (44 loc) · 1.27 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
47
48
49
50
51
52
53
54
55
# encoding: utf-8
require 'rubygems'
require 'bundler'
require "rake"
require "rspec"
require "rspec/core/rake_task"
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "hanzi_to_pinyin"
module TempFixForRakeLastComment
def last_comment
last_description
end
end
Rake::Application.send :include, TempFixForRakeLastComment
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
task :build do
system "gem build hanzi_to_pinyin.gemspec"
end
task :install => :build do
system "sudo gem install hanzi_to_pinyin-#{HanziToPinyin::VERSION}.gem"
end
task :release => :build do
puts "Tagging #{HanziToPinyin::VERSION}..."
system "git tag -a #{HanziToPinyin::VERSION} -m 'Tagging #{HanziToPinyin::VERSION}'"
puts "Pushing to Github..."
system "git push --tags"
puts "Pushing to rubygems.org..."
system "gem push hanzi_to_pinyin-#{HanziToPinyin::VERSION}.gem"
end
Rspec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end
Rspec::Core::RakeTask.new('spec:progress') do |spec|
spec.rspec_opts = %w(--format progress)
spec.pattern = "spec/**/*_spec.rb"
end
task :default => :spec
task :test => :spec