<ivanoats>
thanks fkchang, meh` - but how do I access an object from that script? e.g. CryptoJS.AES
<meh`>
ivanoats, Native(`CryptoJS.AES`)
<ivanoats>
sweet thanks! :-)
<meh`>
ivanoats, alternatively, $$.CryptoJS.AES
<ivanoats>
oooh
<meh`>
whatever you prefer, they're the same
<meh`>
the latter will be a bit slower
<meh`>
also $global.CryptoJS.AES
<meh`>
$$ = $global = Native(`window`)
<ivanoats>
whoah! awesome
<ivanoats>
one of my students did a lighning talk on Opal today, it was sweet!
<meh`>
ivanoats, oh right, you also have to require 'native'
<ivanoats>
definitely gonna blog about it too
<ivanoats>
thanks!
<meh`>
:)
<meh`>
you're welcome
<meh`>
fkchang, anyway, about the opal-irb adding a way to add external files, I have a local change in opal-browser for a require_external
<meh`>
fkchang, I can give you the excerpt of what I have now, and if the passed argument is a remote url, do the addition with the DOM instead of AJAX
<meh`>
fkchang, also add support for opal-parser
<meh`>
fkchang, but yeah, it's something that belongs in opal-browser
<ryanstout>
@ivanoats just curious, when you say students, are you a teacher?
<ryanstout>
so I'm guessing the answer is no, but is there any way to increase the parse time for opal-parser? (loading the actual JS of the parser)
<ryanstout>
^decrease
<meh`>
ryanstout, rewrite the parser in javascript, remove the grammar.y from the compilation, replace with js parser, pass the sexps to the compiler
<ryanstout>
isn't there a JS ruby parser?
<ryanstout>
I thought I remember someone talking about one
<ryanstout>
maybe that was something else
<ryanstout>
I'm sure its a crazy huge task, but would rewriting it in JS smaller? Since you need to output FSA tables either way right?
<meh`>
ryanstout, I was talking about a handwritten parser
<ryanstout>
ok
<ryanstout>
anyway, its not a big deal, normally I wouldn't need the parser
<adambeynon>
basically, rename the rake task, and change the require() file inside spec helper
<adambeynon>
also, rspec doesnt support `be_true` and `be_false` anymore
<adambeynon>
so most of the changes were just updating those to use rspec style matchers
<adambeynon>
(opal-jquery uses 2 rake tasks to support zepto tests as well, so ignore the second one in that file)
<adambeynon>
elia: I use factory_girl quite a lot, and was wondering if an opal port was worth it
<adambeynon>
but I do use vienna::model client tests quite a lot
<elia>
adambeynon, didn't tried any recent vienna model implementation… and I must admit that my clientside MVC experience is very limited
<elia>
especially in regards to models
<elia>
adambeynon, i'd really like to have a look into one of your secret appz :)
<fkchang>
adambeynon: so is vienna switched over to it already?
<adambeynon>
elia: I could probably share one of the bigger ones, at least v1.0 of it
<adambeynon>
Im currently rewriting a second version of it
<adambeynon>
its a really heavy client side mvc app, so there is lots and lots of opal in there
<adambeynon>
v2 will be turbolinks based though, but shouldnt change too much really
<adambeynon>
fkchang: yeap, vienna and opal-jquery both use rspec now, as do all my "real" apps
<fkchang>
ok, so if I pull those I should be able to check that out
<adambeynon>
elia: I will warn you, this app has used opal since the beginning, so there will be lots of ugly code in there :)
<adambeynon>
fkchang: yeap, both are using rspec on master
DouweM_ has joined #opal
<elia>
adambeynon, no worries, right know I'm refactoring some coffeescript…
<adambeynon>
could be worse, it could be dart code ;)
<fkchang>
adambeynon: I wrote a quick js_require() for pulling arbitrary js code into opal-irb (simply inserts a <script> tag into the dom), and thought we should some similar for requiring opal code into opal-irb
<fkchang>
thought u might have some thoughts on that
DouweM has quit [Ping timeout: 260 seconds]
<elia>
adambeynon, to be precise this is js converted to cs… all based on closures and slim arrows
<elia>
…but yeah dart would be worse…
<adambeynon>
fkchang: yep. Would be useful for opalrb.org/try as well for requiring stdlib stuff
<fkchang>
adambeynon: the next for js_require(), would be some sort look up table. Right you need to pass it where it lives, but maybe down the road any js file on cdnjs could be looked up for example. For opal code, not certain how we'd do that, pull compiled js from somewhere, or raw opal and compile in browser (leaning towards this so we can opal-inspector goodness when that's implemented), but need to know where to pull opal code from
<adambeynon>
fkchang: well, if Opal::Server is being used on the backend somewhere, we could expose some special routes that can supply opal-inspector with the information
<fkchang>
meh`: so if we had the source tree to a gem available on the web, require_external("repo/opal-blah"), could load all the files that it includes in, like the normal gem loading. But need some sort of scheme to make that happen
<fkchang>
<meh`>
fkchang, wouldn't it be better to suggest compiling the gem to a single file?
elia has quit [Ping timeout: 264 seconds]
GitHub135 has joined #opal
GitHub135 has left #opal [#opal]
<GitHub135>
opal/master a4c12ba Adam Beynon: Fix super() dispatches on class methods (fixes #405)
<GitHub135>
[opal] adambeynon pushed 1 new commit to master: http://git.io/SR_LWA
<adambeynon>
meh`: that commit fixes the singleton + super bug
<meh`>
awesome
<meh`>
lol, a one line fix
<adambeynon>
meh`: a stupid one line fix. it was always pointing super calls to Class after 1 step
<adambeynon>
which is er...
<adambeynon>
crazy :D
<adambeynon>
or, it was*
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci>
[travis-ci] opal/opal#1445 (master - a4c12ba : Adam Beynon): The build passed.