-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
65 lines (54 loc) · 1.39 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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "json"
require "bump"
RSpec::Core::RakeTask.new(:spec)
task default: :spec
namespace :yard do
desc "Verify yard syntax"
task :verify do
exec "bundle", "exec", "yardstick", "lib/**/*.rb"
end
desc "Verify yard examples"
task :doctest do
exec "bundle", "exec", "yard", "doctest"
end
desc "Generate yard docs"
task :docs do
exec "bundle", "exec", "yard", "doc", "-o", "docs/"
end
end
desc "Run all specs"
task :rspec do
exec "bundle",
"exec",
"rspec",
"--format",
"RSpec::Github::Formatter",
"--format",
"documentation"
end
desc "Generate coverage report used by the CI"
task :coverage do
coverage_path = Pathname(__dir__).join("coverage/coverage.json")
coverage_data = coverage_path.read
coverage_report = JSON.parse(coverage_data, symbolize_names: true)
puts coverage_report.dig(:metrics, :covered_percent).round(2)
end
desc "Run all specs and generate documentation"
task :rubocop do
exec "bundle", "exec", "rubocop"
end
namespace :gem do
desc "Build and release gem"
task :release do
system "bundle", "exec", "bump", "patch", "--tag"
exec "bundle", "exec", "rake", "release"
end
end
desc "Create profile"
task :profile do
system "bundle", "exec", "ruby", "benchmarks/profile.rb"
exec "stackprof-webnav -d tmp"
end