meh` changed the topic of #opal to: http://opalrb.org - Ruby runtime and library on top of Javascript | 1.0.0 is near | This channel is logged at https://botbot.me/freenode/opal/
<krainboltgreene> *nods*
cantonic has joined #opal
ylluminarious has joined #opal
cpup has joined #opal
<ylluminarious> hi everyone. i was reading this article: http://spin.atomicobject.com/2013/11/05/opal-ruby-browser/ and saw this this piece of code repeated over and over again in the `PIXI` module's classes (with only variations in what class the code was in): https://gist.github.com/2d5f577fcb30f0b0bcda
<ylluminarious> what i'm wondering is what this code does, as it looks rather odd and i'm having trouble discerning what it does for this `PIXI` module's classes
CoderPuppy has quit [Ping timeout: 264 seconds]
CoderPuppy_ has joined #opal
cpup has quit [Ping timeout: 264 seconds]
<meh`> ylluminarious, it looks like a hack to bridge the native class to the class being defined
<meh`> he should be really doing class Texture < `PIXI.Texture` instead
<ylluminarious> huh. ok, that makes sense.
<ylluminarious> i'll try doing `class Texture < PIXI.Texture` and see if it works
<meh`> ylluminarious, the ` are important around PIXI.Texture
<meh`> also it may not work properly until I finish working on my native briding rewrite
<ylluminarious> oh, alright
<ylluminarious> the backticks are used to embed javascript, right? i assume that's why they're important for `PIXI.Texture`
<meh`> ylluminarious, yes
<meh`> you're basically passing a function as the super class
<ylluminarious> yeah
<meh`> and it makes the native briding code kick off
<ylluminarious> ok, interesting. what does the native briding code do?
<meh`> it's the magic that makes most core classes work with native objects
<meh`> Array, String and friends are native bridged classes
<ylluminarious> ah, ok. that's interesting.
<ylluminarious> alright, i'll this and see if it works.
<ylluminarious> meh`, thanks
<meh`> np
e_dub has quit [Quit: e_dub]
e_dub has joined #opal
mraudio106 has joined #opal
<mraudio106> test... hello
<mraudio106> trying freenode vs kiwi...
<meh`> hello
<mraudio106> hey
mraudio106 has left #opal [#opal]
cpup has joined #opal
CoderPuppy_ has quit [Ping timeout: 252 seconds]
ylluminarious_ has joined #opal
ylluminarious` has joined #opal
meh` has quit [Ping timeout: 264 seconds]
cpup has quit [Ping timeout: 264 seconds]
cpup has joined #opal
ylluminarious has quit [Ping timeout: 245 seconds]
ylluminarious_ has quit [Ping timeout: 245 seconds]
ylluminarious has joined #opal
ylluminarious` has quit [Ping timeout: 260 seconds]
ylluminarious has quit [Ping timeout: 240 seconds]
godd2 has quit [Remote host closed the connection]
elia has joined #opal
cantonic has quit [Read error: Connection reset by peer]
cantonic has joined #opal
cantonic has quit [Read error: Connection reset by peer]
cantonic has joined #opal
Werdeers has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
cpup has quit [Ping timeout: 256 seconds]
cpup has joined #opal
meh` has joined #opal
ylluminarious has joined #opal
e_dub has quit [Quit: e_dub]
f-3r has joined #opal
f-3r has quit [Client Quit]
elia has quit [Quit: (IRC Client: textualapp.com)]
f-3r has joined #opal
f-3r has quit [Client Quit]
cantonic has quit [Ping timeout: 264 seconds]
f-3r has joined #opal
f-3r has quit [Read error: Connection reset by peer]
f-3r has joined #opal
e_dub has joined #opal
elia has joined #opal
Werdeers has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Werdeers has joined #opal
Werdeers_ has joined #opal
Werdeers has quit [Client Quit]
Werdeers_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
godd2 has joined #opal
<godd2> Good morning all
<meh`> morning
elia has quit [Quit: Computer has gone to sleep.]
<godd2> Opal gets mad at me if I try to require files inside an each block: https://gist.github.com/nicklink483/a88b6ad1ba492eb576f8
<meh`> godd2, yeah, you can't
<godd2> I figured as much, I just wanted to make sure, thanks :)
<meh`> godd2, requires are handled at compile time
<meh`> godd2, you can use require_tree
<meh`> I think
<meh`> elia worked on that
<godd2> awesome, I will look into that
<godd2> perfect, that solved my problem
<meh`> cool
<meh`> godd2, also if you're wonderingm, autoload IS supported
<godd2> I didn't even know what autoload did. Thank you
CoderPuppy has joined #opal
cpup has quit [Ping timeout: 264 seconds]
meh` has quit [Ping timeout: 256 seconds]
e_dub has quit [Quit: e_dub]
meh` has joined #opal
cpup has joined #opal
CoderPuppy has quit [Ping timeout: 272 seconds]
[spoiler] has joined #opal
f-3r has quit [Ping timeout: 250 seconds]
CoderPuppy has joined #opal
f-3r has joined #opal
cpup has quit [Ping timeout: 265 seconds]
ceej_irccloud has quit [*.net *.split]
adambeynon_ has quit [*.net *.split]
lacrosse__ has quit [*.net *.split]
pmarreck has quit [*.net *.split]
CoderPuppy has quit [*.net *.split]
bcavileer_ has quit [*.net *.split]
meh` has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
pebble` has quit [*.net *.split]
[o__o] has quit [*.net *.split]
boberetezeke-clo has quit [*.net *.split]
ylluminarious has quit [*.net *.split]
Zackio has quit [*.net *.split]
godd2 has quit [*.net *.split]
Liothen has quit [*.net *.split]
brixen has quit [*.net *.split]
harrow has quit [*.net *.split]
krainboltgreene has quit [*.net *.split]
wasnotrice has quit [*.net *.split]
f-3r has quit [*.net *.split]
Kilo`byte has quit [*.net *.split]
_whitelogger has joined #opal
meh` has quit [Quit: I don't want to live on this planet anymore.]
e_dub has joined #opal
f-3r has quit [Ping timeout: 250 seconds]
<krainboltgreene> Opal.modules #=> undefined
<krainboltgreene> Is that supposed to happen?
<krainboltgreene> Although I think I know the problem.
ylluminarious has quit [Ping timeout: 272 seconds]
<krainboltgreene> Hmm, nope.
<[spoiler]> krainboltgreene: whatcha trying to do?
<krainboltgreene> I'm running 0.7.3beta3 gem, and trying to run my script.
<krainboltgreene> But I'm running into an error because apparently Opal.modules doesn't exist.
<krainboltgreene> I thought it might be because I'm using /current/opal.js
<[spoiler]> Hmm, could you paste the code which produces the error?
cpup has joined #opal
CoderPuppy has quit [Ping timeout: 244 seconds]
meh` has joined #opal
<krainboltgreene> [spoiler]: Sure, here:
<krainboltgreene> Opal.modules["hacklife/null/player"] = function(Opal) {
<[spoiler]> I'm confused.
<meh`> can I help?
<[spoiler]> I meant the full ruby code which generated the error :P
<meh`> krainboltgreene, no, it shouldn't be undefined
<meh`> krainboltgreene, did you recompile your code?
<krainboltgreene> Oh!
<krainboltgreene> I reran the build thingy, yes.
<meh`> are you 100% confident the runtime and corelib are getting loaded before your script?
<krainboltgreene> The javascript script or the ruby script?
<meh`> the opal.js
<krainboltgreene> `Opal` is defined, so I guess?
<meh`> I don't know how you're deploying things, I'm used to having everything bundled up by sprockets :P
<krainboltgreene> Yes, it is.
<krainboltgreene> JQuery -> Opal.js -> Hacklife.js
<meh`> krainboltgreene, is Opal.gvars undefined as well?
<krainboltgreene> Object {stdout: $IO, stderr: $IO, stdin: $IO, ': NilClass, `: NilClass…}
<meh`> weird
<[spoiler]> erm
<meh`> krainboltgreene, is Opal.breaker undefined?
<krainboltgreene> Could it be that I'm running 0.7.3beta3 gem and current javascript?
<meh`> krainboltgreene, I'm not sure what the current js is pointing to
<krainboltgreene> Error: unexpected break {stack: (...), message: "unexpected break", _klass: OpalClass, $initialize: function, $==: function…}
<meh`> but it seems to be 0.6 if modules is not present
<krainboltgreene> -> /* Generated by Opal 0.6.3 */
<meh`> yep
<meh`> adambeynon_, ^
<krainboltgreene> Is there a way to combine the generation of opal.js with the generation of my script?
<krainboltgreene> Kinda surprised it's not doing that already.
<[spoiler]> are you using bundler?
<krainboltgreene> Yes.
<meh`> krainboltgreene, require opal through sprockets
<[spoiler]> maybe it's locked to version .6.3
<meh`> it should bundle everything up
<meh`> I mean, put a require 'opal' in your ruby
<krainboltgreene> It is.
<meh`> lol
<krainboltgreene> In the rakefile.
<krainboltgreene> My gem file is locking opal to 0.7.3beta.
<meh`> krainboltgreene, no I mean
<meh`> you have to add require 'opal' in your Opal script as well
<krainboltgreene> I'm using the opal.js from the CDN.
<krainboltgreene> Oh.
<[spoiler]> just use the local opal.js the gem provides
<meh`> it will pull in the runtime and corelib as well
<krainboltgreene> Ah.
<meh`> I think it's elia that takes care of the cdn
<adambeynon_> CDN is opal-0.6.3 until 0.7.0 comes out of beta
<krainboltgreene> Yeah, it worked.
<krainboltgreene> I can tell because Atom is choking.
<meh`> adambeynon_, it may be worthwhile to push the beta up there as well?
<krainboltgreene> Woot, it worked.
<adambeynon_> meh`: yes, agree with that
<krainboltgreene> Okay, last question. I've got these classes all defined and whatever. What's the easiest way to play with those classes in the browser console?
<meh`> krainboltgreene, a lot of pain :D
<adambeynon_> krainboltgreene: there is a gem opal-irb if you want a ruby console in the browser
<meh`> I prefer the pain way
<meh`> krainboltgreene, Opal.MyClass.$new()
<krainboltgreene> I mean yes that's kinda cool.
<krainboltgreene> But I meant specifically that.
<meh`> as long as you don't have to work with blocks it's not that painful
<krainboltgreene> What if it's namespaced?
<meh`> krainboltgreene, just go deeper
<meh`> Opal.MyModule.MyClass.MyOtherClass
<krainboltgreene> Gotcha.
<krainboltgreene> That's pretty sweet.
<adambeynon_> meh`: any thoughts on havign docs on our website vs. in the repo and relying on yard/rubydoc
<meh`> adambeynon_, I think general concepts/guides should be on the website
<[spoiler]> guys aaw look https://i.imgur.com/tWRpXIc.gif
<krainboltgreene> Ho hum. Seems like my namespaces classes/modules aren't being defined.
<krainboltgreene> Only Opal.Hacklife is defined.
<krainboltgreene> But they're in the script.
<meh`> krainboltgreene, that's weird
e_dub has quit [Quit: e_dub]
<godd2> are there any plans to add opal-jquery to the CDN?
CoderPuppy has joined #opal
cpup has quit [Ping timeout: 258 seconds]
CoderPuppy has quit [Ping timeout: 256 seconds]
cpup has joined #opal