File tree 3 files changed +90
-0
lines changed
3 files changed +90
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Simple demo Rakefile to autorun samples in current directory
2
+ # adjust path to rp5 executable, and or opts as required
3
+
4
+ SAMPLES_DIR = './'
5
+
6
+ desc 'run demo'
7
+ task default : [ :demo ]
8
+
9
+ desc 'demo'
10
+ task :demo do
11
+ samples_list . shuffle . each { |sample | run_sample sample }
12
+ end
13
+
14
+ def samples_list
15
+ files = [ ]
16
+ Dir . chdir ( SAMPLES_DIR )
17
+ Dir . glob ( '*.rb' ) . each do |file |
18
+ files << File . join ( SAMPLES_DIR , file )
19
+ end
20
+ return files
21
+ end
22
+
23
+ def run_sample ( sample_name )
24
+ puts "Running #{ sample_name } ...quit to run next sample"
25
+ open ( "|jruby #{ sample_name } " , 'r' ) do |io |
26
+ while l = io . gets
27
+ puts ( l . chop )
28
+ end
29
+ end
30
+ end
Original file line number Diff line number Diff line change
1
+ # Simple demo Rakefile to autorun samples in current directory
2
+ # adjust path to rp5 executable, and or opts as required
3
+
4
+ SAMPLES_DIR = './'
5
+
6
+ desc 'run demo'
7
+ task default : [ :demo ]
8
+
9
+ desc 'demo'
10
+ task :demo do
11
+ samples_list . shuffle . each { |sample | run_sample sample }
12
+ end
13
+
14
+ def samples_list
15
+ files = [ ]
16
+ Dir . chdir ( SAMPLES_DIR )
17
+ Dir . glob ( '*.rb' ) . each do |file |
18
+ files << File . join ( SAMPLES_DIR , file )
19
+ end
20
+ return files
21
+ end
22
+
23
+ def run_sample ( sample_name )
24
+ puts "Running #{ sample_name } ...quit to run next sample"
25
+ open ( "|jruby #{ sample_name } " , 'r' ) do |io |
26
+ while l = io . gets
27
+ puts ( l . chop )
28
+ end
29
+ end
30
+ end
Original file line number Diff line number Diff line change
1
+ # Simple demo Rakefile to autorun samples in current directory
2
+ # adjust path to rp5 executable, and or opts as required
3
+
4
+ SAMPLES_DIR = './'
5
+
6
+ desc 'run demo'
7
+ task default : [ :demo ]
8
+
9
+ desc 'demo'
10
+ task :demo do
11
+ samples_list . shuffle . each { |sample | run_sample sample }
12
+ end
13
+
14
+ def samples_list
15
+ files = [ ]
16
+ Dir . chdir ( SAMPLES_DIR )
17
+ Dir . glob ( '*.rb' ) . each do |file |
18
+ files << File . join ( SAMPLES_DIR , file )
19
+ end
20
+ return files
21
+ end
22
+
23
+ def run_sample ( sample_name )
24
+ puts "Running #{ sample_name } ...quit to run next sample"
25
+ open ( "|jruby #{ sample_name } " , 'r' ) do |io |
26
+ while l = io . gets
27
+ puts ( l . chop )
28
+ end
29
+ end
30
+ end
You can’t perform that action at this time.
0 commit comments