forked from michaelherold/sidekiq-global_id
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
78 lines (60 loc) · 1.63 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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"
# Defines a Rake task if the optional dependency is installed
#
# @return [nil]
def with_optional_dependency
yield if block_given?
rescue LoadError # rubocop:disable Lint/SuppressedException
end
default = %w[test]
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/sidekiq/global_id/**/*_test.rb"]
end
namespace :test do
task :integration do
FileList["test/integration/**/*_test.rb"].each do |file|
suite = File.basename(file).sub("_test.rb", "")
sh "SUITE=#{suite} ruby #{file}"
end
end
end
with_optional_dependency do
require "inch/rake"
Inch::Rake::Suggest.new(:inch)
default << "inch"
end
with_optional_dependency do
require "rubocop/rake_task"
RuboCop::RakeTask.new(:rubocop)
default << "rubocop"
end
with_optional_dependency do
require "yard-doctest"
task "yard:doctest" do
sh "yard doctest"
end
default << "yard:doctest"
end
with_optional_dependency do
require "yard/rake/yardoc_task"
YARD::Rake::YardocTask.new(:yard)
default << "yard"
end
with_optional_dependency do
require "yardstick/rake/measurement"
options = YAML.load_file(".yardstick.yml")
Yardstick::Rake::Measurement.new("yardstick:measure", options) do |measurement|
measurement.output = "coverage/docs.txt"
end
require "yardstick/rake/verify"
options = YAML.load_file(".yardstick.yml")
Yardstick::Rake::Verify.new("yardstick:verify", options) do |verify|
verify.threshold = 100
end
task yardstick: %i[yardstick:measure yardstick:verify]
end
task default: default