<wmnnd_>
I have encountered a little incompatibility between standard Ruby and Opal. Any suggestions on how to deal with it? => http://pastebin.com/3ftxLsEc
<meh`>
wat
<meh`>
wmnnd_, master or latest stable?
<meh`>
because it ain't happening here
<meh`>
(on master)
<wmnnd_>
Latest stable.
<meh`>
yeah, there have been A LOT of commits between latest stable and master
<meh`>
the release is next door
<meh`>
wmnnd_, you might want to run off master
<meh`>
until 0.6 is released
<wmnnd_>
Can I tell bundler to do that?
<meh`>
yes
<meh`>
just gem 'opal', github: 'opal/opal'
<meh`>
if you're using native, you have to require 'native'
<meh`>
that's basically the only backward incompatible change
<meh`>
IIRC
<meh`>
but you were already doing that reading the pastebin
<wmnnd_>
Thank you, meh`. I think I'll also give Vienna a shot then. But it's late now, so I'll do that tomorrow.
<wmnnd_>
Thank you for your help so far, but I shall return :-)
wmnnd_ has quit [Quit: leaving]
harrow has quit [Ping timeout: 264 seconds]
harrow has joined #opal
lacrosse has quit [Ping timeout: 245 seconds]
lacrosse has joined #opal
adambeynon_ has quit [Ping timeout: 272 seconds]
adambeynon_ has joined #opal
GitHub88 has joined #opal
<GitHub88>
opal/master 3619bd8 meh: Remove String#to_a since it shouldn't exist
marcandre has quit [Remote host closed the connection]
GitHub67 has joined #opal
<GitHub67>
[opal-jquery] adambeynon pushed 1 new commit to master: http://git.io/0K32nA
GitHub67 has left #opal [#opal]
<GitHub67>
opal-jquery/master 1a4a76b Adam Beynon: Add shorted event control names
GitHub131 has joined #opal
<GitHub131>
[opal-jquery] adambeynon pushed 1 new commit to master: http://git.io/QlQJ7g
GitHub131 has left #opal [#opal]
<GitHub131>
opal-jquery/master 3c7dca1 Adam Beynon: whitespace
kludge` has quit [Ping timeout: 245 seconds]
kludge` has joined #opal
ryanstewart has quit [*.net *.split]
yazgoo has quit [*.net *.split]
adambeynon_ has quit [*.net *.split]
adambeynon_ has joined #opal
ryanstewart has joined #opal
yazgoo has joined #opal
kings has joined #opal
yazgoo has quit [Ping timeout: 243 seconds]
yazgoo has joined #opal
yazgoo has quit [Ping timeout: 248 seconds]
yazgoo has joined #opal
<kings>
morning
<kings>
adambeynon_: I'm looking at opal-rspec - in the example I don't see any of the rspec api? the should etc
<adambeynon_>
kings: I think should() is deprecated in favor of the expect(foo).to() syntax
<adambeynon_>
kings: should still works though
yazgoo has quit [Ping timeout: 272 seconds]
<kings>
adambeynon_: ah I just read a blog post about expect - I see - I better get with the times!!
<adambeynon_>
kings: lol. I still prefer the should() syntax as well, and still use it with all my code
<kings>
I've been using should for years - and also in Java and Scala - but ruby does tend to drive innovation
<kings>
which is good :)
<kings>
im also dragonkh btw - I forgot to log out on the other computer
<adambeynon_>
ah right. how are you getting on with opal?
<adambeynon_>
I have actually been writing some docs in last few days, should help out :)
<kings>
adambeynon_: yeah its going well - It's opened up a whole new set of possibilities which is totally aweseome - I'm not that keen on js - so I have been using cofeescript but didnt like that much either so switching back into ruby is amazing
<kings>
I had a look at opal a few years ago but for some reason didn't get excited about it
<kings>
I think now it's probably because lots of web dev has gone further towards js than ever before
<kings>
I've been a ruby fanatic for 12 years now - so if I have to write js - I'm certainly writing it with opal :)
<kings>
I'm looking at vienna also - looks good - I had a look at lissio also
yazgoo has joined #opal
<adambeynon_>
kings: I think its fair to say that opal has only really been "production ready" in the last 12 months or so
<adambeynon_>
the generated code for starters is now a LOT better
<kings>
adambeynon_: how long have you been working on opal - did you author it from the start?
<adambeynon_>
kings: the main difference between vienna and lissio is that vienna uses opal-jquery, and lissio uses opal-browser
<adambeynon_>
kings: yes. about 4 years or so
<kings>
yeah I saw - I prefer opal-jquery
<kings>
you have been very busy over the last few months then - I see lots of stuff - did you get some motivation! lol
<adambeynon_>
kings: lol, well its only the last 2 years that I've actually managed to use it in some production apps
<adambeynon_>
which digs up lots of bugs which need fixing :)
<kings>
thats pretty cool
<kings>
what kind of apps do you have it running in?
<adambeynon_>
I have 6. 2 are just light sprinkles with opal-jquery, the other 4 are full client side mvc
<adambeynon_>
using opal-haml for view rendeirng
<kings>
nice!
<adambeynon_>
rails based json api backend
<kings>
they public?
<adambeynon_>
unfortunately not. all for internal/private systems
<adambeynon_>
kings: I keep meaning to try and write a larger example app
<adambeynon_>
the todos example app is really basic
<adambeynon_>
doesnt show off opal-jquery or vienna to their abilities
<kings>
could be interesting for mobile apps - with zepto
<kings>
well I better get coding - my wife wants us to go out - and my baby girl is scampering about the floor - who know when I'll get half an hour to code again lol !!!!
<kings>
thanks for answering my questions :)
<adambeynon_>
kings: np :)
<kings>
adambeynon_: can I run opal-rspec without phantomjs?
<kings>
without running in the browser?
<adambeynon_>
kings: in node.js, for example?
<kings>
no just in a plain opal app
<kings>
when I try to run with phantomjs - it just hangs
<kings>
its hard to see what is going on
<adambeynon_>
kings: hangs for how long? does it finish?
<kings>
not sure still waiting - 1 min so far
<kings>
also the example doesnt run in opal-jquery - it's says it missing the opal gem
<kings>
havent investigated the example much though - its probably just needs gem 'opal' or something in the gemfile
<kings>
adambeynon_: says Specs timed out
meh` has joined #opal
<kings>
I've just got a very simple spec: expect(1).to eq(1)
<kings>
I think its something to do with the paths in my Rakefile though
<adambeynon_>
kings: how are you running the specs?
<adambeynon_>
with the Rake task?
<kings>
I've tried 2 ways:
<kings>
1. with a rake task - which hangs then Times out
<kings>
2. with a rack app - which just says: 0 examples, 0 failures (time taken: 0.004)
<kings>
in the browser
<kings>
I have the spec folder just in the root of my project
<kings>
and my application.rb is in an app dir at the root of the project
<adambeynon_>
meh`: is securerandom suitable for for guid's ?
kings has joined #opal
<meh`>
yes
GitHub58 has joined #opal
GitHub58 has left #opal [#opal]
<GitHub58>
opal-haml/master 5e6453c Adam Beynon: Specs can be run in browser
<GitHub58>
[opal-haml] adambeynon pushed 1 new commit to master: http://git.io/Yp5ZpQ
<kings>
if I have json as a string - how can I convert it into a ruby object that is a json object?
<adambeynon_>
kings: JSON.parse(string)
<kings>
parsing fails
<meh`>
kings, then syntax errors in the JSON
<adambeynon_>
kings: the json parse uses the standard browser JSON object
<meh`>
JSON.parse uses the browser parser
<kings>
if I replace ":" with " => " - then I can use the object without it being a string
<kings>
but I cant seem to parse it when its a string
<adambeynon_>
kings: it is json yes? not ruby as a string?
<kings>
yeah it json
<kings>
but if I convert it to a ruby object by doing that replace from : to => then it works as an object
<kings>
but as soon as I put it in json=<<-EOF json EOF - then it wont parse
<kings>
theres is not much stack trace info available - just says failed to parse string
<kings>
I've found it pretty hard to get my opal-rspecs working as there is hardly any error info coming out
<kings>
is there a way to get a full stack trace?
<adambeynon_>
kings: it should show the backtraces for each failed spec
<adambeynon_>
kings: which browser?
<kings>
its using phantomjs - running as a rake task
<kings>
bundle exec rake
<kings>
its a test
<adambeynon_>
kings: it should still be showing a stack trace for each failed spec
<adambeynon_>
kings: can you copy-paste the exact error message?
<kings>
1) ReportParser should parse a cucumber json file and return features
<kings>
Exception:
<kings>
Unable to parse JSON string
<kings>
thats it
<adambeynon_>
kings: ok, thats definitely the native json parser from the v8 engine, so it must be malformed json somewhere
<kings>
weird how it works as an object tho and not as a parsable string
<kings>
it also works fine via HTTP.get(json_file)
<meh`>
kings, certain exceptions aren't catchable
<meh`>
and have no stacktrace
<meh`>
browser limitation
<kings>
hmm ok
<meh`>
kings, but make the json go through a linter
<meh`>
or dependin on how you embedded the json
<meh`>
might be doing escaping that it shouldn't do
GitHub23 has joined #opal
<GitHub23>
opalrb.org/master 85ff5e5 Adam Beynon: Initial rspec docs
GitHub23 has left #opal [#opal]
<GitHub23>
[opalrb.org] adambeynon pushed 1 new commit to master: http://git.io/TIEkGw
<kings>
ok - I'm trying to find the root of the issue - it's pretty tough - probably a combination of my lack of familiarity with opal and not having much info in the stack
DrShoggoth has joined #opal
<kings>
oh its much easier running the specs in the browser with debug=true
DrShoggoth has quit [Client Quit]
DrShoggoth has joined #opal
<meh`>
kings, yeah, phantomjs is kind of a huge hack
<kings>
ok figured it out at last - there was some newline characters amongst the json - JSON.parse didnt like it - when I replaced all "\n" with "" it started working
<kings>
hell yeah! I'm dancing around the room with joy!!!
DrShoggoth has quit [Quit: Leaving]
<meh`>
adambeynon_, I was thinking, instead of creating the classes in bridge_class, couldn't we bridge the native to an already existing class?
<meh`>
and doing the bridging in the class itself?
DrShoggoth has joined #opal
<meh`>
I mean, in the file instead of the runtime
<meh`>
this would fix #476 and allow for Number < Numeric
<adambeynon_>
meh`: we can already do something like:
<adambeynon_>
class Array < `Array`; ... end
<meh`>
adambeynon_, yeah but that wouldn't solve the issue
<adambeynon_>
meh`: a bridged class cant be a subclass
<meh`>
adambeynon_, why?
<adambeynon_>
bridges only work when they are direct children of Object
<meh`>
why?
<adambeynon_>
otherwise it becomes really complex in donating methods between multiple source classes and target classes
<meh`>
I see
<meh`>
I guess #476 comes from broken donation then
<meh`>
it just overrides blindly
<adambeynon_>
could be - haven't looked at it in detail yet
<meh`>
adambeynon_, +1 on that post
<meh`>
most people don't understand the difference between syntax and semantics
<meh`>
they think everything is about syntax
<adambeynon_>
meh`: yep. I think we could do with a nice intro part on these new docs, sort of design deciscions
kings has quit [Quit: Leaving...]
<adambeynon_>
"why cant I call my fav_lib.js" etc
<adambeynon_>
I think it will also filter users straight away, who opal is for, and who it isnt
<adambeynon_>
adambeynon_: I was half thinking of writing a small angularjs style clone, to deal with directives in the html
kings has joined #opal
<adambeynon_>
but after watchign a screencast, I never wish to do anything of the sort
<adambeynon_>
it is awful
<adambeynon_>
I dont get how people could write their gui apps like that
<meh`>
yeah
<adambeynon_>
half of it is inline javascript within the html
<meh`>
yep
<adambeynon_>
didnt we decide like 10 years ago that ujs was a good idea?
<meh`>
we could go "want backbone? use vienna; want angular? use lissio"
<meh`>
or something of the sort
<adambeynon_>
meh`: yep. I think a big (bigger) demo app is really needed too
<meh`>
adambeynon_, working on that, gwentoo
DrShoggoth has quit [Read error: Connection reset by peer]
<adambeynon_>
meh`: the first angular demo I found tells me that this code is "a clean solution":
<meh`>
yeah, why does defn and defs take the prefixed method name?
<meh`>
it should take the mid instead of jsid
<meh`>
meh
<meh`>
I'll work on a separate branch
<meh`>
and try to fix #476
<meh`>
it's time I dive into the runtime
<meh`>
two people who can work on it are better than one
DouweM has quit [Ping timeout: 245 seconds]
<meh`>
adambeynon_, while I'm there I'm starting the cleanup as well, I think we should call special variables $$name or $name$, _ is usable in ivar names
GitHub167 has joined #opal
<GitHub167>
opal/master 8514670 Adam Beynon: Opal::Server should not search for an index.html path unless specified
<GitHub167>
[opal] adambeynon pushed 1 new commit to master: http://git.io/OlaDmQ
GitHub167 has left #opal [#opal]
kings has quit [Ping timeout: 245 seconds]
kings has joined #opal
travis-ci has joined #opal
<travis-ci>
[travis-ci] opal/opal#1680 (master - 8514670 : Adam Beynon): The build passed.
<GitHub101>
[opal-todos] adambeynon pushed 1 new commit to master: http://git.io/08_YbQ
<GitHub101>
opal-todos/master 57733de Adam Beynon: Add some specs for example
GitHub101 has left #opal [#opal]
ryanstout has joined #opal
<meh`>
adambeynon_, what's the difference betwee _super and __parent?
<adambeynon_>
__parent includes modules and singleton classes
<adambeynon_>
_super is the actual .superclass()
<adambeynon_>
meh`: dont swap to $$foo private vars
<meh`>
I see
<adambeynon_>
I dont like the double $$
<meh`>
yeah it looks ugly
<meh`>
already tried
<meh`>
trying to think of a good way
<meh`>
a .$ special table doesn't look half bad, but I'm thinking about the repercussions
<meh`>
keeping in mind that if we optimize the shape, it's going to be blazingly fast
<meh`>
so ignore the idea of overhead there
<adambeynon_>
special table for private variables?
kings has quit [Quit: Leaving...]
<meh`>
if by private variables you mean the various special flags, yes
<adambeynon_>
it would make it a pain to debug opal problems/speed/bugs
<meh`>
adambeynon_, how so?
<adambeynon_>
well, instead of inspecting an object in the debugger, I would have to keep opening the variable table as a second object
<adambeynon_>
obj._klass vs obj.table._klass
<meh`>
well, obj.$.klass
<meh`>
any other ideas?
<meh`>
the current situation is unbearable
<adambeynon_>
meh`: is it currently that bad?
<meh`>
adambeynon_, yes
<adambeynon_>
rubinius uses ivars for some runtime stuff too
<meh`>
_a, __b, __c__
<adambeynon_>
meh`: well, I can make them more consistent
<adambeynon_>
__foo
<meh`>
adambeynon_, but then we get into a vicious cycle
<meh`>
you went with __parent because rspec was using @_parent
<meh`>
we should use a character unusable in ivars
<meh`>
also I think Rubinius usage of ivars for runtime stuff ends up creating weird bugs
<meh`>
when inheriting from core classes mostly
dragonnkh has joined #opal
dragonkh has quit [Read error: Connection reset by peer]
marcandre has quit [Remote host closed the connection]
kings has joined #opal
<kings>
evening
<meh`>
evening
<kings>
hey meh`
<kings>
meh`: my opal project is a single page app - but I'm not sure exactly how to display it - so I consume some json which then gets turned into an object hierarchy - I then have 3 views I'd like to show - first an overview - the json is made up of features with scenarios and steps - so the overview shows an overview of all the features and their pass/fail status and some graphs
<kings>
the 2nd view - is of each specific feature - listing the scenarios and steps for the feature
<kings>
the 3rd view is showing all the features but aggregated by tag (Each feature has a tag)
<kings>
so my question is - should I have 3 links on the index page - which when clicked - replace the view with the appropriate view? and when a link is clicked - should I at that point generate the html and render it?
<kings>
or should I generate and render everything - and have the links just show and hide various views?
<kings>
any advice welcome
<meh`>
are you using any framework?
<kings>
no I wanted to do it without as a learning experience
<kings>
just opal-jquery
elia has joined #opal
<kings>
hey elia
<kings>
kings/dragonkh here :)
<meh`>
kings, I'd render on click
<elia>
hey there :)
<kings>
yeah I think thats a good idea
<elia>
k, checking transcript :)
<kings>
:)
<kings>
elia: I've had some real fun trying to get my opal-rspec working today ! - but its working now :)
<elia>
kings, should write some docs down, while there's still pain :)
<kings>
hehe yeah - I will - although some of it was more related to my dense brain than anything else hahah
<elia>
meh`, adambeynon_, ng-lol
<meh`>
lol
<adambeynon_>
kings: I found a slight bug with opal-rspec earlier where it was trying to load any index.html file it could fine
<adambeynon_>
Find in your app
<adambeynon_>
It caused my specs to hang
<adambeynon_>
So that might have been the same issue, maybe
DouweM has joined #opal
<kings>
perhaps - I had to move my spec folder into a subfolder for it to work - otherwise it just hangs - there is an index.html at the root - level - so it could be the issue
<adambeynon_>
kings: I think so.. I have fixed it on opal master branch which has resolved the issue for me
<kings>
ok great :) I'll try it later
<elia>
adambeynon_, got anything out of sprockets?
<elia>
adambeynon_, I was going to have a look too, but maybe I'm late
kings has quit [Quit: Leaving...]
<adambeynon_>
elia: I did, but didn't get too far. It looks like a top level asset and a required asset take the exact same route in sprockets.
<adambeynon_>
We would have to introduce any solution ourselves
<adambeynon_>
Which is tricky
<elia>
adambeynon_, was thinking the same thing
<elia>
adambeynon_, probably the way is to avoind passing parsed requires to sprockets and just prepend them while compiling
<elia>
`compiler.requires.each do |r|`…
<elia>
and now that im looking at it it already looks for rb files
<elia>
in #find_opal_require
<elia>
the comment requires can still go to sprockets safely
<elia>
if we find a way to do it cache-wise I think we're done
mneorr has joined #opal
adambeynon_ is now known as adambeynon
<elia>
adambeynon, YAY, _ no more!
<adambeynon>
elia: trying to msg NickServ to change it with an iPad keyboard is really difficult :p
<adambeynon>
elia: hijacking the requires could do the trick I think
<elia>
adambeynon, the other alternative I was thinking of is some hack with filenames or mime types
<elia>
inlining requires is what sass does when you use @import
<elia>
adambeynon, the downside is that it won't use separate script tags (in rails at least)
<elia>
adambeynon, sass_importer.rb seems interesting too
<adambeynon>
elia: right, havent noticed the @_dependency_paths variable before
<adambeynon>
elia: if there was some @_dependant_assets, then we would be ready to go
<elia>
adambeynon, me too
<elia>
seems that sass had the same kind of problem
mneorr has left #opal [#opal]
mneorr has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
mneorr has quit [Remote host closed the connection]