forked from Mon-Ouie/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
50 lines (42 loc) · 982 Bytes
/
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
# -*- coding: utf-8 -*-
begin
require 'devkit' # only used on windows
rescue LoadError
end
begin
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'ext/**/*.c']
t.options |= ["--private", "-e", "./yard_ext.rb"]
end
rescue LoadError
$stderr.puts("YARD is not installed. Please install it " +
"with the following command: gem install yard")
end
namespace :ext do
desc "Rebuilds the C extension"
task :rebuild do
cd "ext/"
ruby "extconf.rb" and sh "make clean && make"
end
desc "Builds the C extension"
task :build do
cd "ext/"
ruby "extconf.rb" and sh "make"
end
end
desc "Builds the C extension"
task :ext => ["ext:build"]
desc "Runs tests"
task :test do
test_file = File.expand_path("test/run_all.rb", File.dirname(__FILE__))
begin
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
ruby "-X+O", test_file
else
ruby test_file
end
rescue
exit 1
end
end