-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
43 lines (35 loc) · 963 Bytes
/
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
# frozen_string_literal: true
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
require 'rake'
require 'rake/clean'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
require 'yard'
# For code coverage measurements to work properly, `SimpleCov` should be loaded
# and started before any application code is loaded.
desc 'run unit test suite and show code coverage percentage'
task :coverage do
ENV['COVERAGE'] = 'yes'
Rake::Task[:spec].invoke
end
CLEAN.include %w[coverage doc pkg *.gem .yardoc]
RSpec::Core::RakeTask.new(:spec)
LINT_TARGETS = 'lib spec'
desc 'lint project code with rubocop'
task :rubocop do
sh("rubocop #{LINT_TARGETS}")
end
desc 'run rubocop'
task lint: :rubocop
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb']
end
task default: :spec