File: Rakefile

package info (click to toggle)
ruby-warning 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: ruby: 754; makefile: 4
file content (50 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download
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 test/test_warning.rb"
end

desc "Run tests with frozen Warning"
task :test_freeze do
  sh "#{FileUtils::RUBY} -w 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-nouveau'
  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