These are chat archives for opal/opal

May 2015
Forrest Chang
May 15 2015 00:05

@adambeynon how would I get constants in Opal? I tried this, but I get something with a lot of code in it.

  def opal_constants
    constants = []
    $opal_js_object = Native(`Opal`)    # have to make this global right now coz not seen in the each closure w/current opal
    $opal_js_object.each {|k|
      attr = $opal_js_object[k]
      constants << attr


the object with all the code in it looks like this

,[object Object],function slice() { [native code] },function () {
    unique_id += 2;
I'm doing tab completion and thought I'd tackle constants next (I've got method completion off of an irb var)
I use something similar to grab classes, but I only add it to the array if attr.is_a?(Class) which does work
Elia Schito
May 15 2015 00:10
@fkchang have you tried Object.constants?
Forrest Chang
May 15 2015 00:16
This message was deleted
wait, I take it back
@elia - that works, thanks
Elia Schito
May 15 2015 00:18
btw, fun times
apparently I lied for years: opal/opal-rails@f6da4a9
Jared White
May 15 2015 00:30
Hey nice work in the comments @RickCarlino here:
Rick Carlino
May 15 2015 03:52
@jaredcwhite I try to sell Opal and Volt wherever I can ;-) . It really is the future for the community, the more it gets talked about, the more likely people are to try it.
Forrest Chang
May 15 2015 04:08
random thanks to @adambeynon for creating opal. ALso to rest of the opal core team, @meh @elia and I guess now @vais
BTW, opal-irb w/auto complete is pretty sweet so far, maybe can release it tomorrow
Rick Carlino
May 15 2015 04:09
Yeah! You guys are doing a great job. :clap:
May 15 2015 12:43
Excellent post on RF @RickCarlino and yeah, the Opal team is doing a stellar job :+1:
Btw I think we need a Strategies team like we have on Volt (maybe combine them actually as there’s a lot of crossover) - to discuss marketing/promotion etc What do you say @adambeynon @elia and co? I think @fkchang and @RickCarlino @vais and anyone else who’s interested in helping should be added :-)
Forrest Chang
May 15 2015 17:02
@AstonJ I think he's got some points. Rails hasn't the shiny new thing for a while. I would think Opal would help a lot to match the "js on the backend allows the js people to leverage their skills there" argument for Rubyists the other way, but again we have the whole adoption issues I quoted from the Rust critique to address. Ultimately, my opinion, is "if they want Javascript, they can have it." I'm about spreading the joy of Ruby, extended outside of it's traditional place in to the web front end w/Opal, scaling the backend w/Jubliee/vert.x, etc...
Ruby everywhere is an advantage, IMO, so we don't need to conquer the world, just thrive.
Jeremy Evans
May 15 2015 19:30
I've just added pull request #864 which makes tilt/opal able to build opal projects that use require (and probably require_tree) without using sprockets. If anyone could take a look and provide feedback, that would be great.
Jeremy Evans
May 15 2015 20:04
Here's an example of using opal with Roda via tilt:, assuming you are using #864.
Elia Schito
May 15 2015 20:40
@jeremyevans great PR, I'll merge just after the build is fixed
just a quick note on the roda example
this line is probably unnecessary
nevermind, :(
I missed the stub :)
Jeremy Evans
May 15 2015 20:46
@elia Any ideas on why the build is broken on mspec_phantom? It apparently works for mspec_node. I think the relevant error message is "Error: Sprockets::FileNotFound: couldn't find file 'spec_helper' with type 'application/javascript'", but I'm not sure what is causing that or how it is related
Elia Schito
May 15 2015 21:25
@jeremyevans my gut says it has to do with a missing entry in "Opal.paths", or some api change or usage on path readers