-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
63 lines (49 loc) · 1.41 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
53
54
55
56
57
58
59
60
61
62
63
unless Object.const_defined?(:PROJECT_ROOT)
PROJECT_ROOT = File.expand_path(File.dirname(__FILE__))
end
$: << File.join(PROJECT_ROOT, 'lib')
require 'rake/rdoctask'
require 'rake/testtask'
desc 'Run all tests'
task :default => ['test:run']
task :doc => ['doc:rdoc']
task :test => ['test:run']
namespace :doc do
def rdoc_dir
File.join(PROJECT_ROOT, 'doc', 'rdoc')
end
desc 'OSX only: open the RDoc in the default browser'
task :open do
raise 'Run doc:rdoc before doc:show' unless File.exists?(rdoc_dir)
system "open #{File.join(rdoc_dir, 'index.html')}"
end
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = rdoc_dir
rdoc.title = 'Rcal Documentation'
rdoc.template = "doc/jamis_template.rb"
rdoc.rdoc_files.include('lib/**/*.rb', 'init.rb', 'doc/*.rdoc')
rdoc.options << '--line-numbers'
rdoc.options << '--inline-source'
end
end
namespace :test do
def lib_files
FileList.new do |fl|
fl.include File.join(PROJECT_ROOT, 'lib')
fl.include File.join(PROJECT_ROOT, 'test', 'lib')
end
end
def test_files
FileList.new do |fl|
fl.include "#{PROJECT_ROOT}/test/**/*_test.rb"
fl.exclude "#{PROJECT_ROOT}/test/test_helper.rb"
fl.exclude "#{PROJECT_ROOT}/test/lib/**/*.rb"
end
end
desc 'Run all tests'
Rake::TestTask.new(:run) do |t|
t.libs = lib_files
t.test_files = test_files
t.verbose = true
end
end