Skip to content

Commit c822c5f

Browse files
author
monkstone
committed
tune Rakegfile
1 parent 5b88aa5 commit c822c5f

4 files changed

Lines changed: 8 additions & 24 deletions

File tree

samples/contributed/Rakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ task :demo do
1212
end
1313

1414
def 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) }
2117
end
2218

2319
def 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)

samples/processing_app/library/vecmath/vec2d/Rakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ task :demo do
1212
end
1313

1414
def 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) }
2117
end
2218

2319
def 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)

samples/processing_app/library/vecmath/vec3d/Rakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ task :demo do
1212
end
1313

1414
def 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) }
2117
end
2218

2319
def 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)

samples/processing_app/topics/shaders/Rakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ task :demo do
1212
end
1313

1414
def 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) }
2117
end
2218

2319
def 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)

0 commit comments

Comments
 (0)