-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
98 lines (67 loc) · 1.69 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# frozen_string_literal: true
require 'rake/clean'
# The default task
desc 'Run the same tasks that the CI build will run'
if RUBY_PLATFORM == 'java'
task default: %w[spec rubocop bundle:audit build]
else
task default: %w[spec rubocop yard yard:audit yard:coverage bundle:audit build]
end
# RSpec
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
CLEAN << 'coverage'
CLEAN << '.rspec_status'
CLEAN << 'rspec-report.xml'
# Bundler Audit
require 'bundler/audit/task'
Bundler::Audit::Task.new
# Bundler Gem Build
require 'bundler'
require 'bundler/gem_tasks'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
warn e.message
warn 'Run `bundle install` to install missing gems'
exit e.status_code
end
CLEAN << 'pkg'
CLOBBER << 'Gemfile.lock'
# Bump
require 'bump/tasks'
# Rubocop
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |t|
t.options = %w[
--format progress
--format json --out rubocop-report.json
]
end
CLEAN << 'rubocop-report.json'
unless RUBY_PLATFORM == 'java'
# YARD
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = %w[lib/**/*.rb examples/**/*]
t.stats_options = ['--list-undoc']
end
CLEAN << '.yardoc'
CLEAN << 'doc'
# Yardstick
desc 'Run yardstick to show missing YARD doc elements'
task :'yard:audit' do
sh "yardstick 'lib/**/*.rb'"
end
# Yardstick coverage
require 'yardstick/rake/verify'
Yardstick::Rake::Verify.new(:'yard:coverage') do |verify|
verify.threshold = 100
end
# Publish YARD documentation to GitHub
require 'github_pages_rake_tasks'
GithubPagesRakeTasks::PublishTask.new do |task|
# task.doc_dir = 'documentation'
task.verbose = true
end
end