forked from ruport/ruport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (46 loc) · 1.23 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
51
52
require "rubygems"
require "bundler/setup"
require "rdoc/task"
require "rake/testtask"
require 'bundler/gem_tasks'
task :default => [:test]
Rake::TestTask.new do |test|
test.libs << "test"
if RUBY_VERSION < "1.9"
test.test_files = Dir["test/*_test.rb", "test18/*_test.rb"]
else
test.test_files = Dir[ "test/*_test.rb" ]
end
test.verbose = true
end
RDoc::Task.new do |rdoc|
rdoc.rdoc_files.include( "README.rdoc",
"AUTHORS", "COPYING",
"LICENSE", "lib/" )
rdoc.main = "README.rdoc"
rdoc.rdoc_dir = "doc/html"
rdoc.title = "Ruport Documentation"
end
task :run_benchmarks do
files = FileList["util/bench/**/**/*.rb"]
files.sort!
files.uniq!
names = files.map { |r| r.sub("util/bench","").split("/").map { |e| e.capitalize } }
names.map! { |e| e[1..-2].join("::") + " <BENCH: #{e[-1].sub('Bench_','').sub('.rb','')}>" }
start_time = Time.now
files.zip(names).each { |f,n|
puts "\n#{n}\n\n"
sh "ruby -Ilib #{f}"
puts "\n"
}
end_time = Time.now
puts "\n** Total Run Time: #{end_time-start_time}s **"
end
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |t|
t.test_files = Dir[ "test/*_test.rb" ]
end
rescue LoadError
nil
end