-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
51 lines (42 loc) · 1008 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
51
#
# test task
#
require 'rake/testtask'
Rake::TestTask.new :test do |t|
t.pattern = "test/*.rb"
t.warning = true
end
task default: :test
#
# demo tasks
#
if ENV['RUBYOPT'].nil? or ENV['RUBYOPT'].empty?
flags = ['-I', File.join(__dir__, 'lib')]
else
flags = nil # subprocesses will have RUBYOPT
end
# create a rake task to run each script in demo/
Dir['demo/*.rb'].each { |demo_path|
name = File.basename(demo_path, '.rb')
desc "Run #{demo_path}"
task(name) { ruby *flags, demo_path }
}
# jruby / truffleruby lack fiber_scheduler, Ractor, and Process#fork
desc "Run JVM compatible demos"
task jvm_demo: [:serial, :fiber, :thread]
desc "Run all demos"
task demo: [:serial, :fiber, :fiber_scheduler,
:thread, :ractor, :process_pipe, :process_socket]
#
# release tasks
#
begin
require 'buildar'
Buildar.new do |b|
b.gemspec_file = 'miner_mover.gemspec'
b.version_file = 'VERSION'
b.use_git = true
end
rescue LoadError
# warn "buildar tasks unavailable"
end