forked from pmq20/ruby-packer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
40 lines (31 loc) · 787 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
require "rake/testtask"
require "rake/clean"
task default: %w[test]
rubyc_deps = FileList[
__FILE__,
"bin/rubyc",
"lib/**/*.rb",
"ruby/**/*",
"vendor/**/*",
]
desc "build rubyc"
file "rubyc" => rubyc_deps do
# don't include rubyc in rubyc
rm_f "rubyc"
ruby "bin/rubyc", "bin/rubyc", "-o", "rubyc"
end
CLEAN << "rubyc"
namespace "rubyc" do
rubyc_original_ruby_env = {
"ENCLOSE_IO_ALWAYS_USE_ORIGINAL_RUBY" => "1",
"ENCLOSE_IO_USE_ORIGINAL_RUBY" => "1",
}
desc "run irb from inside rubyc"
task irb: "rubyc" do
sh rubyc_original_ruby_env, "./rubyc", "/__enclose_io_memfs__/bin/irb"
end
desc "run ruby -e from inside rubyc"
task :ruby, [:e] => "rubyc" do |_, args|
sh rubyc_original_ruby_env, "./rubyc", "-e", args[:e]
end
end