Sha256: 496e928e45935b06324e5336c52d3084490ca628b8047846f5721b326cc861d4

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 Bytes

Contents

# Simple demo Rakefile to autorun samples in current directory
# adjust path to rp5 executable, and or opts as required

SAMPLES_DIR = './'

desc 'run demo'
task default: [:demo]

desc 'demo'
task :demo do
  samples_list.shuffle.each { |sample| run_sample sample }
end

def samples_list
  files = []
  Dir.chdir(SAMPLES_DIR)
  Dir.glob('*.rb').each do |file|
    files << File.join(SAMPLES_DIR, file)
  end
  return files
end

def run_sample(sample_name)
  puts "Running #{sample_name}...quit to run next sample"
  open("|jruby #{sample_name}", 'r') do |io|
    while l = io.gets
      puts(l.chop)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
propane-0.8.0-java examples/regular/Rakefile
propane-0.7.0-java examples/regular/Rakefile
propane-0.6.0-java examples/regular/Rakefile
propane-0.5.0-java examples/regular/Rakefile
propane-0.4.0.pre-java examples/regular/Rakefile
propane-0.3.0.pre-java examples/regular/Rakefile