Skip to content

Instantly share code, notes, and snippets.

View gist:5d3ee2bd59354955e30e
"app.rb"
[1, 2, 3].each { |a| puts a }
"ruby2js.rb"
#!/usr/bin/ruby
# encoding: utf-8
require 'opal'
ruby_file = ARGV[0]
View default.gembox
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"