-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
38 lines (31 loc) · 931 Bytes
/
Rakefile
File metadata and controls
38 lines (31 loc) · 931 Bytes
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
# frozen_string_literal: true
require "rake/clean"
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "bundler/gem_tasks"
RSpec::Core::RakeTask.new
RuboCop::RakeTask.new
CLOBBER.include("tmp")
namespace "compile" do
desc ""
task :default do
build
end
desc "Compile obj_ext.bundle into the lib directory with debug enabled"
task :debug do
build("--enable-debug")
end
end
desc "Compile obj_ext.bundle into the lib directory"
task compile: ["compile:default"]
task default: %i[compile spec]
def build(options = "")
tmp = File.expand_path("tmp", __dir__)
FileUtils.mkdir_p(tmp)
FileUtils.chdir(tmp) do
system(Gem.ruby, File.expand_path("ext/obj_ext/extconf.rb", __dir__), options, exception: true)
system("make clean", exception: true)
system("make", exception: true)
system("make install sitearchdir=../lib sitelibdir=../lib target_prefix=", exception: true)
end
end