Ruby or Rails

Category: Ruby or Rails

Autotest notifications in KDE using DCOP and KNotify

Thursday, August 24th, 2006

Tests failed warning window

I recently came across a killer ruby application called autotest, which is part of a package called Zentest.

Geoffrey Grosenbach’s Nuby on Rails blog explains how to use autotest with Rails. It’s pretty simple, install Zentest:

gem install ZenTest

and from the Rails project’s root, type:

autotest -rails

Monitoring a console for failed tests is annoying and keeping an open console on-screen is too screen real-estate expensive on a 14 inch laptop. Enter KNotify and DCOP.

Create a file called .autotest in your home directory and paste the following code into it:

1
2
3
4
5
6
7
8
9
10
#!/usr/bin/ruby
module KDENotify
  def self.knotify title, msg
    system "dcop knotify default notify " +
           "eventname \'#{title}\' \'#{msg}\' '' '' 16 2"
  end
  Autotest.add_hook :red do |at|
    knotify "Tests failed", "#{at.files_to_test.size} tests failed"
  end
end

Once autotest is started and coding has commenced, a passive pop-up window will appear as soon as a saved file has caused a test to fail.

This is all made possible by autotest’s excellent design along with the genius that is KDE.

The Rise of Ruby

Monday, July 31st, 2006

Perl rehab t-shirt

Tim O’Reilly reports that according to Nielsen Bookscan, sales of Ruby books have passed sales of Perl books.

It should be noted that sales of Ruby on Rails books is counted along with Ruby and also that these sails are “driven by recency”, and sales of Perl could spike when Perl 6 comes out.

This is interesting news nonetheless.

PHP still rules the roost under the web’s hood, so to speak, but Ruby is now definitely more than a lightweight contender.

Branding Ruby on Rails

Thursday, April 27th, 2006

Book cover: The 22 Immutable Laws of Branding

Some books you have to buy, others you have to have stuffed down your throat by friends. One such friend who is a business student at Reykjavik University recently sent me one of his favorites: The 22 Immutable Laws of Branding.

He assured me that even if the cover is ugly, the content is good.

The book’s introduction gives its geographical origins away:

What is branding? From a business point of view, branding in the marketplace is very similar to branding on the ranch.

Branding on the ranch?

All jokes aside, the book is quite interesting. One of its themes is that a brand’s scope effects its impact. A strong brand has a narrow focus. Broadening the base of a brand and widening its appeal may yield a short term increase in sales but on the long term it often undermines the brand and decrease sales.

This theory is interesting in the Rails vs. Java debate. It certainly seems that 37signals and the Rails team have grasped the concept of the power of a narrow focus when it comes to “branding” Ruby on Rails (see: Are you sure you want to be mainstream? and Distinguishing power from versatility).

It seems that the “laws of branding” apply as much in the market for programming languages as they do in retail.