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
elia has quit [Quit: Computer has gone to sleep.]
GitHub73 has joined #opal
<GitHub73> [opal] meh pushed 2 new commits to master: http://git.io/ZBtIYQ
<GitHub73> opal/master 5f5db44 meh: Implement lazy enumerators and remove #next and #rewind...
<GitHub73> opal/master c484bf0 meh: Fix Kernel#to_s
GitHub73 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1381 (master - 5f5db44 : meh): The build passed.
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13715256
meh` has quit [Ping timeout: 244 seconds]
e_dub has joined #opal
ryanstout has quit [Quit: ryanstout]
e_dub has quit [Quit: It's a hard knock life]
e_dub has joined #opal
[spoiler] has joined #opal
omninonsense has joined #opal
[spoiler] has quit [Ping timeout: 272 seconds]
DouweM has quit [Ping timeout: 268 seconds]
e_dub has quit [Ping timeout: 244 seconds]
e_dub has joined #opal
adambeynon has joined #opal
kludge` has quit [Ping timeout: 265 seconds]
kludge` has joined #opal
elia has joined #opal
GitHub87 has joined #opal
GitHub87 has left #opal [#opal]
<GitHub87> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/acDuvg
<GitHub87> opal-rspec/master e309d0d Adam Beynon: Update to 3.0.0.beta1
<elia> adambeynon, opal-browser is a goldmine :)
<elia> there's everything
GitHub6 has joined #opal
<GitHub6> opal/master 1da9826 Adam Beynon: Fix Module#module_exec to pass arguments to block
GitHub6 has left #opal [#opal]
<GitHub6> [opal] adambeynon pushed 1 new commit to master: http://git.io/3MYsnw
<adambeynon> elia: yeah, I was looking a few days back
<adambeynon> need to give it a go soon
<elia> adambeynon, im trying it for the codemotion lab
<elia> i think i'll demo a ws chat
<elia> is much easier and pleasant to look at a ruby api instead of mdn docs (+caiuse+stackoverflow+forums, etc.)
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1382 (master - 1da9826 : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13725027
travis-ci has left #opal [#opal]
GitHub148 has joined #opal
<GitHub148> [opal] adambeynon pushed 1 new commit to master: http://git.io/_eWj6w
GitHub148 has left #opal [#opal]
<GitHub148> opal/master 0541825 Adam Beynon: Implement BasicObject#__id__
<adambeynon> elia: yeah, and to be fair, opal-browser looks very complete
<adambeynon> as in, it does everything
<elia> adambeynon, i'd like to write the rails-ujs adapter for opal-browser
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13725151
<travis-ci> [travis-ci] opal/opal#1383 (master - 0541825 : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
GitHub106 has joined #opal
<GitHub106> [opal] adambeynon pushed 1 new commit to master: http://git.io/mJruyQ
GitHub106 has left #opal [#opal]
<GitHub106> opal/master 14050e6 Adam Beynon: Add Module#private_method_defined? stub method
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13725297
<travis-ci> [travis-ci] opal/opal#1384 (master - 14050e6 : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
GitHub155 has joined #opal
<GitHub155> opal-rspec/master 1b38065 Adam Beynon: Very basic specs for stub + mocks support
<GitHub155> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/vxLmjw
GitHub155 has left #opal [#opal]
<adambeynon> elia: rails_ujs would be great to have
<elia> yeah would really open to ob usage
<adambeynon> elia: Im going to bump opal to 0.5.1 today (to support thing needed for rspec-mocks)
<adambeynon> anything else you need fixing etc?
<elia> adambeynon, whatchout for recent breaking native changes
<elia> I think they should go to 0.6
<elia> e.g. opal-browser doesn't run on master opal
<elia> adambeynon, not sure on how to separate stuff, but probably branching out to 0-5-stable is a valid option
<elia> needago
elia has quit [Quit: Computer has gone to sleep.]
DouweM has joined #opal
e_dub has quit [Quit: It's a hard knock life]
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
meh` has joined #opal
<meh`> adambeynon, yo
e_dub has joined #opal
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
omninonsense is now known as [spoiler]
e_dub has quit [Quit: It's a hard knock life]
elia has joined #opal
<meh`> adambeynon, NoMethodError: undefined method `body' for #<Opal::Nodes::ScopeNode:17926>
<elia> meh`, how do I get the height of an element with OB?
<elia> (it's awesome btw)
<meh`> element.size
<meh`> or not
<meh`> let me check
<elia> Size.new(`#@native.offsetWidth`, `#@native.offsetHeight`)
<meh`> yeah, it's size
<meh`> element.size.height
<elia> ok, lookd like 'twas offset related :)
<elia> ouch: TypeError: 'undefined' is not a function (evaluating 'self['native'].scrollTo(x, y)')
<meh`> are you on opal master?
<elia> nope, 0.5
<elia> it's scrollTo
<meh`> mh
<meh`> yeah but it's saying @native is undefined
<elia> messages.scroll.to y: messages.size.height
<elia> meh`, "'undefined' is not a function", the only function called is scrollTo
<meh`> oh right
<meh`> what browser?
<elia> safari7
<meh`> mh, yeah, scrollTo doesn't exist on element
<meh`> it needs a polyfill
<elia> ugh
<meh`> using element.scrollTop and element.scrollLeft
<meh`> those functions seem to be present only on window
<elia> meh`, doesn't sound like a polyfill then
<meh`> meh, call it however you will, it's probably different among browsers so it still has to go in compatibility/
<elia> meh`, k, i'll see if I can PR it myself
<meh`> also please, follow the rest of the commit styling
<elia> meh`, yeah, i'm sorry, I can amend if it's ok
<meh`> elia, already done myself
<meh`> and no worries
<elia> {◕ ◡ ◕}
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
<adambeynon> meh`: what ruby code was generating that parser error?
<adambeynon> re: undefined method `body'
<meh`> adambeynon, def each_with_index(*args, &block)
<elia> meh`, adambeynon, http://4juz.localtunnel.com
<adambeynon> websocket couldnt connect :(
<elia> nvm, ws doesn't work on localtunne
<elia> yeah
<adambeynon> meh`: I cant reproduce that - have you got a bigger code sample?
<meh`> adambeynon, it's lost in the ether forever
<adambeynon> meh`: Hash#to_n and co are useful outside of Native, so Im going to move those methods back into their core classes
<meh`> adambeynon, please don't
<meh`> that's inconsistent as fuck
<adambeynon> how?
<adambeynon> to_n doesnt turn them into a Native
<adambeynon> its two opposite things
<meh`> it isn't, it's part of the Native bridging
<adambeynon> Hash#to_n is useful for inline x-strings, not just Native
<meh`> it's like having #to_json inside the corelib because it can be useful outside of it
<meh`> can you give me an example?
<adambeynon> passing a hash to jQuery.ajax()
<meh`> then you have to require native
<meh`> I can agree with an attr_reader :map
<meh`> but #to_n is part of the native bridging
<meh`> and it converts the internal values to native if it can
<meh`> so you need all of native to use it
<meh`> if you need to pass an hash to a native function, you require 'native'
<adambeynon> require 'native' should just provide Native. all the #to_n methods are useful in a lot more places
<meh`> adambeynon, which is why it was in the corelib in the first place
<adambeynon> possibly native/ext.rb
<meh`> but all the #to_n methods depend on the Native module
<meh`> for conversion and wrapping
<meh`> so it's all or nothing
<adambeynon> #to_n doesnt need Native at all
<meh`> yes, it does
<meh`> Native.try_convert
<meh`> or well, it's doing recursive stuff
<adambeynon> none of the #to_n methods use it
<meh`> I think it's wrong, native should take care of all the native bridging
<meh`> not have spaghetti here and there
<meh`> it's useful when you're wrapping a native library
<meh`> which is exactly the case where you should require 'native'
<meh`> if you're just writing Ruby you don't need any of that
<adambeynon> but thats the thing, Native is just one approach to wrapping
<meh`> just require 'native' in opal-jquery
<meh`> adambeynon, Native::Object and Native::Array are just generic wrappers part of the native bridging
<meh`> #to_n is part of the native bridging, Hash.new and Struct.new supporting native objects is part of native bridging
<meh`> if you're not using those classes, amen, just require it instead of spraying the code all around
<meh`> what if you don't use enumerators? move them to a library? except when you start needing them?
<meh`> don't make spaghetti code just because you don't want a hundred lines added to your resulting js, it's basically irrelevant as far as size goes
<adambeynon> fine, but all the #to_n stuff has nothing to do with Native. they handle 2 opposite things
<adambeynon> its like requiring rails just to use some acive_suport things
<meh`> how does it have nothing to do with it? #to_n is the other side of the same coin
<meh`> come on, that's not a fair comparison and you know it
<adambeynon> but Native is only 1 use of native objects in opal. we can wrap, we can bridge, and #to_n is useful for both those, not just for Native stuff
<meh`> bridge_class and friends are mostly an internal hack
<meh`> native.rb has all the #to_n stuff, the .new stuff that deals with natives, and Object and Array
<meh`> they aren't separate things, they're cohesive
<meh`> you don't use Object or Array? it's fine, you're going to `include Native` to get the helpers like alias_native doing the proper thing and free #initialize and #to_n
<meh`> if you have #to_n, you need .new supporting natives too, or it's incoherent
<meh`> and if we start scattering it around it will be harder to maintain
<meh`> the JSON stuff stays in one place, the Native stuff in another
<meh`> and in the corelib the core stuff
<adambeynon> overriding the #initialize on core classes is another thing Im not a fan of
<meh`> but it's needed for consistency
<meh`> adambeynon, anyway, how did you like lazy enumerators?
<adambeynon> oh yeah, awesome stuff ;) havent tried them out yet, but I sure will
<meh`> adambeynon, how do you feel about removing the deprecated `Enumerator.new object, method, *args`?
<meh`> it will make the code a lot easier to read
<meh`> adambeynon, also I think I found a bug in the compiler
<meh`> not
<meh`> mh
<adambeynon> lol, possibly?
elia has quit [Quit: Computer has gone to sleep.]
<meh`> bin/opal-repl:22:in `run': Unexpected reserved word at <eval>:3626:15 (V8::Error)
<meh`> oh
<meh`> my fault
<adambeynon> meh`: im going to bump a release, 0.5.1 today or tomorrow
<adambeynon> is it best to leave native in corelib until 0.6?
<adambeynon> breaking changes and all that
<adambeynon> we can leave it in stdlib, but require it from opal.rb
<meh`> sincerely, I'd bump to 0.6
<meh`> lazy enumerators
<meh`> infinite enumerators
<meh`> and there are some usage changes in native, if you used Native::Base
<meh`> but I think I was the only one using it
<meh`> so that shouldn't be a problem
<adambeynon> well, im happy enough with 0.6.0
<adambeynon> there are quite a few small changes to push as well, which will get rspec mocks working too
<meh`> also make it tomorrow please
<meh`> I still have to implement few missing methods in Enumerator::Lazy and few in Enumerable
<meh`> then we will have a complete enumerable set
<meh`> suck on that anything that compiles to js
<adambeynon> :D
<adambeynon> sure, tomorrow is fine
<adambeynon> Im thinking perhaps a pre rubyconf thing though, have 0.6.0 ready and available
<adambeynon> with full rspec support
<meh`> well, you can make it tonight, it shouldn't take much :)
<meh`> adambeynon, is verbose still unset?
<meh`> I'm getting a bunch of Exception: 'undefined' is not an object (evaluating '$gvars["VERBOSE"]['$nil?']')
<meh`> and it should be false by default anyway
<adambeynon> yeah, we need that set in corelib
<adambeynon> I will do that before we release tomorrow
<meh`> adambeynon, I already added some stuff
<meh`> $VERBOSE = false
<meh`> $DEBUG = false
<meh`> $SAFE = 0
<adambeynon> ah, yeh thats fine then
<meh`> and now I'm trying to understand what the fuck is going on in this spec
<adambeynon> i gotta run
<adambeynon> be back in 2 hrs
<adambeynon> hopefully thats not another bug ;)
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<meh`> roger
GitHub149 has joined #opal
GitHub149 has left #opal [#opal]
<GitHub149> opal/master b9f2f99 meh: Add Enumerator#with_index and Enumerator#with_object
<GitHub149> [opal] meh pushed 4 new commits to master: http://git.io/b_ONwA
<GitHub149> opal/master a03de78 meh: Fix Hash#clone to also set @none and @proc
<GitHub149> opal/master 4e5dfdf meh: Enumerator#each should return self
<meh`> brixen, ping
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1385 (master - 4691138 : meh): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13738404
travis-ci has left #opal [#opal]
<brixen> meh`: yo
<meh`> brixen, what direction is rubyspec taking in regard to Ruby 2.0?
<brixen> a lot of 2.0 specs missing still, probably
<brixen> we'll be writing more of them
<brixen> what do you mean by "direction" specifically?
<meh`> brixen, I heard someone say you'd be removing the old specs or something
<brixen> rubyspec master in 2.0+
<brixen> I'll be removing < 2.0 from master
<brixen> there's a 1.x branch
<meh`> that :)
<meh`> ok
<brixen> that includes < 2.0 and whatever 2.0 existed when I branched it
<meh`> sounds good
<brixen> is opal going to target 2.0?
<meh`> that's why I was asking
<meh`> I just opened a discussion issue about it
<meh`> my take on it is yes, we should target 2.0
<brixen> I'd agree
<meh`> brixen, also I just implemented lazy enumerators on Opal
<meh`> :)
<brixen> nice!
<meh`> and Rubinius puzzled me with it
<meh`> where is the #inspect code for Enumerator and Enumerator::Lazy?
<brixen> go into irb and do .method(:inspect) on an instance of whatever :)
<brixen> I'll try to be at the opal talk tomorrow
<brixen> morning is tough with the baby but I'll try :)
<meh`> brixen, .method(:inspect) lies
<brixen> hah
<brixen> what does it say?
<meh`> I had this same discussion in #rubinius yesterday
<meh`> that it comes from kernel
<meh`> but it doesn't
<brixen> show me the code you ran
<meh`> irb(main):002:0> Enumerator.new { }.lazy.method(:inspect)
<meh`> => #<Method: Enumerable::Enumerator::Lazy#inspect (defined in Kernel at kernel/common/kernel.rb:304)>
<meh`> brixen, http://sprunge.us/VdbD
<brixen> what makes you think that's not the method?
<meh`> well
<meh`> the format doesn't look like it's the same
<meh`> and Enumerator::Lazy.new doesn't explicitly know about the method it was called from
<brixen> well, that's not a very convincing argument :)
<brixen> let's see
* brixen monkey patches for good
<meh`> brixen, read the whole log, it has the same analisys
elia has joined #opal
<brixen> it's the method
elia has quit [Client Quit]
<meh`> brixen, what do you mean?
<brixen> it's Kernel#inspect that is called
<meh`> how does it know about take(10)?
<brixen> how does what know about it?
<meh`> god
<meh`> I'm retarded
<meh`> brixen, disregard everything
<meh`> I was running on the MRI irb
<meh`> =_=
<brixen> lol
<brixen> there's clearly only one solution: delete MRI from all your machines :)
<meh`> lol
<meh`> but yeah, your inspection doesn't look as cool as the MRI one for enumerators
<brixen> well, we should fix that :)
<meh`> #<Enumerator::Lazy: #<Enumerator::Lazy: #<Fibonacci: #<Enumerator::Generator:0x0000000279ca50>:each>>:take(10)>
<meh`> against #<Enumerable::Enumerator::Lazy:0x3e44 @args=[] @iter=:each @generator=nil @object=#<Enumerable::Enumerator::Generator:0x3e48 @proc=#<Proc:0x3e4c@kernel/common/enumerator.rb:208>> @size=nil @lookahead=[]>
fkchang has joined #opal
GitHub136 has joined #opal
<GitHub136> [opal] meh pushed 3 new commits to master: http://git.io/x9Cz7g
<GitHub136> opal/master fe77622 meh: Cleanup Kernel#to_enum handling
GitHub136 has left #opal [#opal]
<GitHub136> opal/master 360481a meh: Fix Enumerator::Yielder#yield to return the yielded value
<GitHub136> opal/master fa80648 meh: Hash.new in native bridging converts child objects into Hash
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/13742631
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1386 (master - 360481a : meh): The build passed.
fkchang has quit [Ping timeout: 240 seconds]
[spoiler] has quit [Ping timeout: 264 seconds]
ryanstout has joined #opal