This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathRakefile
79 lines (65 loc) · 1.52 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
require 'yaks'
require 'yaks-html'
require 'yaks-sinatra'
require 'yaks-transit'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'rubygems/package_task'
require 'yard'
def delegate_task(gem, task_name)
task task_name do
chdir gem.to_s do
sh "rake", task_name.to_s
end
end
end
[:yaks, :"yaks-html", :"yaks-sinatra"].each do |gem|
namespace gem do
desc 'Run rspec'
delegate_task gem, :rspec
desc 'Build gem'
delegate_task gem, :gem
desc 'Generate YARD docs'
delegate_task gem, :yard
desc 'push gem to rubygems'
task :push => "#{gem}:gem" do
sh "gem push pkg/#{gem}-#{Yaks::VERSION}.gem"
end
end
end
desc "Tag current release and push to Github"
task :tag do
sh "git tag v#{Yaks::VERSION}"
sh "git push --tags"
end
desc "Tag, build, and push all gems to rubygems.org"
task :push_all => [
:tag,
"yaks:gem",
"yaks-html:gem",
"yaks-sinatra:gem",
"yaks:push",
"yaks-html:push",
"yaks-sinatra:push"
]
task :push => :push_all
desc "Run all the tests"
task :rspec => ["yaks:rspec", "yaks-html:rspec", "yaks-sinatra:rspec"]
desc 'Run mutation tests'
delegate_task :yaks, :mutant
desc "Start a console"
task :console do
require 'irb'
require 'irb/completion'
ARGV.clear
IRB.start
end
task :ataru do
require "ataru"
Dir.chdir("yaks")
Ataru::CLI::Application.start(["check", "README.md"])
end
RuboCop::RakeTask.new do |task|
task.options << '--display-cop-names'
end
task :default => [:rspec, :rubocop]