File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
processing_app/demos/graphics Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
# Simple demo Rakefile to autorun samples in current directory
2
- # excludes planets.rb which needs flag to run
3
- # adjust path to rp5 executable, and or opts as required
2
+ # adjust path to jruby, ARGS, and or opts as required
3
+ # NB: use `-J-` prefix to send java args via jruby
4
4
5
- SAMPLES_DIR = './'
5
+ SAMPLES_DIR = "./"
6
+ ARGS = '-J-XX:InlineSmallCode=500 -J-Xms256m -J-Xmx2g -J-XX:NewSize=64m -J-XX:MaxNewSize=64m'
6
7
7
8
desc 'run demo'
8
- task default : [ :demo ]
9
+ task :default => [ :demo ]
9
10
10
11
desc 'demo'
11
12
task :demo do
12
- list = samples_list . reject { |sample | sample =~ /planets/ }
13
- list . shuffle . each { |sample | run_sample sample }
13
+ samples_list . shuffle . each { |sample | run_sample sample }
14
14
end
15
15
16
16
def samples_list
17
17
files = [ ]
18
18
Dir . chdir ( SAMPLES_DIR )
19
- Dir . glob ( ' *.rb' ) . each do |file |
19
+ Dir . glob ( " *.rb" ) . each do |file |
20
20
files << File . join ( SAMPLES_DIR , file )
21
21
end
22
22
return files
23
23
end
24
24
25
25
def run_sample ( sample_name )
26
26
puts "Running #{ sample_name } ...quit to run next sample"
27
- open ( "|jruby #{ sample_name } " , 'r' ) do |io |
27
+ open ( "|jruby #{ ARGS } #{ sample_name } " , "r" ) do |io |
28
28
while l = io . gets
29
29
puts ( l . chop )
30
30
end
You can’t perform that action at this time.
0 commit comments