Issue #26 - January 27, 2011
It's issue 26 of Ruby Weekly! Pay attention to the notable news this week - there's a nasty vulnerability in the 'mail' library you might get stung by so update if you can..
Clever Algorithms: Free E-book of Nature-Inspired AI Recipes for Ruby
Clever Algorithms is a newly released book by Jason Brownlee, PhD that describes 45 algorithms from the Artificial Intelligence (AI) field with Ruby-based examples. It's well produced and, notably, free in its PDF and online formats. A print copy is available at a small cost.
'Mail' Library Has Arbitrary Command Execution Vulnerability
The popular 'mail' library (as used by Rails 3 and others) has had a vulnerability that could allow arbitrary command execution with poorly formatted e-mail addresses when using Sendmail. It has now been fixed but you need to upgrade, especially if using Sendmail.
From Test::Unit and Shoulda to MiniTest::Spec and MiniShoulda
Ken Collins demonstrates moving from a Test::Unit and Shoulda-based testing setup to using MiniTest (which forms the basis of Test::Unit in Ruby 1.9.2) and MiniShoulda.
The Ruby Compendium - A 24 Page Ruby Ecosystem Guide
The Ruby Compendium is described by its author, Fabio Cevasco, as 'an essential guide to the Ruby ecosystem.' It's a 24 page PDF that presents info and links about a number of areas relating to the Ruby ecosystem. An interesting primer.
Authentication in Rails from Scratch - A Screencast
Ryan Bates' 250th episode of Railscasts digs into creating a password authentication system for a Rails 3 application from scratch. If you don't want to rely on plugins like Devise or Authlogic, check it out.
10 Ruby on Rails Best Practices
I only count 8 but.. Darcy Laycock, a Ruby Summer of Code graduate, presents 10 'best practices' for modern Rails developers including using reusable scopes, attr_accessible, virtual attributes, i18n, and the 'fat model, skinny controller' pattern.
Maze Generation: The Hunt-and-Kill Algorithm
Jamis Buck continues his fine 'maze generation algorithms in Ruby' series by looking at the hunt-and-kill algorithm. Diagrams and code abound.
Class Coercion in Ruby
Zach Church shows how to use the 'coerce' method to make a custom object interact properly with numeric operators. Thanks to John Hwang for the heads up on this.
Notable libraries and code
notify-me: A Sinatra App for 'Launching Soon' Sites
'Notify Me' is a 2 page Sinatra-based webapp that lets you collect e-mail addresses from people who want to be notified when your real app launches. It's all set to run on Heroku and instructions are included.
Chunky PNG: Pure Ruby PNG Library (Almost at Version 1)
It's not super-new but Chunky PNG is a cool pure Ruby library for reading/writing PNG image files and it's rapidly approaching a full 1.0 release with 1.0.0.beta1.
railsready: Ruby and Rails Installed on Ubuntu in One Line
Rails Ready is a small project by Josh Frye that makes it possible to install Ruby 1.9.2 and Rails on Ubuntu Linux with a mere one-liner.
Truncating HTML content safely
HTML-Truncator is a Nokogiri-powered library by Bruno Michel that makes it easy to safely truncate HTML content while still closing tags correctly.
Ruby Jobs of the Week
Ruby Developer [Palo Alto, CA]
Wildfire Interactive is a rapidly expanding, VC-funded tech startup in the social media marketing space. They're using Rails and Sinatra and building many 'pure Ruby' components so they want Ruby developers with full-stack experience. Oh, and testing is a must.
Rails Developer [Lewisville, TX]
Last but not least..
Turning IRB on its head with Pry
Pry turns IRB on its head by making it easy to attach an IRB-like session to any object (or binding) at run-time. Essential, it lets you bring a REPL session to your code rather than your code to a REPL session (as with IRB in its default state).