Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

Interesting Ruby Tidbits That Don’t Need Separate Posts #15

By Peter Cooper / February 4, 2008

Fixing Ruby & Rails' slow performance with patches!

Gleb Arshinov has put together an information packed post about how to speed up Ruby's garbage collector, particularly to speed up Rails applications, as well as how to speed up Rails by applying a few interesting monkey patches. This is a compelling must read for performance junkies!

The Guerilla's Guide to Optimizing Rails Applications

Following on from this Ruby and Rails performance post (above), Gleb Arshinov moved on to writing The Guerilla's Guide to Optimizing Rails Applications, another must read for Rails optimizing and performance junkies.

Scoped Structs for your classes

Mike Ferrier has created an interesting gem called scoped_struct that provides you with the ability to roll out structs within sub-scopes of a class. As always, a code example demonstrates best:

class Player
  scope :fumbles do
    def dropped; end
    def lost; end
    def recovered; end
  end

  scope :passes do
    def attempted; end
    def completed; end
  end
end

my_player.passes.attempted
my_player.passes.completed
my_player.fumbles.recovered

(Thanks to Pete Forde of Unspace for the lead.)

Solving data problems with Oracle SQL, Linux and Ruby

Casimir Saternos has written an article for Oracle that demonstrates how to use Ruby along with Oracle SQL and Linux to solve problems involving sets of data. If you want to know how to use an Oracle database with Ruby, it's worth a look, although it's not suited for those already particularly experienced with both Oracle and Ruby.

High Performance Event Library for Ruby 1.9

It's still early days, but Rev is a high performance event library for Ruby 1.9 that uses the C library "libev".

Other Posts to Enjoy

Twitter Mentions