Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Author Archives: Peter Cooper

By Peter Cooper / August 25, 2007

Seesaw2

Most Rails developers will be familiar with *** ****’s Mongrel, a great HTTP library used by most Rails developers to either test or deploy their applications (it’s also pretty great for building your own basic HTTP handlers too, but I digress).
Sometimes when restarting applications after code updates, some requests can be “lost” in the whole process, particularly in high-traffic environments. Seesaw, developed by Max Muermann and Matt Allen, however, resolves this problem by restarting your mongrel processes one by one so that availability is ensured. Seesaw is available as a gem (gem install seesaw), although this blog post is essential reading to learn about integration with Nginx and Apache. Read More

By Peter Cooper / August 25, 2007

Remember the infamous “Ruby on Rails Vs” videos by the guys at RailsEnvy.com that were such a hit at RailsConf? Well they’re back with two more..

Rails vs .Net

Rails vs PHP Redux

Read More

By Peter Cooper / August 25, 2007

Back in August 2006, Satish Talim began a course of free Ruby lessons. Over 100 people signed up and found them useful. The success of the program even led to Satish founding the RubyLearning.com site, a great Ruby resource for newcomers to the language. Satish has just let me know that he’s decided to run the course again this year, so if you’re a Ruby newbie, head over to Satish’s latest blog post where he explains what the lessons are, what you’ll get out of it, and how the system works. Lessons start from this coming Monday, 27th August. Read More

By Peter Cooper / August 24, 2007

Flog

Flog is a new and interesting tool that runs an “ABC metric” (measurement of the complexity of your assignments, branches, and calls) on your code and scores it accordingly. A high score will generally occur for complex code, and vice versa. Read More

By Peter Cooper / August 22, 2007

Proar

Pro ActiveRecord (previously known as “Pro ActiveRecord for Ruby”) by Kevin Marshall, Chad Pytel, and Jon Yurek is an advanced-level book about using the ORM database library used primarily by Ruby on Rails. To be published on September 10, 2007, the book is now ready to pre-order from Amazon.com for $26.39 (non affiliate link) and runs at 300 pages, so it’s likely to be a reasonably complete reference to using the library whether with Rails or not. Read More

By Peter Cooper / August 20, 2007

Railsrumble

In a similar vein to Rails Day comes the Rails Rumble, a 48 hour Ruby on Rails competition. You spend 48 hours developing a cool new Web application, and then all of the apps are judged through a peer-based ranking system in a variety of categories. The fun starts on September 8-9 and registration opens soon at RailsRumble.com. Sponsors include O’Reilly, ActiveReload, Apress, Peepcode, Linode, ActiveState, Pragmatic Programmers, Cashboard, Ruby East, Engine Yard, RoundHaus, and ThoughtBot, so be prepared for some great prizes. Linode is even putting up a VPS for every entrant to deploy their app.

With the extra time allowed and the peer-reviewing process, it seems like Rails Rumble could progress more smoothly than the Rails Days of past, and Ruby Inside will feature more information about the contest and the winners as things progress. Read More

By Peter Cooper / August 19, 2007

Yelp

Yelp.com is a site that lets people review bars, clubs, shops, and nightlife in various US cities. Yelp only began to offer an API a few weeks ago and Walter Korman wasted no time in releasing a client library for Ruby. It’s called, simply, “yelp” and lets you directly use Yelp.com’s data from your apps. You can do cool things like search for business reviews, locate business reviews by business phone number, and search for neighborhoods by geo-points or address/location. Read More

By Peter Cooper / August 19, 2007

Scrubytgoogle

Okay, his title is a bit misleading, but Peter Szinek, developer of Ruby scraping toolkit scRUBYt!, has put together a great article showing the process, from start to finish, of scraping Google results using Ruby “in no seconds”. In reality, it’ll take you at least sixty to read the post. Read More

By Peter Cooper / August 17, 2007

Alex Young, a UK-based Rails developer, has put together a great guide that looks at the different development patterns used in Rails plugins and helps you develop well-designed plugins of your own. Read More

By Peter Cooper / August 17, 2007

Vlad

The Ruby Hit Squad is a crack team of Ruby developers – formed of Ryan Davis, Eric Hodel, Wilson Bilkovich, and Shaners Becker – devoted to eliminating “needless complexity.” Its first product, Vlad the Deployer, is a Capistrano competitor, designed to provide a fast, uncomplicated remote application deployment tool, but without the supposed complexity Capistrano offers. This is a top team of developers, and this is a big first splash, so check it out because it’s bound to become popular in the Ruby world. Read More

By Peter Cooper / August 16, 2007

Gosu

Gosu claims it’s the “coolest gamedev library around.” That’s pretty hard to qualify, but with a focus on Ruby, I won’t be one to argue. It’s installable as a gem, with a simple gem install gosu, is MIT licensed (although the sound component is third party closed source), and works on OS X, Linux and Windows. It supports 2D graphics (accelerated with your 3D hardware), sound, and various forms of input (keyboard, mouse, gamepad, etc).

(Note: Sorry for the slow flow of posts on Ruby Inside this week.. I still have no broadband due to the house move, but it will be back on in the next few days.. Read More

By Peter Cooper / August 11, 2007

Bountyshirt
(from one of Bounty Hunter Inc’s great t-shirts – yes, you can buy this!)

Jay Philips has stumbled across an interesting technique that like Symbol#to_proc, allows you to define block actions more succinctly for methods like map and sort_by. It goes one step beyond Symbol#to_proc’s goodness, however, and makes things even tighter. He calls it the Methodphitamine. Consider this typical Ruby on Rails example to fetch a list of capitalized last names for all users in a database:

User.find(:all).map{|x| x.contacts.map{|y| y.last_name.capitalize }}

Using Symbol#to_proc, you end up with something like:

User.find(:all).map{|x|x.contacts.map(&:last_name).map(&:capitalize)}

But with the “Methodphitamine”, we get:

User.find(:all).map &its.contacts.map(&its.last_name.capitalize)

Learn more about it in Jay’s blog post. Read More

By Peter Cooper / August 10, 2007

Arscreencast

Gregg Pollack of RailsEnvy, co-author of the infamous Rails vs PHP/Java “commercials”, has put together a presentation cum screencast about ActiveRecord and object mapping in general. It’s based on a presentation given on June 16 to the Orlando Ruby User Group. He covers the origins of ActiveRecord, the rationale for its use, and walks through topics like many to many relationships, polymorphic relationships, and tagging. Read More

By Peter Cooper / August 10, 2007

Fixinfixtures

In “Fixin’ Fixtures” Chris Wanstrath looks at how to make working with fixtures in a Rails testing environment a lot less painful. His opening paragraph says it best:

The main problem with fixtures, for me, has always been how unfun they are. They literally suck the fun out of anything they’re around. You throw them in your test/ directory, then suddenly testing is, like, work. But it’s not work, dammit. This is Ruby, dammit.

So, keep them fun. Write your fixtures in Ruby.

Enjoy! Read More

By Peter Cooper / August 8, 2007

Performancetips

Ben Smith takes a look at using the YSlow Firefox plugin to improve the performance of Rails-powered sites. He shows how to tweak Rails applications (and even Nginx) to satisfy some of YSlow’s recommendations. Even though he doesn’t go into much depth, it’s a good post if it helps raise the awareness of YSlow in the Rails community. As I’ve been forced to use dialup and mobile Internet lately (and the trend will continue for others with the iPhone, etc) I’ve become acutely aware of the performance differences between well developed and poorly developed sites! Read More