Archive for the ‘Ruby’ Category

Ruby Hoedown 2008 Registration Now Open

The 2nd annual Ruby Hoedown will be held August 8-9, 2008, in Huntsville, Alabama. This is the southeast’s regional Ruby Conference, and the conference this year is hosted by hsv.rb (the Huntsville area Ruby and Rails User Group) and sponsored by Engine Yard.

The keynote speakers for this year’s conference will be David A. Black and Chris Wanstrath. If you’re interested in speaking at the Hoedown, proposals for presentations will be accepted until June 2. There are approximately 5 slots for full-length presentations (no more than one hour in length, with an additional 10-20 minutes for questions afterwards). You’ll also be able to sign up on the day of the conference for one of the approximately 8 slots for lightning talks if that’s more your speed.

If you register now you’ll pay only $149 (a savings of $50 off the standard registration fee). Last year’s conference in Raleigh was a blast, and I hope you’ll join us this summer in the Rocket City!

Ruby and Rails Resources

I’ve just added a new page of links to Ruby and Rails resources. It’s primarily intended for software developers who are new to Ruby and want to get up to speed as quickly as possible. Please leave any suggested additions in the comments.

Ruby Hoedown: The Motion Picture

The Confreaks were on hand to record the Ruby Hoedown 2007 presentations, and the rough cuts of those videos are now available here. They are released under the Creative Commons Attribution-ShareAlike License.

Ruby Hoedown, Day 2

By day two of the Ruby Hoedown, I had more or less gotten the hang of the whole “Inner Beltline” vs. “Outer Beltline” thing. If you know me, it will not surprise to hear that I had a little bit of trouble finding my way around Raleigh and got lost a few times on Friday. The problem is that when you go to get on I-440, they don’t tell you which entrance is northbound and which is southbound, because no, that would make it too easy. You have to know that traffic on the Inner Beltline goes clockwise around the city, and traffic on the Outer Beltline goes counter-clockwise, and choose your path accordingly.

The morning began with a breakfast sponsored by Microsoft: Krispy Kreme donuts and juice (Breakfast of Champions). A nice gesture considering that the previous evening’s keynote had referred to Microsoft as the “great satan of the northwest”. The first presentation of the morning was by Andrea O. K. Wright, who spoke about various game development APIs. This is yet another one of those subjects about which I know very little, so I was surprised to see such a wide variety of projects out there. I’m definitely going to check out a few that she mentioned, like Gosu, Ogre.rb and Shattered Ruby.

Next up was a series of lightning talks. I’m not going to list all of the topics here, but they were all good and to the point. I think this is the first conference I’ve attended that featured lightning talks, and it’s a nice way to provide a break between the longer sessions. After the lightning talks, we broke for lunch and a set of birds-of-a-feather sessions. I organized a BOF on the Semantic Web and Ruby, and it attracted a pretty good sized crowd. A handful of us were pretty familiar with the subject, while many of the others were just interested in hearing what it was all about, but we had a good discussion.

After lunch, Ken Auer spoke about whether Ruby has a chasm to cross, from the domain of technology enthusiasts and visionaries (where he feels it currently resides) to the pragmatists (a.k.a. the “early majority”). He argued that the public face of Ruby and Rails community doesn’t appeal to those people in the early majority because we aren’t addressing their needs; we need to focus on functional teams, serving the customer. His talk covered a lot of the same ground that Bruce covered in his keynote the previous day, but it was interesting to hear Ken’s observations from the perspective of a former Smalltalker. And I’d just never met Ken or heard him speak, so I enjoyed it for that reason too.

Next, Jared Richardson spoke about using C extensions to tune the performance of Ruby and Rails applications. He talked about writing extensions directly in C, and then moved on to RubyInline, and finally touched on the Ruby2C project (which, as he informed us, is developed by “two guys named zenspider and Ryan Davis“; yes, heckling ensued). None of this information was new to me, but during the conference wrap-up discussion, several people said that this was the most valuable thing that they had learned about during the Hoedown (“this” being the education about C extensions, not the revelation of Ryan’s split personality), so I’m glad that this talk was selected for the program. Also, I’d never had a chance to hear Jared speak, and he’s a really entertaining presenter. When the start of his presentation was delayed for what seemed like an eternity (due to various technical problems), he managed to keep the audience entertained by throwing boxes of Nerds candy to (or should I say, at) various audience members who answered his questions correctly.

Marcel Molina, Jr. had the final presentation of the day, with his keynote titled “What Makes Code Beautiful?” It was, as Marcel acknowledged, more of a “pop” talk, light on technical information, but he proposed a useful model for thinking about what we mean when we make the claim that Ruby code is beautiful. He emphasized three qualities of beauty (a la St. Thomas Aquinas): proportion (i.e. is the relative size of a bit of code consistent with its intent?); integrity (how well does this code do what it’s supposed to do?) and clarity (is it easy to understand)? These qualities can of course be in conflict with each other: extremely terse code might satisfy the need for proportion, but simultaneously violate the need for clarity. A lot of the discussion during the Q&A session went over my head, but it was a nice way to wrap up the weekend.

Chad and Marcel helped to organize a post-conference game of Werewolf, and thanks to Jim Meyer we were able to secure a place to play. A handful of the guys were experienced players, but it was the first time for most of us (including me), and it was a lot of fun. As Chad noted, it was a great way for us to really strengthen the friendships that we’d formed over the weekend, because, after all, there’s nothing that builds a relationship more than accusing someone you’ve only known for a couple of hours of being a shapeshifter. Thanks to the management of the Velvet Cloak Inn for letting us camp out in one of their meeting rooms until late into the night, and especially to their employee Caitlin who joined us for the last game of the night.

Ruby Hoedown, Day 1

It’s about 11:15 a.m. and I’m walking up the sidewalk to Red Hat Headquarters when someone coming out of the building sees my Seaside t-shirt and asks, “Hey! Is that Seaside the framework… or Seaside the town?” You know you’re around your own kind when you get a question like that.

Today was the first day of the Ruby Hoedown, the first ever southeastern regional Ruby conference. I arrived a couple of hours early to see if I could be of any help setting up, but Nathaniel pretty much had things under control, so my new friend Mark Barton and I walked to lunch a few blocks away. The walk didn’t take all that long, maybe ten minutes, but in the 100+ degree temperature weather that Raleigh had today it seemed much longer. I’m not normally a big Burger King fan, but when it appeared around the corner it was like an oasis in the desert. Luckily, we managed to find a shortcut on the way back.

Back at the Hoedown, more people had begun to arrive. We have about 125 in attendance, which is pretty cool considering that that’s two or three times as many people as attended the first RubyConf back in 2001. After some introductions, Ezra Zygmuntowicz (zig-mun-tuv-itch) spoke first, about Merb. It’s a web framework built on Mongrel and Erb that’s an alternative to Rails and which effectively replaces the ActionPack component of Rails (i.e. the view and controller). Ezra started Merb as a hack, to get around some performance problems with Rails. The guiding design principle is to keep the Merb core small and simple. Ezra feels that Rails has gotten too large and gets slower with each new release. Merb features non-clever code, such as a simplified routing system that leads to smaller stack traces (as compared to Rails) when something goes wrong. It’s a “hacker’s framework.” The upcoming 0.4 release of the framework should be feature complete, with all additional functionality to be provided via plugins.

Up next was Jay Phillips, speaking about Adhearsion, a Ruby framework for Voice over IP (VoIP) application development on Asterix boxes. This is a topic about which I know zero, but according to Jay, VoIP development sucks. An Asterix application is written as a “dial plan”, a long and difficult-to-read script. There are few if any database-driven VoIP applications, and code sharing is almost non-existent. Jay hopes to change that with Adhearsion, and especially with the Adhearsion.com web site. There’s a Linux distribution called AsterixNow, based on Red Hat, that provides an out-of-the-box solution for setting up Asterix. That distribution should soon include Adhearsion, maybe after the upcoming 0.8 release of Adhearsion. Due to technical difficulties we weren’t able to see a live demo of Adhearsion, but Jay promises to put screencasts up on the Adhearsion.com web site.

The last presentation this afternoon was Bruce Tate, speaking about “The Journey”: where we’ve been, where we are, and where we could go. Because it was such a compelling talk (not to say the first two weren’t compelling talks), I didn’t take a lot of notes. Hopefully, Bruce will post the slides on his web site.

I knew that we were supposed to have a social get-together, with food, at Pullen Park after today’s events. I even copied down the directions when Nathaniel announced it. But somewhere in there I missed the fact that the time had been moved up from 7:00 p.m. (when it was originally scheduled) to 6:00 p.m. So by the time I arrived at the park, everyone had finished eating and the caterers were packing up. Which is a shame, because if you know me, you know how much I love eating outdoors, what with the ants and flies. Luckily, I managed to snag a couple of pieces of fried chicken and a roll, and went to a nearby table to join the group there.

As I sat down, Marcel Molina was in the middle of what he called his “medium length” description of Werewolf (a.k.a. Mafia), a game which I’ve heard references to but haven’t actually had the opportunity to play. There was some talk of getting up a game tonight, but that plan sort-of fizzled due to lack of a suitable venue. Hopefully, we’ll be able to work something out for tomorrow. When I went to leave the park, and head back to the hotel, the song “Werewolves of London” was playing on the car radio. Coincidence? You be the judge.

Chained Builds in CruiseControl.rb (Update)

Last Thursday I wrote about the kind of chained builds functionality that I want from CruiseControl.rb. I think I’ve got it hacked in, at least to the “good enough” stage.

The first big change was to change the @trigger instance variable for the Project class from a single trigger to an array of triggers. I modified its name to @triggers to reflect this change. So in the initialize method for the Project class, instead of saying:

@trigger = ChangeInSourceControlTrigger.new
We now say this:
@triggers = [ChangeInSourceControlTrigger.new]
Next, I modified the buildifnecessary method to collect information from all of the triggers about which revisions need to be built.
revisions = []
@triggers.each { |trigger| revisions += trigger.getrevisionstobuild(self) }
revisions = revisions.uniq.sort
if revisions.empty?
  ...
I also made a change to the triggeredby method for the Project class so that it accepts multiple triggers, and so that it always adds triggers to the existing set (instead of replacing them). Here’s what my modified version of triggeredby looks like.
def triggeredby(*things)
  things.each do |thing|
    if thing.is_a?(String) || thing.is_a?(Symbol)
      @triggers << SuccessfulBuildTrigger.new(thing)
    else
      @triggers << thing
  end
end
This allows me to declare dependencies in my cruise_config.rb file like so:
project.triggered_by 'projectA', 'projectB', 'projectC'
I had to modify the logic get_revisions_to_build method for the SuccessfulBuildTrigger class a little bit, so that it wouldn’t return any build numbers from triggering projects that were older than the latest build of the “triggered” project. Here’s what that block looks like now.
if last_successful_build.nil? || project.find_build(last_successful_build.label)
  []
elsif project.last_build && project.last_build.label.to_i >= last_successful_build.label.to_i
  []
else
  [Revision.new[last_successful_build.label]
end
The last step was to add the spaceship operator to the Revision class, so that I can sort arrays of them.
def <=>(other)
  number.to_i <=> other.number.to_i
end
Note that the number attribute for the Revision class sometimes refer to an integer, and other times to a string. I suspect that this is a bug, but calling to_i on it does the trick for this purpose.

It took a bit of experimenting to get it right, but this seems to be working properly now. It took maybe a couple of hours to get it working, and the code was easy to read and understand.

Chained Builds in CruiseControl.rb

The good news is that there is some code in the trunk for CruiseControl.rb that addresses the need for chained builds. If you’re using that version, you can for example specify that a successful build of ProjectA should trigger a build of ProjectB.

# cruiseconfig.rb for ProjectB
Project.configure do |project|
  project.triggeredby 'ProjectA'
end
The bad news — which I didn’t realize until I had modified several (OK, all) of my cruise_config.rb files — is that:
  1. A project can only be triggered by one other project. If ProjectB depends on both ProjectA and ProjectC, too bad.
  2. Specifying that ProjectB depends on ProjectA disables the default build trigger, which checks for changes to ProjectB’s Subversion repository.
Looks like I’m going to need to look into the source code and see if there’s some way to hack in dependencies on multiple triggers. At a minimum, I’d want to be able to specify that a project depends on both a ChangeInSourceControlTrigger and one or more SuccessfulBuildTriggers.

How to Kill a Baby Lion

This may just be the most precious discussion ever held on the ruby-talk mailing list. It started out innocently enough:

Hey yall experienced coders and programmer dudes. I wanna make an MMORPG type game, but I have no programming experiance whatsoever.

He was advised to check out some great introductory programming books, like Chris Pine’s Learn to Program. When he responded with the classic cheapskate/lazyweb plea…

I sorta have no money to use on books and the like. I was hoping I could avoid buying anything by consulting the greater population of Ruby programmers.

… I knew that the discussion was going to have an unhappy ending. But I had no idea how entertaining the downward spiral would be. I don’t want to ruin it for you, but after being given pointers to free online learning resources, and being told repeatedly that he’d need to learn to walk before he could learn to run and learn at least the basics of computer programming, well — things got a little testy.

I will use my google skills now, TO FIND BETTER HELP. All of these tips were agravating, annoying, useless, telling me what I did wrong, telling me to do stupid stuff like that hellish Hello World crap, or all of the above. Not to mention, im going straight to dam C++. I have a better chance if I tackle the lion with my sword and shield rather than wait until the lion is hungry and attack it with the knoledge how to kill a baby lion. If you don’t get the anology, your not as smart as you think you are.

If you don’t have time to read it all, just stick to his posts. Great stuff.

Huntsville Ruby Users Group Meeting

The inaugural meeting of the Huntsville, Alabama Area Ruby Users Group will be held this Thursday evening (June 14) at 6 p.m.

Huntsville Ruby Users Group (hsv.rb) Meeting: Thursday, June 14, from 6 p.m.-8 p.m., at BizTech (515 Sparkman Dr.).

Ruby Hoedown 2007: Registration Open

Registration for Ruby Hoedown 2007, the first ever southeastern regional Ruby conference, is now open. Tickets are $100, and the attendance is capped at 150, so act fast!