These are chat archives for opal/opal

11th
Feb 2017
Mitch VanDuyn
@catmando
Feb 11 2017 16:35
@/all can anybody please remind me the procedure to include a gem onto the client (i.e i have a gem that should run fine under opal, and I want to use it another gem) how can my gem tell opal to include the other gem in the assets?
@jgaskins do you know?
Jamie Gaskins
@jgaskins
Feb 11 2017 16:42
@catmando In your server-side Ruby code (probably an initializer if you're on Rails), you can do Opal.use_gem gem_name
Mitch VanDuyn
@catmando
Feb 11 2017 16:43
ahh great hint...
Jamie Gaskins
@jgaskins
Feb 11 2017 16:43
That adds that gem's load paths to Opal's load path.
Mitch VanDuyn
@catmando
Feb 11 2017 16:43
don't want to do it an initializer (I want it just to happen if you use my gem) but that gives me enough to go on!
Jamie Gaskins
@jgaskins
Feb 11 2017 16:43
:+1:
Mitch VanDuyn
@catmando
Feb 11 2017 16:45
seems like it works if you shove that in the server side section of your gem.rb file
:beers: to you