RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: marcbowes
You want to be careful rescuing Exception as it catches things like Ctrl-C and other signals. This is because For example:
$ ruby -e "begin; sleep(9999); rescue Exception => e; puts 'ignoring ' + e.class.name; retry; end"
Try pressing Ctrl-C or killing the PID. It really sucks having to kill -9 because the killer never knows if they're causing some sort of state corruption.
I recommend rescuing from StandardError and possibly Timeout::Error if you are hitting some external service. Another option is to do something like this:
rescue Exception => e
# as before
For those wanting to use this with Rails 3:
 gem "table_builder", :git => "git://github.com/p8/table_builder.git" - do not rely on the released gem, it seems to be stale.
gem "table_builder", :git => "git://github.com/p8/table_builder.git"
I agree. 'Stretch', but cool at the same time.
This technique buys you two things:
However, the bridge is completely closed because JS runtimes are not equivalent. For example, how do you deal with timezones (you're making a new Date which means you can have some weird ordering issues if the day is different depending on whether the server/client are in a different zone.
Really cool though :-)
Thanks. Interesting cast.