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 11# 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
44
5- SAMPLES_DIR = './'
5+ SAMPLES_DIR = "./"
6+ ARGS = '-J-XX:InlineSmallCode=500 -J-Xms256m -J-Xmx2g -J-XX:NewSize=64m -J-XX:MaxNewSize=64m'
67
78desc 'run demo'
8- task default : [ :demo ]
9+ task :default => [ :demo ]
910
1011desc 'demo'
1112task :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 }
1414end
1515
1616def samples_list
1717 files = [ ]
1818 Dir . chdir ( SAMPLES_DIR )
19- Dir . glob ( ' *.rb' ) . each do |file |
19+ Dir . glob ( " *.rb" ) . each do |file |
2020 files << File . join ( SAMPLES_DIR , file )
2121 end
2222 return files
2323end
2424
2525def run_sample ( sample_name )
2626 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 |
2828 while l = io . gets
2929 puts ( l . chop )
3030 end
You can’t perform that action at this time.
0 commit comments