-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (31 loc) · 848 Bytes
/
Rakefile
File metadata and controls
39 lines (31 loc) · 848 Bytes
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
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'yard'
# Default task runs tests
task default: :spec
# RSpec task
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '--format documentation --color'
end
# RuboCop task
RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names']
end
desc 'Run all checks (tests and linting)'
task check: %i[spec rubocop]
desc 'Run tests with coverage'
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task['spec'].execute
end
# YARD documentation task
YARD::Rake::YardocTask.new(:docs) do |t|
t.files = ['lib/**/*.rb']
t.options = ['--output-dir=doc', '--readme=README.md', '--markup=markdown', '--no-private']
end
desc 'Open documentation index'
task doc: :docs do
system 'open doc/index.html'
end