Skip to content

Instantly share code, notes, and snippets.

@mistergibson
Last active January 15, 2018 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mistergibson/37f7a3f0afbd19b1d138d1544ca5ac5a to your computer and use it in GitHub Desktop.
Save mistergibson/37f7a3f0afbd19b1d138d1544ca5ac5a to your computer and use it in GitHub Desktop.
This is the .rb file: gxg_bootstrap.rb
________________________________________________________________________
# Require Core Library:
require 'opal/full'
# Require Standard Library:
require 'benchmark'
require 'bigdecimal'
require 'buffer'
require 'base64'
require 'console'
require 'date'
require 'delegate'
require 'enumerator'
require 'erb'
require 'fileutils'
require 'forwardable'
require 'iconv'
require 'json'
require 'js'
require 'observer'
require 'opal-parser'
require 'opal-platform'
require 'ostruct'
require 'pathname'
require 'pp'
require 'promise'
require 'securerandom'
require 'set'
require 'singleton'
require 'stringio'
require 'strscan'
require 'template'
require 'thread'
require 'time'
# opal-browser Integration:
require 'opal-browser'
This is how I compiled it (with local symlink pointing to opal-browser gem dir):
________________________________________________________________________________
opal -I ./opal-browser/opal --gem paggio --compile gxg_bootstrap.rb > ../lib/public/external/gxg_bootstrap.js
@mistergibson
Copy link
Author

Also note: when I just did a compile with '--gem opal-browser' instead of including the two dirs, I'd get 'add_method' undefined for Opal in the Browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment