These are chat archives for opal/opal

May 2016
John Munyi
May 11 2016 06:34
hello guys here .... hoping to solve all my js problems
Martin Becker
May 11 2016 07:09
@catmando there is a better way
have a single ERB file that has the following:
<%= MyGemConfig.render %>
and then have a class like this:
Martin Becker
May 11 2016 07:25
class MyGemConfig
  class << self

    def set_config_class_name_to value
      @class_name = value

    def add_value value
      @values||= []
      @values << value

    def render
      @rendered||= {|value| "#{ get_class_name }.value = #{render_value(value)}" }.join("\n")


    def get_class_name
      @class_name || 'MyGemConfig'

    def render_value value
      if  value.is_a? String
      elsif value.is_a? Array
      else value.is_a? Hash
        "{}#{{|k,v|"'#{k}' => #{render_value(v)}"}.join(',')}}"
it should re-render every time the server is booted
Martin Becker
May 11 2016 07:47
btw, is there an opal-electron package?
Jamie Gaskins
May 11 2016 14:26
@Thermatix This might help get you started:
Martin Becker
May 11 2016 16:46
AH, an example app, interesting
second question, is there a link to some documentation that properly explainsNative?
Martin Becker
May 11 2016 16:52
@catmando the main point is to have it re-render every time the application is booted, ofc it's re-rendered every time the file is pulled so My suggestion would be to instead render and store an ERB fragment in memory and then some out point to that instead of an actual file.
Martin Becker
May 11 2016 17:38
oh and thanks @jgaskins , it gave me a lot to think about
Zak Storer
May 11 2016 22:56
How well does opal work for writing plugins for the text editor? <-- this is what I've found thus far
My apologies for the gist on channel, I only meant to link to it.
(I'm still getting used to Gitter)
Brady Wied
May 11 2016 23:04
@zacts - Probably relates to the functionality that the --no-opal-exit command line flag to the opal binary controls
@zacts - FYI, we're talking about extracting a single, bootstrap friendly NPM package for opal here - have been too busy to act on it
@zacts - re: no opal exit, I actually looked at your gist and it might be as simple as missing require 'opal'