File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,16 +12,12 @@ task :demo do
1212end
1313
1414def samples_list
15- files = [ ]
1615 Dir . chdir ( SAMPLES_DIR )
17- Dir . glob ( '*.rb' ) . each do |file |
18- files << File . join ( SAMPLES_DIR , file )
19- end
20- return files
16+ Dir . glob ( '*.rb' ) . map { |file | File . join ( SAMPLES_DIR , file ) }
2117end
2218
2319def run_sample ( sample_name )
24- puts " Running #{ sample_name } ...quit to run next sample"
20+ puts format ( ' Running %s ...quit to run next sample' , sample_name )
2521 open ( "|rp5 run #{ sample_name } " , 'r' ) do |io |
2622 while l = io . gets
2723 puts ( l . chop )
Original file line number Diff line number Diff line change @@ -12,16 +12,12 @@ task :demo do
1212end
1313
1414def samples_list
15- files = [ ]
1615 Dir . chdir ( SAMPLES_DIR )
17- Dir . glob ( '*.rb' ) . each do |file |
18- files << File . join ( SAMPLES_DIR , file )
19- end
20- return files
16+ Dir . glob ( '*.rb' ) . map { |file | File . join ( SAMPLES_DIR , file ) }
2117end
2218
2319def run_sample ( sample_name )
24- puts " Running #{ sample_name } ...quit to run next sample"
20+ puts format ( ' Running %s ...quit to run next sample' , sample_name )
2521 open ( "|rp5 --nojruby run #{ sample_name } " , 'r' ) do |io |
2622 while l = io . gets
2723 puts ( l . chop )
Original file line number Diff line number Diff line change @@ -12,16 +12,12 @@ task :demo do
1212end
1313
1414def samples_list
15- files = [ ]
1615 Dir . chdir ( SAMPLES_DIR )
17- Dir . glob ( '*.rb' ) . each do |file |
18- files << File . join ( SAMPLES_DIR , file )
19- end
20- return files
16+ Dir . glob ( '*.rb' ) . map { |file | File . join ( SAMPLES_DIR , file ) }
2117end
2218
2319def run_sample ( sample_name )
24- puts " Running #{ sample_name } ...quit to run next sample"
20+ format ( ' Running %s ...quit to run next sample' , sample_name
2521 open ( "|rp5 run #{ sample_name } " , 'r' ) do |io |
2622 while l = io . gets
2723 puts ( l . chop )
Original file line number Diff line number Diff line change @@ -12,16 +12,12 @@ task :demo do
1212end
1313
1414def samples_list
15- files = [ ]
1615 Dir . chdir ( SAMPLES_DIR )
17- Dir . glob ( "*.rb" ) . each do |file |
18- files << File . join ( SAMPLES_DIR , file )
19- end
20- return files
16+ Dir . glob ( '*.rb' ) . map { |file | File . join ( SAMPLES_DIR , file ) }
2117end
2218
2319def run_sample ( sample_name )
24- puts " Running #{ sample_name } ...quit to run next sample"
20+ puts format ( ' Running %s ...quit to run next sample' , sample_name )
2521 open ( "|rp5 --nojruby run #{ sample_name } " , "r" ) do |io |
2622 while l = io . gets
2723 puts ( l . chop )
You can’t perform that action at this time.
0 commit comments