-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
40 lines (31 loc) · 829 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
# frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2019-2025 Yegor Bugayenko
# SPDX-License-Identifier: MIT
require 'rubygems'
require 'rake'
require 'rake/clean'
CLEAN = FileList['coverage']
def name
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
end
def version
Gem::Specification.load(Dir['*.gemspec'].first).version
end
task default: %i[clean test rubocop]
require 'rake/testtask'
Rake::TestTask.new do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = false
end
require 'rdoc/task'
RDoc::Task.new do |rdoc|
rdoc.main = 'README.md'
rdoc.rdoc_dir = 'rdoc'
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
end
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |task|
task.fail_on_error = true
task.requires << 'rubocop-rspec'
end