View default.gembox
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" |
View gist:5d3ee2bd59354955e30e
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] |