Skip to content

Instantly share code, notes, and snippets.

@fkchang
Last active May 30, 2017 17:27
Show Gist options
  • Save fkchang/83e02399776f3a1de6a9fd6fe6ef67c5 to your computer and use it in GitHub Desktop.
Save fkchang/83e02399776f3a1de6a9fd6fe6ef67c5 to your computer and use it in GitHub Desktop.
require 'opal'
Dir['src/*.rb'].each { |rb_file|
desc "Build and run #{rb_file}"
basename = File.basename(rb_file, '.rb')
task basename do
puts "Building #{basename}"
system "opal -rconsole -Ec #{rb_file} > #{basename}.js"
puts "\trunning"
system 'say running'
system "node #{basename}.js"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment