These are chat archives for opal/opal

5th
Mar 2015
Ricardo Mendes
@locks
Mar 05 2015 00:58
hi, is the rubygem the only way to compile ruby code?
I want to integrate opal into a node.js build pipe
Elia Schito
@elia
Mar 05 2015 01:01
@locks you can compile opal-parser and use it inside node to parse on the fly
not that easy working with node require system and modules tho
you need to parse / eval everything in a global context somehow
my advice is to use a rake task if possible
Ricardo Mendes
@locks
Mar 05 2015 01:13
thanks for the advice @elia
now I just need ES6 module support O:)
Elia Schito
@elia
Mar 05 2015 01:20
heh, the real question is how that translates to ruby?
Ricardo Mendes
@locks
Mar 05 2015 01:22
good question
well I mean
you just export everything
that's what Ruby does
Elia Schito
@elia
Mar 05 2015 01:23
I guess it would work
Ricardo Mendes
@locks
Mar 05 2015 01:23
I saw https://github.com/movableink/ember-cli-emscripten and thought of doing something for opalrb
Elia Schito
@elia
Mar 05 2015 01:24
having compiled gems would be really much fun
Ricardo Mendes
@locks
Mar 05 2015 01:25
would be bonkers
Ricardo Mendes
@locks
Mar 05 2015 01:37
in the homepage example thereĀ“s a line user = User.new('Bob'), that user variable isn't accessible in the JS runtime is it?
Elia Schito
@elia
Mar 05 2015 01:40
it is
to see the compiled code live
Ricardo Mendes
@locks
Mar 05 2015 01:41
yeah, the compile code is all inside an iife
Karim Tarek
@karimmtarek
Mar 05 2015 22:06
Hi guys
I'm having hard time convert this
```
```
$('html, body').animate({
#     scrollTop: $(x).offset().top
# }, 1500);
to opal
I tried this
Element['html, body'].animate(scroll_top: Element[x].offset().top, 1500)
but its no good
any advice?
Elia Schito
@elia
Mar 05 2015 23:06
@karimmtarek try with scrollTop instead