Showing posts from May, 2007

Public Static Final for Ruby

When I first got into Ruby awhile back I found that I wanted to do something like I used to in Java:

public static final String BLUE = “blue”;

But darned if I could get the internet to tell me how, so here I am giving back to the community:

in solar_constants.rb:

module SolarConstants
MASS_OF_EARTH = 5.98e24

in some other file:

require 'solar_constants'
puts SolarConstants::MASS_OF_EARTH

or you can:

require 'solar_constants'
class Gravity
include SolarConstants

def print_mass_of_earth

This being Ruby you can, of course, redefine a constant. But you will get a stern warning.

EVDO Card on a Dell D620 Running Linux

One of the things that kept me from installing Linux on my laptop was concern about support for peripherals such as printers, digital cameras, USB devices in general, and my ThoughtWorks-provided EVDO card. The cool thing with Fiesty Fawn is that all except the EVDO card worked out of the box (I should say I had some trouble with my wireless on Edgy Eft). And the EVDO card only took about 5 minutes to get working after Peter Ryan pointed me to this article:

Get broadband wireless with Verizon EVDO and Linux

It's a few command line scripts to run and currently I haven't figured out how to turn it off or configure image detail (like you can with Verizon's software), but it works.

The Last Day of Rails Conf 2007

A light day for me as a 4 hour flight + 2 hour time change + wanting to see my wife for a few hours this weekend means I left early.

Before I get started I wanted to say a few words about Portland:

It's a great city. The train took us from the airport straight to the convention center (and our hotel which was 2 blocks away). Then we found out the train is free in the downtown area. So we had super easy access to bars/food/good times. Also the city, while being big enough to support an ecosystem of coolness is small enough to avoid being overwhelming.

Keynote – The Rails Way with Jamis Buck and Michael Koziarski:

General format of this talk was here's a submission we got for inclusion into Rails core and here is what's wrong with it. Oddly enough they called the people out by name – the ones who had the bad code. Not sure how I'd feel about being outed like that. [Correction: Koz informs me that people had submitted their code to The Rails Way (not core) and were as…

Thoughts on the Second Day of Rails Conf 2007

Keynote (AKA paid sponsor time) – Cyndi Mitchell (ThoughtWorks) and Tim Bray (Sun):

Cyndi seemed a bit nervous and well she should be – this is ThoughtWorks big play to mold the face of the Ruby/Rails world by announcing RubyWorks. RubyWorks is a “free, open source LAMP production stack is for RedHat Enterprise Edition and CentOS, and will allow users to quickly put Rails applications on production servers.” Pull it down, drop in yer Rails app, and you gots a server. It's all free, but if maybe you'd like some support we could perhaps sell you some. And we'll support JRuby. Pretty big move for us as a company. So why would we expose ourselves to this risk? Other than the tons of money we stand to make, ThoughtWorks feels like the Java/.NET world is all wrapped up with horrible bloatware and bad management practices and while we're still interested in fighting for change in those areas we feel think there's an opportunity to make a real impact in a wide open a…

First Day of Rails Conf 2007

Finished the first day of Rails Conf and here are my impressions:

DHH's keynote:
Lets celebrate what we have. Blah blah blah. Rails has come a long way. Yadda yadda yadda. Here's a sneak preview of what ActiveResource is going to be like in Rails 2.0. Ooooh, Aaaah.

Actually the ActiveResource stuff was pretty cool. With a little bit of setup you can have one controller method serve up xml and text and html and all sorts of stuff. All RESTful style of course. And the debugger will be back (broken when someone fixed a bug in Ruby 1.85) and it will be a real debugger.

When will 2.0 be out? He didn't say. Go use edge if you dare.

Bob Martin's Clean Code Presentation:
On the one hand, this is a lot of stuff I've heard before (I hung around Object Mentor at the start of my career), but Uncle Bob is such a good speaker he got me all fired up again about TDD, Red Green Refactor, and incremental steps. There was this point where a slide was clearly missing from the pre…