adambeynon 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 http://irclog.whitequark.org/opal
<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
<ivanoats> ryanstout: I teach Rails and some JS at http://codefellows.org
<ivanoats> in Seattle
<ivanoats> and also Ruby / Rails at University of Washington
<ryanstout> cool
<ivanoats> I went in to the JS Bootcamp and totally trolled them with Opal yesterday morning.
<ryanstout> I think I know someone who was thinking about doing code fellows
<ryanstout> funny
DrShoggoth has quit [Quit: Leaving]
<meh`> ryanstout, but even a generated parser would be better than a generated parser in Ruby that's then compiled to javascript, size wise
<meh`> we went that way because it was the easiest and fastest way to have opal-parser
<meh`> I don't think adam would reject the idea of using a native js parser
<ryanstout> isn't there a way to compile ragel to JS?
<ryanstout> nm, googled, guess there isn't
<ryanstout> or nm, opal uses racc
ryanstout has quit [Quit: ryanstout]
ryanstout_ has joined #opal
<meh`> ryanstout_, sincerely I don't think it's worth it, if you're using eval in production you have bigger problems
ryanstout_ has quit [Client Quit]
ryanstout has joined #opal
ryanstout has quit [Client Quit]
fkchang has quit [Ping timeout: 272 seconds]
ryanstout has joined #opal
ryanstout has quit [Client Quit]
meh` has quit [Ping timeout: 248 seconds]
hiddensanctum has joined #opal
<hiddensanctum> hey guys, I was wondering if you could help me with some opal code in rails?
<hiddensanctum> I am trying to use the <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script> inside a js.rb
<hiddensanctum> I've included the script inside my html.erb
<hiddensanctum> and tried to call $$.CryptoJS.AES.encrypt("@message", "@password")
<hiddensanctum> but its telling me encrypt is an undefined method
hiddensanctum has quit [Ping timeout: 260 seconds]
hiddensanctum has joined #opal
hiddensanctum has left #opal [#opal]
DouweM has quit [Ping timeout: 252 seconds]
denysonique has quit [Ping timeout: 252 seconds]
Guest2496 has joined #opal
elia has joined #opal
e_dub has quit [Quit: It's a hard knock life]
GitHub85 has joined #opal
GitHub85 has left #opal [#opal]
<GitHub85> [opal] elia pushed 1 new commit to master: http://git.io/KJTZMw
<GitHub85> opal/master db3fbfe Elia Schito: Add Kernel#pp...
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1440 (master - db3fbfe : Elia Schito): The build passed.
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14014492
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
DouweM has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
Guest2496 is now known as denysonique
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
adambeynon has joined #opal
<adambeynon> meh: Im still having trouble running opal-browser specs
GitHub8 has joined #opal
GitHub8 has left #opal [#opal]
<GitHub8> [opal] adambeynon pushed 1 new commit to master: http://git.io/QgrYMQ
<GitHub8> opal/master f8d7d1d Adam Beynon: Add initial truthy? and falsy? inlined compiler helpers (#419)
<adambeynon> elia: are you a user of factory_girl, or anything similar?
<elia> adambeynon, used to a lot, I also use fabrication
<elia> adambeynon, why?
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1442 (master - f8d7d1d : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14028615
travis-ci has left #opal [#opal]
fkchang has joined #opal
<fkchang> adambeynon: how does one switch to using opal-rspec
<adambeynon> fkchang: these are the changes opal-jquery needed
<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
<adambeynon> load paths, etc
<adambeynon> what files are available
meh` has joined #opal
DouweM_ has quit [Quit: Linkinus - http://linkinus.com]
DouweM has joined #opal
<meh`> adambeynon, yo
<adambeynon> meh`: hi meh`
<adambeynon> not quite sure I needed your name twice there...
<meh`> lol
<meh`> adambeynon, I was thinking about block.call in break
<meh`> I think it's possible to make it work
<meh`> adambeynon, also can you fix yield inside a block please?
<meh`> we have no way to support that right now
elia has quit [Read error: Operation timed out]
<adambeynon> meh`: working on it now
<adambeynon> meh`: if the block takes a block itself, then it must define a &block argument
<adambeynon> otherwise the compiler will assume the block comes from the method wrapping the block
<meh`> yes
<adambeynon> that will be fixed in future, but its too tricky for now
<meh`> I think that's how it works in Ruby
<meh`> yeah
<adambeynon> meh`: ah, thats fine then
<adambeynon> "will do for now"
GitHub175 has joined #opal
<GitHub175> opal/master bbb3551 Adam Beynon: Support yield from inside a block (fixes #379)
GitHub175 has left #opal [#opal]
<GitHub175> [opal] adambeynon pushed 1 new commit to master: http://git.io/OfKx1Q
<adambeynon> meh`: there we go, should do the job
<adambeynon> meh`: also, I have scrapped the 0.5. milestone and moved all issues to 0.6
<adambeynon> will try and get all those done ASAP for a 0.6 release soon
<meh`> awesome
<meh`> I still have some work to do for 0.6
<meh`> I'll try to get it done this weekend
<meh`> all of it String related
<meh`> I removed all specs in spec/core/string
<meh`> and I'm using rubyspecs locally
<meh`> adambeynon, also, would you mind if I pused my current enumerable.rb?
<meh`> it has defs with NotImplementedError for the missing methods
<meh`> it might be useful if some external contributors come
<meh`> instead of having to do what I had to do
<meh`> and go through the list of methods and see which one were missing
<meh`> brb taking out the dog
<adambeynon> meh`: yeh, sounds fine to me. just raise the exception class though, dont use a message
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14033150
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1443 (master - bbb3551 : Adam Beynon): The build passed.
<adambeynon> i.e.
<adambeynon> raise NotImplementedError
ryanstout has joined #opal
<fkchang> meh`: I'd be curious in seeing the require stuff in opal-browser you mentioned to me yesterday
elia has joined #opal
<meh`> fkchang, http://sprunge.us/TSEM
<meh`> adambeynon, yes, that's how it is
<fkchang> meh`: did you add a Kernel#eval somewhere?
<meh`> fkchang, no, it assumes you required opal-parser
<meh`> it comes from there
Jacob_ has joined #opal
<fkchang> meh`: I wrote something for js that inserts the <script src="blah.js"> tag in for asynch loading
<fkchang> any ideas how we'd expand your require_external to be able to pull in a gem?
GitHub170 has joined #opal
<GitHub170> [opal] meh pushed 1 new commit to master: http://git.io/ENfQsQ
GitHub170 has left #opal [#opal]
<GitHub170> opal/master 5303510 meh: Add missing Enumerable methods as not implemented
<meh`> fkchang, how do you mean?
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1444 (master - 5303510 : meh): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14034068
<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.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14035018
<meh`> if you fix that, you can easily fix xstrings too
<adambeynon> meh`: that binary/octal parse error was possibly the control-character shortcuts not parsing:
<adambeynon> ?\M-z
<adambeynon> which are in the same numeric_spec.rb file in rubyspec
Jacob_ has quit [Quit: Page closed]
GitHub0 has joined #opal
<GitHub0> [opal] adambeynon pushed 1 new commit to master: http://git.io/aEeAjw
GitHub0 has left #opal [#opal]
<GitHub0> opal/master 10dce0a Adam Beynon: ScopeNode#in_scope no longer takes scope type as arg
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14036444
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1446 (master - 10dce0a : Adam Beynon): The build passed.
<meh`> adambeynon, oh, I see
GitHub139 has joined #opal
<GitHub139> [opal] adambeynon pushed 2 new commits to master: http://git.io/MJ3Onw
<GitHub139> opal/master a6e65ac Adam Beynon: Cleanup IterNode code generation
<GitHub139> opal/master 9139cf2 Adam Beynon: Extract compiling iter args into seperate method
GitHub139 has left #opal [#opal]
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14037017
<travis-ci> [travis-ci] opal/opal#1447 (master - a6e65ac : Adam Beynon): The build passed.
GitHub56 has joined #opal
<GitHub56> [opal] adambeynon pushed 1 new commit to master: http://git.io/EdhW5w
<GitHub56> opal/master 1be7e68 Adam Beynon: Whitespace
GitHub56 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14037198
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1448 (master - 1be7e68 : Adam Beynon): The build passed.
travis-ci has joined #opal
<travis-ci> [travis-ci] Strech/opal#1 (master - 6838b72 : Strech (Sergey Fedorov)): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/Strech/opal/builds/14037295
travis-ci has left #opal [#opal]
GitHub11 has joined #opal
GitHub11 has left #opal [#opal]
<GitHub11> [opal] adambeynon pushed 1 new commit to master: http://git.io/e3ZEog
<GitHub11> opal/master 5ba458f Adam Beynon: A class should be a kind_of its singleton_class (fixes #438)
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14037735
<travis-ci> [travis-ci] opal/opal#1449 (master - 5ba458f : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
fkchang has quit [Ping timeout: 265 seconds]
fkchang has joined #opal
ivanoats has quit [Quit: IRCRelay - http://ircrelay.com]
ivanoats has joined #opal
ivanoats has quit [Changing host]
ivanoats has joined #opal
ivanoats has quit [Quit: IRCRelay - http://ircrelay.com]
ivanoats has joined #opal