<fkchang>
meh`: can you catch a js error in opal, or better to do it all inside of the xstring
<meh`>
fkchang, rescue can catch js errors as well, IIRC
<meh`>
fkchang, yeah, it does
Noldorin has joined #opal
kings has quit [Ping timeout: 272 seconds]
marcandre has quit [Remote host closed the connection]
barry has quit [Remote host closed the connection]
dleedev has quit [Quit: dleedev]
marcandre has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
kings has joined #opal
<fkchang>
sweet, my spike using lissio and jubilee is a success
<meh`>
noice
<fkchang>
meh`: kudos across the board for opal-browser and lissio -- the API's make a lot of sense and are very ruby-esque
<meh`>
fkchang, thanks
<fkchang>
and of course adambeynon: kudos on all other things opal, elia too
<fkchang>
meh`: I'll say when I figure out what it is that I want to do, and then you tell me how it works in lissio, I'm not surprised. Priniciple of least surprise works pretty well in lissio
<fkchang>
either that or we're both twisted in the same way
<meh`>
lol
<fkchang>
615 lines (as counted by wc -l, includes html and css in lissio) both server and client for a kanban board that pulls from pivotal tracker, and shows changes real time (highlighting of cards, showing cards for just 1 uset)across all browse instances
<meh`>
I always wonder how many more lines and convulted spaghetti code would a javascript solution be
<fkchang>
it's a good question, I know when I first started just the lissio part, I was super impressed on how little code, and how clear the code was, certainly compared to a raw HTML, CSS, and JS solution. That I could think in objects from the get go is huge
<fkchang>
and ruby objects vs js object at that
<meh`>
what the heck, closing the Chrome inspector just shut down my monitor
<fkchang>
weird
<meh`>
for a moment I thought the monitor just broke
<meh`>
greater panic
<meh`>
but yeah, working with lissio is awesome compared to the messes I had to do with backbone and friends
[o__o] has left #opal [#opal]
GitHub159 has joined #opal
GitHub159 has left #opal [#opal]
<GitHub159>
opal-browser/master 4d3c605 meh: dom/document: #cookies has been moved
<GitHub159>
opal-browser/master 0d33215 meh: support: add some documentation
<GitHub159>
[opal-browser] meh pushed 5 new commits to master: http://git.io/q9zxow
<adambeynon>
meh`, elia: sprockets has a very handy "require_tree" directive. any objections into making it a special method name in opal?
<adambeynon>
similar to how we handle require() ?
<elia>
adambeynon, not at all
<elia>
#require_tree ?
kings has quit [Ping timeout: 252 seconds]
<meh`>
adambeynon, fine by me
dimaursu16 has quit [Read error: No route to host]
dimaursu16 has joined #opal
Oblivium has joined #opal
<Oblivium>
Hi everyone. How do I access a simple ruby variable like stuff = "some characters" defined in the main scope of the file being compiled to Js with opal ? (the same file that has the require 'opal' at the beginning] ?
<meh`>
Oblivium, I'm not sure I follow
<Oblivium>
I'm just trying to access from the browser a variable I defined in the ruby script that I converted to .js
<meh`>
you can't, variables are local to the file, like in Ruby
<Oblivium>
local to the file meaning? Are you saying that, if in irb I require "somethingelse.rb" which has local variables in the main scope, then I would not be able to see such variables?
kings has joined #opal
<Oblivium>
back to my case, what if I make it an @instance_variable? Then I would not still be able to access it from Js runtime?
<Oblivium>
(I tried and it seems I can't?)
<meh`>
use a global variable or a class
kings has quit [Ping timeout: 272 seconds]
e_dub has quit [Quit: e_dub]
<Oblivium>
ok then how do I call it from Js ? alert(Opal.$my_glob_var); ?
<meh`>
Opal.gvars.my_global_var
<Oblivium>
meh`: yea thanks
Oblivium has quit [Quit: Page closed]
Oblivion has joined #opal
Oblivion is now known as Guest56384
Guest56384 is now known as Oblivion_n
<Oblivion_n>
what if from Js runtime I want to call a function in rubyscript.js which is not defined in a class ? Can I still access it, maybe using ruby reflection?
<adambeynon>
Oblivion_n: which object would it be defined on?
<adambeynon>
just the top level?
emanuel has joined #opal
<Oblivion_n>
adambeynon: yes toplevel
<Oblivion_n>
is there a name for the toplevel Ruby scope?
<Oblivion_n>
that i can call from Js
<Oblivion_n>
so that I can call functions defined in toplevel not in a class ?
<meh`>
and it gets required before the spec_helper
<meh`>
adambeynon, any idea to fix this?
<meh`>
adambeynon, or something like that, rspec is definitely requiring json
<adambeynon>
Oblivion_n: yes, it is exposed as Opal.top
<adambeynon>
so you can call methods like
<adambeynon>
Opal.top.$my_method(1, 2, 3)
<meh`>
I guess I will include them normally
<meh`>
should fix it all
<adambeynon>
meh`: I forget now, what was the problem with json?
<meh`>
adambeynon, json was getting used/required before the polyfill
<meh`>
but I fixed it
kings has joined #opal
<meh`>
and chrome keeps shutting down my fucking monitor
<meh`>
fuck this shit
<Oblivion_n>
adambeynon: cool thanks, and that does not work for calling top level local variables because as meh` said they are only available to be called by ruby file which defines them right?
<adambeynon>
Oblivion_n: yeap
<adambeynon>
you could use globals/instance variables
<adambeynon>
or even a constant
<Oblivion_n>
kk, wait, i can call @instance variables ?
<adambeynon>
yep. Say you have @foo = 100
<Oblivion_n>
yea
<adambeynon>
then: Opal.top.foo == 100
<Oblivion_n>
oh yea k thanks
<meh`>
>mfw specs are running in IE6
<meh`>
fuck yeah
<meh`>
and only 5 failures
<meh`>
and they're all storage related
<meh`>
easy peasy
<meh`>
1 failure
<adambeynon>
\o/
<meh`>
this is gonna be harder tho
<elia>
meh`, whooooa
<meh`>
something weird in the DOM::Builder with inner_html
<meh`>
mh
<elia>
meh`, memories of innerHTML not reliable/crossbro
<meh`>
no I think it's actuall textContent/innerText
<meh`>
expect(res.child.text).to eq('wut')
<meh`>
this is failing
<meh`>
but I added the innerText polyfill
<meh`>
mmh
<meh`>
and I have no developer tools for IE6
<meh`>
and IE11 can't emulate IE6
<meh`>
let's see if it works with IE5 emulation
<meh`>
it does, lol
<elia>
wat?
<meh`>
fuck jquery, we IE5.5
<meh`>
only 2 failures in IE5
<meh`>
and one is with xpath
<meh`>
yeah, it seems to be a bug in Browser.supports?