Episode #258 - March 27th, 2012
Factory 3.0 says bye to Ruby 1.8 and Rails 2, heroku_san ensures you do your deploys right, Bullet 2.3.0 speeds up your queries, gambas inlines your PDF generation, RVM asks for a testing hand, and Jared Carroll shows how to test an external API.
This episode is sponsored by Top Ruby Jobs
If you're looking for a 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.
Factory Girl 3.0 says bye to Ruby 1.8 & Rails 2
Late last week, Thoughtbot announced the release of Factory Girl 3.0. Ruby 1.8 and Rails 2 are no longer supported and the vintage syntax of Factory.build, Factory.next have also been deprecated.
You can still use FactoryGirl if you’re in 1.8 or Rails 2 by just using an older version of factory_girl_rails.
DRY DevOps with heroku_san
Heroku San by Elijah Miller allows you with just one command to turn maintenance mode on, deploy the app, run all pending migrations, restart the app, and then disable maintenance mode.
It works across all heroku stacks, and gives you a heroku.yml file that allows you to configure things like auto-tagging your deploys, specifying heroku config variables, and specifying multi-stage environments.
Bullet 2.3.0 makes your queries faster
In late 2011, Rails 3.2 introduced automatic EXPLAIN statements for slow queries in development mode. The Bullet gem which reached version 2.3.0 this week end goes a bit further by notifying you when you should use eager loading, when it’s not really necessary, and when you might want to use counter_cache.
This new version introduces even more speed with 10% faster queries for Active Record 3.0, 48% faster than that for Active Record 3.1 and 40% for Active Record 3.2, according to Bullet's developer, Richard Huang.
Inline PDF with gambas
Gambas by Artan Sinani makes it easy to produce inline PDF files using normal Rails view templates, using the Prawn library.
RVM needs your help
Michal Papis, over on the Engine Yard Blog, posted an update to the current status of RVM. And one major item to note is that rvm is now more stable thanks to a testing framework built around it, and that has enabled the team to now release RVM stable via, well, rvm get stable.
The framework – called DTF, or Deryl’s Testing Framework – allowed work to begin on RVM 2.0.
The RVM team is asking that everyone contribute their RVM use cases to make the test suite is as robust as possible. If you do something interesting with it, it would behoove you to add a test for it to make sure the functionality remains in the 2.0 release.
How to test external APIs
Jared Carroll released a great writeup over on the Carbon Emitter, where he details how you should test external APIs.
He walks through how to use RSpec and Capybara to write a failing integration test and shows how to make those tests pass step-by-step. He creates domain models, an adapter layer, shows how to stub collaborators when unit testing, and ultimately shows how to make the whole thing work, and even tosses in a little VCR to make it fast.
RailsConf 2012 Beginner Track
Code School is helping with the beginner track of RailsConf this year. Unlike previous RailsConfs where a tutorial day was held before the conference, this beginner track will parallel to the standard tracks.
We'll be running Rails for Zombies 1, Rails for Zombies 2 and Rails Testing for Zombies along with a bunch of smaller introductory talks.
Additionally, the 6 Ruby Heroes for 2012 have been selected and will be announced live in Austin.