These are chat archives for opal/opal

13th
Jul 2015
Elia Schito
@elia
Jul 13 2015 07:48
@Angelmmiguel can you post the urls for which it doesn't work?
Elia Schito
@elia
Jul 13 2015 08:15
@Angelmmiguel Ok, the solution is to require "opal-parser" from a ruby/opal script
or Opal.require('opal-parser') in JS land
eg.
<html>
  <head>
    <script src="http://cdn.opalrb.org/opal/current/opal.min.js"></script>
    <script src="http://cdn.opalrb.org/opal/current/opal-parser.min.js"></script>
    <script>Opal.require('opal-parser')</script>
  </head>
  <body>

  </body>
</html>
Ángel M
@Angelmmiguel
Jul 13 2015 08:18
Ah! ok @elia, thanks for the reply. I will change it on opalbox-jquery :)
Elia Schito
@elia
Jul 13 2015 08:19
@Angelmmiguel would be great if you can send a PR to update documentation for this :sparkles:
Ángel M
@Angelmmiguel
Jul 13 2015 08:25
Of course @elia. When I arrive to home, I will create it ;)
Elia Schito
@elia
Jul 13 2015 08:26
awesome thanks!
Great new stuff coming to the Safari 9 web inspector: https://developer.apple.com/videos/wwdc/2015/?id=505
Torsten Rüger
@rubydesign
Jul 13 2015 12:13
About great stuff @elia . I just threw 10000 lines of ruby code at opal (with small hopes) and it WORKS. That’s great stuff, so thanks guys, also @meh and @adambeynon and everyone else.
Ángel M
@Angelmmiguel
Jul 13 2015 15:44
@elia I test your solution on opalbox-jquery and it works fine
Elia Schito
@elia
Jul 13 2015 15:44
:+1:
also thanks @dancinglightning! this is great feedback :smile_cat:
Forrest Chang
@fkchang
Jul 13 2015 16:19
@dancinglightning so what's the 10000 line project?
Torsten Rüger
@rubydesign
Jul 13 2015 16:22
@fkchang I started writing a vm in ruby last year. Now i can produce executables, but i don’t want to use gdb anymore. So i am writing a debugger/interpreter for the vm. All of the vm but the parser works in opal.
Forrest Chang
@fkchang
Jul 13 2015 16:24
@dancinglightning very interesting
Elia Schito
@elia
Jul 13 2015 16:26
@dancinglightning from what I can understand these might be of your interest https://github.com/opal/opal/issues?q=is%3Aopen+is%3Aissue+label%3Aparser 🍰
:D
Torsten Rüger
@rubydesign
Jul 13 2015 16:27
@fkchang thanks, it does seem to be a ittle further out here than fashionable :-) http://salama-vm.org/
@elia not sure, that is about your parser right ? i started my own, it’s peg based. I just don’t understand those yacc ones.
Elia Schito
@elia
Jul 13 2015 16:29
:( hoped for a moment
Torsten Rüger
@rubydesign
Jul 13 2015 16:30
@elia i understand. Mad undertaking. i was wondering why you didn’t use the whitequark one https://github.com/whitequark/parser
Elia Schito
@elia
Jul 13 2015 16:32
I don't think it was ready when @adambeynon started, but we planned to switch to it by first migrating to a compatible ast and then switching the parser
but that's not easy :)
Torsten Rüger
@rubydesign
Jul 13 2015 16:34
@elia sounds good. and i’m sure it’s not. It’s a shame mine is’t further along, it would be a good idea to share.
Forrest Chang
@fkchang
Jul 13 2015 18:18
hmm, looks like whitequark parse would be able to provide a number of things I've been hoping @adambeynon could provide for me parse_with_comments, source, etc.
this should be final
George Plymale II
@ylluminarious
Jul 13 2015 20:36
:clap:
Ryan Stout
@ryanstout
Jul 13 2015 20:36
nice work!
Elia Schito
@elia
Jul 13 2015 20:38
props to @vais for the constant stream of PRs (which are a pleasure to merge btw)!
after 0.8 is out, plan is to go straight to 0.9
Ángel M
@Angelmmiguel
Jul 13 2015 20:45
nice! :D
Jared White
@jaredcwhite
Jul 13 2015 20:55
Eeeeeexcellent! :)
CJ Lazell
@cj
Jul 13 2015 21:16
nice!
is there any way to set headers on the opal server?
Elia Schito
@elia
Jul 13 2015 21:38
@cj what kind of headers? for which type of file?
CJ Lazell
@cj
Jul 13 2015 21:50
@elia cache control, age, connection transport etc….
Elia Schito
@elia
Jul 13 2015 21:59
I'm open to update Opal::Server to either include that stuff by default or allow the use of middlewares (I think there's an issue already open but don't remember)
@cj ^
CJ Lazell
@cj
Jul 13 2015 21:59
yee, we talked about opening it up before/allowing the use of middleware
I think it’s definietly something that needs to be added. headers I think should be an options that just merges in the users hash, where the users hash takes priority
Elia Schito
@elia
Jul 13 2015 23:08
@cj was checking the source to add a hook, but actually I (re)discovered that after all Opal::Server is already a rack app, hence you can use whatever middleware you want with it, am I missing something? (sorry if you already explained the other time)
CJ Lazell
@cj
Jul 13 2015 23:23
@elia you’re talking about https://github.com/wedgeio/wedge/blob/master/lib/wedge/middleware.rb#L129, right? how would you go about changing the response headers? similar to this https://github.com/jeremyevans/roda/blob/master/lib/roda/plugins/assets.rb#L216?
@elia I also thought there is no way to call #use on the Opal::Server to add your own middleware to it
which is what we were talking about before I think
CJ Lazell
@cj
Jul 13 2015 23:30
in the block that is*
Elia Schito
@elia
Jul 13 2015 23:44
basically the rack app that is opal server boils down to these lines
any place you see where it would make sense to add the hook?