-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
45 lines (38 loc) · 1.18 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
require "bundler/gem_tasks"
require 'rake/clean'
require 'rspec/core/rake_task'
#require 'ruby-debug'
CLEAN << "testproject"
desc "Run specs"
RSpec::Core::RakeTask.new(:spec, :focus) do |t, args|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
if args[:focus] then
usetags="--tag #{args[:focus]}"
else
usetags="--tag ~exp"
end
t.rspec_opts = [usetags,
" -fd -fd --out ./testresults/wortsammler_testresults.log -fh --out ./testresults/wortsammler_testresults.html"]
# Put spec opts in a file named .rspec in root
end
desc "Generate code coverage"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
desc "create documentation"
task :doc do
sh "bin/wortsammler -bi README.md"
sh "bin/wortsammler -bi changelog.md"
sh "yard --markup markdown doc ."
end
desc "get the default stylefiles from pandoc"
task :getpandocstyles do
[:latex, :docx, :html, :epub].each{|format |sh "pandoc -D #{format} > resources/pandocdefault.#{format}"}
end
desc "run tests"
task :test => [:clean, :spec]
task :default do
sh "rake -T"
end