Note: For the best performance and application load times, it is strongly recommended to design your application so that it won't need the parser. A lot of methods described in this document are more fun hacks than robust solutions. But if you really want or need to use them, for example so that you can implement a Ruby REPL or an interactive Ruby playground - we have you covered, but for all other cases, we strongly discourage you to take an advice from this guide.
opal-parser provides a partial implementation of
require 'opal-parser' eval "puts 'hello world!'"
Will fetch a remote URL (by means of a sync
XMLHttpRequest) and evaluate its contents as Ruby code.
require 'opal-parser' require_remote 'http://pastie.org/pastes/10444960/text' HelloWorld.new.say_hello!
Opal.compile (Ruby) converting options from a plain JS object to a Ruby Hash.
opal-parser is required it will search the page for any
<script> tag with type
src attribute is present will fetch and eval the file with
Kernel#require_remote otherwise it will get the script tags contents and eval them with