The holidays brought us Ruby 2.2.0 and Rails 4.2.0, Finishing Moves, the end/beginning of RubySpec, a nifty way to bind data from JavaScript to Rails, tips on testing controllers, and the tragic news of James Golick’s death.

Listen to this episode on Ruby5

Sponsored by Top Ruby Jobs

If you’re looking for a top Ruby job or for top Ruby talent, then you should check out Top Ruby Jobs. Top Ruby Jobs is a website dedicated to the best jobs available in the Ruby community.


Top Ruby Jobs

Ruby 2.2.0 Released

Ruby 2.2.0 was released on Christmas day, containing a bunch of new features and improvements. The new garbage collector is now able to collect Symbol type objects, reducing memory usage of Symbols. This new version has reduced pause time for garbage collection thanks to the Incremental Garbage Collector. Rails 5.0 will take full advantage of both of these features, when it eventually comes out sometime in the Fall of 2015, requiring Ruby 2.2 or greater.


Ruby 2.2.0 Released

Rails 4.2.0

Rails 4.2.0 was also released over the holidays. There’s AdequateRecord, the painstaking multi-year rewrite of ActiveRecord led by Aaron Patterson to improve the performance of ActiveRecord beyond what it was in Rails 2.3 days, which means a lot.There’s also ActiveJob, which was originally planned for Rails 4. It brings a centralized interface for queuing jobs for any queueing systems like Resque, Sidekiq or Delayed Job. There’s also Web Console which gives you the ability to run queries you would usually run in the rails console, but right inside the browser when an exception occurs, which is similar to the better_errors gem. And now, adding and removing foreign keys is properly supported in Rails migrations.


Rails 4.2.0

Finishing Moves

Every now and then you find yourself in a situation where Ruby doesn’t have that one method you need. For example, a nil_chain method, which allows you to write method chains without fear of tripping over a NoMethodError and NameError exception when something throws out a nil value. Sometimes you just want to call something if it exists, and not if it’s nil. The folks over at Forge Software wrapped up a bunch of these useful methods into a gem called “Finishing Moves”.


Finishing Moves

RubySpec

On new year’s eve Ruby Hero Brian Shirai wrote a blog post explaining why he is ending the RubySpec project. RubySpec is a set of specifications, or tests, on how Ruby is supposed to run that was taken out of the Rubinius project. The objective was to have a common set of tests, not written in C, that could be run against any Ruby implementation to see if it had all the right behavior for Ruby. The reason why RubySpec is no longer is quite contentious but it seems like collaboration on the project wasn’t optimal between Ruby implementation. There was already a fork from people working on the MRI implementation that tackles some of the issues with RubySpec itself. At the very least we can, we can all agree that knowing how Ruby should behave matters.

Broader discussion available at: https://gist.github.com/nateberkopec/11dbcf0ee7f2c08450ea


RubySpec

Databound

Domas Bitvinskas dropped us a line yesterday to let us know about Databound, a Ruby gem that provides JavaScript a simple API to the Ruby on Rails CRUD. Basically it provides you a simple way to write ActiveRecord like functions directly from your JavaScript. So you can do things like User.find(1) from your JavaScript methods, and Databound will take care of calling into your Rails app to find the user with an ID of 1. You don’t even need a controller for the models you want to be able to query for, if you don’t already have one. All you need to do is write a line in your routes file specifying the model you want to be able to query for, and the columns you’re permitted to set from your JavaScript calls. This could be really useful if you want to write more code on the front-end, and less on the back-end.


Databound

How to test controllers in Rails

Occasionally it’s nice to cover a beginner tutorial, and we’d like to mention Cezar Halmagean’s tutorial on testing controllers in Rails. Controllers can be pretty easy to test assuming you know how to stub out calls and set expectations properly. Otherwise they can mimic your integration tests, which is not very useful.


How to test controllers in Rails

Remembering James Golick

Thanks for everything you did James.


Remembering James Golick

Sponsored by Ruby5

Ruby5 is released Tuesday and Friday mornings. To stay informed about and active with this podcast, we encourage you to do one of the following:

This episode was co-produced and edited by audio guru Jamison Rabbe.


Thank You for Listening to Ruby5
Read more at the source