File: Rakefile

package info (click to toggle)
ruby-minitest-hooks 1.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 160 kB
  • sloc: ruby: 608; makefile: 4
file content (48 lines) | stat: -rw-r--r-- 1,062 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
require "rake"
require "rake/clean"

CLEAN.include ["minitest-hooks-*.gem", "rdoc", "coverage"]

desc "Build minitest-hooks gem"
task :package=>[:clean] do |p|
  sh %{#{FileUtils::RUBY} -S gem build minitest-hooks.gemspec}
end

### Specs

desc "Run specs"
task :spec do
  sh %{#{FileUtils::RUBY} #{"-w" if RUBY_VERSION >= '3'} #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} spec/all.rb}
end

desc "Run specs with coverage"
task :spec_cov do
  ENV['COVERAGE'] = '1'
  sh %{#{FileUtils::RUBY} spec/all.rb}
end

task :default=>:spec

### RDoc

desc "Generate rdoc"
task :rdoc do
  rdoc_dir = "rdoc"
  rdoc_opts = ["--line-numbers", "--inline-source", '--title', 'minitest-hooks: around and before_all/after_all/around_all hooks for Minitest']

  begin
    gem 'hanna'
    rdoc_opts.concat(['-f', 'hanna'])
  rescue Gem::LoadError
  end

  rdoc_opts.concat(['--main', 'README.rdoc', "-o", rdoc_dir] +
    %w"README.rdoc CHANGELOG MIT-LICENSE" +
    Dir["lib/**/*.rb"]
  )

  FileUtils.rm_rf(rdoc_dir)

  require "rdoc"
  RDoc::RDoc.new.document(rdoc_opts)
end