Closures in Ruby
Bruce Tate continues his fine Crossing Borders series with a look at Ruby's support for closures. If code blocks and block techniques used by routines such as Rails' respond_to confuse you, it's a great primer.

Bruce Tate continues his fine Crossing Borders series with a look at Ruby's support for closures. If code blocks and block techniques used by routines such as Rails' respond_to confuse you, it's a great primer.
Vsevolod Balashov has taken a PHP PageRank decoder and rewritten it in Ruby. It works and it's fast. Simply, it retrieves the PageRank value for a supplied URL from Google and decodes it back to the PageRank value between 0 and 10. Each page indexed by Google has one of these numbers, and have historically represented how well linked a Web site is and how well it will rank in Google. The usefulness of PageRank has dropped a lot in the past year or two, but it can still be a useful indicator of how significant a Web site is.
Russ Olsen has been putting together a small series of blog posts about building a DSL in Ruby. The first part dates from October 2006, but the second part has just been released, making it a good double length read. In the mini-series, Russ looks at the motivation for developing a DSL and develops a basic DSL called Potemkin.




License: Creative Commons Attribution-ShareAlike 2.0. Copyright, Why The Lucky Stiff.

You're about to start a new Rails project. Do you type rails <project name>? No, "Stop using the rails command", says Josh Susser. If you create a dummy / default Rails project that's set up just the way you like it with plugins, your own extensions, and all those carefully defined svn:ignore flags, you can just create a new Rails project with a simple svn copy. So simple, but I've totally missed this idea, and it's a real timesaver.

Amy Hoy has written a great tutorial running through the Rails console that's suitable for both complete novices and experts (there are a couple of tricks she mentions that I didn't know at least!). Amy appears to have taken up Slash7 with a new zeal lately, so let's hope we'll see more great content like this on her blog through 2007!