Skip to content

Instantly share code, notes, and snippets.

MRuby::GemBox.new do |conf|
# Use standard Kernel#sprintf method
conf.gem :core => "mruby-sprintf"
# Use standard print/puts/p
conf.gem :core => "mruby-print"
# Use standard Math module
conf.gem :core => "mruby-math"
"app.rb"
[1, 2, 3].each { |a| puts a }
"ruby2js.rb"
#!/usr/bin/ruby
# encoding: utf-8
require 'opal'
ruby_file = ARGV[0]