Working with Ruby
Occasional blog posts about Ruby updates, tools, editor tweaks, and random snippets. You might also be interested in my newer project that docuements lesser-known features in Ruby: Idiosyncratic Ruby.

Project Euler 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 (Ruby)

More solutions for the projecteuler.net problems. Some of them are solved using 1.9.2 features.

…read

Become a Proc Star!

One useful (and funny) feature of Ruby is the Symbol#to_proc method that lets you write concise code like this: %w|1 2 3 4|.map(&:to_i). Almost everyone who knows this feature loves it ;). However, the use cases are pretty limited, because in most cases you need to pass parameters!

…read

The has_many_booleans Rails plugin

has_many_booleans is an ActiveRecord plugin which creates virtual boolean attributes for a model. When the object gets saved, the plugin transforms all attributes into a single integer, using a bitset. So you can easily add new attributes without changing the database structure.

…read

New Array and Enumerable methods in Ruby 1.9.2: keep_if, chunk...

In Ruby, dealing with Arrays and similar objects is pretty fun. And we have gotten more possibilities with Ruby 1.9.2 :)

…read

The 28 Bytes of Ruby Joy!

The 28 Bytes of Ruby Joy will notably clean up your code:

…read

Just another "Ruby code is beautiful" presentation ;)

These the slides for my proseminary about the Ruby syntax. It is loosely based on an essay by Yukihiro Matsumoto which is published in the O’Reilly book Beautiful Code. It is released under a creative commons license.

…read

Upgrading to Rails 3: Obstacles and helper scripts

Transferring an existing project to Rails 3 is not that hard, but it usually cannot be done in 5 minutes.

…read