Sha256: 9ee963e57c0bd61584e23d2ec0a72f5a43a5e346054263dd7d4515c9fc382894
Contents?: true
Size: 682 Bytes
Versions: 5
Compression:
Stored size: 682 Bytes
Contents
# encoding: utf-8 # frozen_string_literal: true # Simple demo Rakefile to autorun samples in current directory # adjust path to jruby-complete, 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 -S propane --run #{sample_name}", 'r') do |io| while l = io.gets puts(l.chop) end end end
Version data entries
5 entries across 5 versions & 1 rubygems