This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"app.rb" | |
[1, 2, 3].each { |a| puts a } | |
"ruby2js.rb" | |
#!/usr/bin/ruby | |
# encoding: utf-8 | |
require 'opal' | |
ruby_file = ARGV[0] |