GitHub157 has joined #opal
GitHub157 has left #opal [#opal]
<GitHub157> [opal] elia pushed 1 new commit to master: http://git.io/_bBEkQ
<GitHub157> opal/master 09f7778 Elia Schito: Added support for more #defined? args
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12443621
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1097 (master - 09f7778 : Elia Schito): The build passed.
elia has quit [Quit: Computer has gone to sleep.]
meh` has quit [Ping timeout: 240 seconds]
fntzr has joined #opal
fkchang has quit [Remote host closed the connection]
adambeynon has joined #opal
GitHub155 has joined #opal
<GitHub155> opal/master d4d68fc Adam Beynon: Improve Module#constants etc by manually storing constants in scopes
<GitHub155> [opal] adambeynon pushed 1 new commit to master: http://git.io/cW7dUA
GitHub155 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1098 (master - d4d68fc : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12450951
travis-ci has left #opal [#opal]
elia has joined #opal
kludge` has quit [Ping timeout: 264 seconds]
kludge` has joined #opal
kludge` has quit [Changing host]
kludge` has joined #opal
<Kilo`byte> are there bindings for jquery websocket?
<elia> Kilo`byte, dont think so
<Kilo`byte> gonna make own ones then
<elia> +1
<Kilo`byte> should i distribute them seperately or pull-request them in?
<elia> Kilo`byte, id PR it, but without adding a require inside 'opal-jquery' (just as stdlib vs corelib)
<Kilo`byte> explain?
<Kilo`byte> in existing file?
<Kilo`byte> elia: ^
<adambeynon> Kilo`byte: I think elia is suggesting adding it in as opal-jquery/websocket.rb
<adambeynon> but make it optional
<Kilo`byte> yes
<adambeynon> i.e. people have to require() it
<Kilo`byte> yes
<adambeynon> but, it would definately be really useful :)
<Kilo`byte> ruby hashes are directly mapped to javascript objects
<Kilo`byte> right?
<Kilo`byte> so this would be true:
<Kilo`byte> {test: 'hello'} == `{'test': 'hello'}`
<adambeynon> Kilo`byte: nope, hashes are implemented as a real class, but they do use a javascript object internally
<Kilo`byte> so, if i want to pass a hash to some native function that needs an js object, how can i do that
<adambeynon> my_ruby_hash.to_n
<adambeynon> to_n is an opal convention for converting ruby objects to js objects
<Kilo`byte> ah, thanks :)
<Kilo`byte> yeah, makes sense
<adambeynon> (thinks like string, array, numeric etc are already their native js counterparts)
<Kilo`byte> yeah
<elia> adambeynon, well interpreted :)
<elia> (sorry, was putting the baby to sleep)
<Kilo`byte> np :P
<Kilo`byte> kinda weird to me though
<Kilo`byte> 12:31 noon here
<Kilo`byte> :P
<Kilo`byte> (GMT+2)
elia` has joined #opal
elia` is now known as elia_
<elia_> i'm in the same tz, but the baby is 5months old :)
elia_ has quit [Remote host closed the connection]
elia_ has joined #opal
elia_ has quit [Remote host closed the connection]
<elia> Kilo`byte, you really got haml to work yesterday?
<Kilo`byte> didn't try yet
<Kilo`byte> was just a thought
<Kilo`byte> can do after i finish websockets
<elia> elia, was surprised because IIRC haml code is quite complex (and messy)
<elia> ouch, talking to myself :D
<elia> Kilo`byte, ^^^
<Kilo`byte> ye, saw
GitHub185 has joined #opal
<GitHub185> opal/elia/defined-super-wip 8f4424f Elia Schito: WIP [skip ci]
GitHub185 has left #opal [#opal]
<GitHub185> [opal] elia created elia/defined-super-wip (+1 new commit): http://git.io/9cLaKQ
<elia> adambeynon, pushed my WIP on defined? super ^^^^^
<elia> adambeynon, I'm not good enough at parser.rb ;)
elia has quit [Quit: Computer has gone to sleep.]
elia_ has joined #opal
<Kilo`byte> elia_: short question
elia_ has quit [Remote host closed the connection]
<Kilo`byte> ._.
<Kilo`byte> adambeynon: how to pass a ruby block as javascript callback?
<Kilo`byte> ah, k found out
<Kilo`byte> block.to_n :P
<Kilo`byte> ok, inspired by rails respond_to do |format| blocks, i made the events here
meh` has joined #opal
<adambeynon> Kilo`byte: looking good. might also be worth looking at what work meh` has done on websockets. if we have websockets for jquery and opal-browser, maybe abstracting it into a common library is a good idea
<meh`> opal-browser does have functioning websockets
<meh`> but opal-browser is cherry-pickable enough
<meh`> you could just use opal-browser for websockets
<Kilo`byte> ah
<Kilo`byte> meh`: do you support them the jquery way?
<Kilo`byte> as in, serialize a data structure
<Kilo`byte> adambeynon: also, question
<Kilo`byte> how can i convert a javascript object into a hash
<adambeynon> Kilo`byte: Hash.new(`{"a": 100, "b": 200}`)
<adambeynon> just pass it straight into Hash.new
<Kilo`byte> oh, nice
GitHub58 has joined #opal
GitHub58 has left #opal [#opal]
<GitHub58> [opal] adambeynon pushed 1 new commit to master: http://git.io/19_ENg
<GitHub58> opal/master c7a1b52 Adam Beynon: Subclasses should inherit contants from superclasses, and modules should...
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1099 (master - c7a1b52 : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12454919
travis-ci has left #opal [#opal]
<Kilo`byte> meh`: well, i prefer the jquery ones
<Kilo`byte> in javascript:
<Kilo`byte> $.websocket('ws://localhost:8080/', {'event': {'alert': function(e) {alert(e.data.text);}}});
<Kilo`byte> to alert the webbrowser now, send "{'type': 'alert', 'text': '<message>'}"
<Kilo`byte> meh`: ^
<meh`> Kilo`byte, I don't see much difference from how I did it
<Kilo`byte> well, i mean, can you pass serialized hashes through yours
<meh`> Kilo`byte, the Socket is a Socket, just that, it sends what you pass it
<meh`> you can inherit from it and implement your own event dispatching thing
<Kilo`byte> yeah
<meh`> the way jquery doesn't fit in all cases
<Kilo`byte> but thats exactly the main aim of jquery itself
<meh`> in fact I don't like jquery
<Kilo`byte> i don't say my thing is better. both have their applications
<meh`> as soon as you diverge from the jquery way of doing things, you either are left alone or have to hack your way through it
<Kilo`byte> however i may not PR it in since you already have one... we'll see
<Kilo`byte> and especially with dom manipulation jQuery makes it quite easy
<meh`> Kilo`byte, how so?
<Kilo`byte> lets say we want to add class 'someclass' to all p elements
<Kilo`byte> $('p').addClass('someclass');
<Kilo`byte> in the ruby port:
<Kilo`byte> Element.find('p').add_class('someclass');
<Kilo`byte> err
<Kilo`byte> without ;
<Kilo`byte> well, it doesn't matter anyways
<meh`> in opal-browser $document.css('p').each { |e| e.add_class('someclass') }
<Kilo`byte> eww $document :P
<Kilo`byte> meh
<Kilo`byte> not too bad either :P
<meh`> that's how it is, there may be more documents
<Kilo`byte> in fact, support for $document will be removed afaik
<meh`> and that's the ruby way of doing things
<meh`> from where?
<Kilo`byte> sec
<Kilo`byte> in fact
<Kilo`byte> that might be jQuery thing
* Kilo`byte checks
<Kilo`byte> ah, yes
<Kilo`byte> nvm then
<Kilo`byte> meh`: variables starting with $ are global, right?
<meh`> yes
<adambeynon> meh`: btw, I think that constant issue is now resolved
GitHub126 has joined #opal
<GitHub126> opal-rspec/master 1c56529 Adam Beynon: Modules now donate constants on include, so remove temp fix
GitHub126 has left #opal [#opal]
<GitHub126> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/cF_ObQ
<adambeynon> a class accessing constants defined in a superclass
fntzr has quit [Ping timeout: 240 seconds]
<meh`> adambeynon, nice
elia has joined #opal
GitHub166 has joined #opal
<GitHub166> [opal] elia deleted elia/defined-super-wip at 8f4424f: http://git.io/PRP9ig
GitHub166 has left #opal [#opal]
<Kilo`byte> trying to get the rails module working
<Kilo`byte> rails keeps crashing with
<Kilo`byte> Uncaught exception: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
<Kilo`byte> gem is installed and in the Gemfile (and bundle is updated)
<Kilo`byte> no ides whats wrong
<meh`> Kilo`byte, what gem?
<Kilo`byte> opal-rails
<meh`> did you read the error to the end? :)
<meh`> it uses execjs, it's up to you to choose the proper runtime
<Kilo`byte> ye
<meh`> add therubyracer
<Kilo`byte> as gem, rite?
<meh`> yes
<Kilo`byte> woot
<Kilo`byte> thanks
* Kilo`byte feels stupid
ryanstout has joined #opal
<Kilo`byte> just wondering, how does the code conversion work
<Kilo`byte> and especially in which files
<meh`> Kilo`byte, what code conversion?
<Kilo`byte> ruby -> js
<Kilo`byte> meh`: ^
<meh`> Kilo`byte, it gets parsed into s-exps, then the result s-exps are processed and js is generated
<Kilo`byte> and that happens in which files?
<Kilo`byte> meh`: ^
<meh`> parser.rb and grammar.y
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
travis-ci has joined #opal
<travis-ci> [travis-ci] elia/opal#23 (fix-defined - 95af177 : Elia Schito): The build failed.
<travis-ci> [travis-ci] Change view : https://github.com/elia/opal/compare/4f55dd537385^...95af17782f2f
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/elia/opal/builds/12462591
elia has quit [Quit: Computer has gone to sleep.]
ryanstout has quit [Quit: ryanstout]
elia has joined #opal
GitHub24 has joined #opal
<GitHub24> opal/master 290f9cb Elia Schito: Fix some ternary operators inside #process_defined
GitHub24 has left #opal [#opal]
<GitHub24> [opal] elia pushed 1 new commit to master: http://git.io/j8sFbA
elia has quit [Quit: Computer has gone to sleep.]
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1100 (master - 290f9cb : Elia Schito): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12463095
travis-ci has left #opal [#opal]
<Kilo`byte> can i use yaml in opal?
DouweM has quit [Ping timeout: 245 seconds]
adambeynon has joined #opal
adambeynon has quit [Quit: Textual IRC Client: www.textualapp.com]
<Kilo`byte> is the compiled runtime in the repo?
<meh`> I don't think so
<Kilo`byte> doh
<Kilo`byte> meh
* Kilo`byte compiles it
<meh`> and unless there's some pure ruby YAML implementation, no, you can't
<Kilo`byte> ah, k
<Kilo`byte> well, that was my question indirectly
<Kilo`byte> if the yaml implementation was native :P
<meh`> the one in Ruby is
<Kilo`byte> yeah
<Kilo`byte> i personally use java a lot too. On java most stuff isn't native if possible (there are exceptions)
<Kilo`byte> /home/kilobyte/.rvm/gems/ruby-2.0.0-p247/gems/opal-0.4.4/lib/opal/cli.rb:18:in `initialize': wrong number of arguments (1 for 2) (ArgumentError) <-- woot
<Kilo`byte> everyone loves errors :D
<Kilo`byte> meh`: ^
<meh`> blame elia
<meh`> never touched that code
<Kilo`byte> tracking it down atm
<Kilo`byte> @filename = options[:filename] <-- the code
<Kilo`byte> i wonder
<Kilo`byte> hmm
<Kilo`byte> opal-repl works
<Kilo`byte> meh`: can't compile D:
<Kilo`byte> >> File.write('opal.js', Opal::Builder.build('opal'))
<Kilo`byte> undefined method `build_str' for #<Opal::Builder:0x00000000b3bc30>
<Kilo`byte> D:
<meh`> dunno, never used the builder alone
<Kilo`byte> i wonder
<Kilo`byte> it seems to load the gem opal
<Kilo`byte> not the git one which i use
<Kilo`byte> meh`: how else would i build the runtime?
<meh`> Kilo`byte, I really don't know, I always used opal-sprockets to do its magic