-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
50 lines (38 loc) · 1.19 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
require "rake"
require "rake/clean"
require "rdoc/task"
CLEAN.include ["warning-*.gem", "rdoc"]
desc "Build warning gem"
task :package=>[:clean] do |p|
sh %{#{FileUtils::RUBY} -S gem build warning.gemspec}
end
### Specs
desc "Run tests"
task :test do
sh "#{FileUtils::RUBY} -w #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} test/test_warning.rb"
end
desc "Run tests with frozen Warning"
task :test_freeze do
sh "#{FileUtils::RUBY} -w #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} test/test_freeze_warning.rb"
end
desc "Run tests with coverage"
task :test_cov do
ENV['COVERAGE'] = 'regular'
sh "#{FileUtils::RUBY} -w test/test_warning.rb"
ENV['COVERAGE'] = 'frozen'
sh "#{FileUtils::RUBY} -w test/test_freeze_warning.rb"
end
desc "Run all tests"
task :default=>[:test, :test_freeze]
### RDoc
RDOC_OPTS = ['--main', 'README.rdoc', "--quiet", "--line-numbers", "--inline-source", '--title', 'ruby-warning: Add custom processing for warnings']
begin
gem 'hanna'
RDOC_OPTS.concat(['-f', 'hanna'])
rescue Gem::LoadError
end
RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.options += RDOC_OPTS
rdoc.rdoc_files.add %w"README.rdoc CHANGELOG MIT-LICENSE lib/**/*.rb"
end