03.02.09

Did you see what happened to the markets today? The whole world is ending.
Jobeet to the rescue???

In December, just as the world economy was falling apart and everyone was being laid off, Symfony released Jobeet, a set of 24 tutorials building a job board around Symfony 1.2. This replaced the long outdated Askeet, which was created for Symfony 1.0 then used far beyond its time.

The routing system was completely reworked to be made awesome in Symfony 1.2. As to be expected, everything is backwards compatible, making it easy for slow-goers like me to ignore all of the new features. Fortunately, Kris Wallsmith has caught my interest with a new article about using the new routing system to route by subdomain. You can find it here:

This particular problem was formerly solved in day of the Askeet tutorial. In that solution, a filter is used to parse the host and use that information.In Symfony 1.2, you can solve this same problem directly using the routing system itself. Check it out - it's also a great way to get your feet wet with what the new routing system can do. Go Symfony.

UPDATE The two topics referenced above (one in Askeet and the other in Kris's article) don't actually quite cover the same topic. The new article explains how to match a url based on a specific subdomain. It does not, however, allow you to match dynamic subdomains and use that subdomain as a parameter in your app (see the article's comments).

 
02.20.09

Lighthouse in Beautiful Holland, MI Lighthouse is an "issue tracker", which falls into the family of applications like Trac and Basecamp. Having just offloaded my svn repos via Beanstalk (hosted svn, it's completely awesome), I wanted to see if I could find a replacement for my VPS-hosted Trac installation. After all, Trac only works with subversion repositories located on the same server. So, in essence, moving my subversion repository to Beanstalk killed my repository-related features in Trac. Fortunately, Beanstalk is awesome enough to integrate easily into a number of different applications, including Lighthouse. So, in my bid to finally rid myself of my expensive VPS (I've always had it for just a few things I need), I decided to jump from Trac to Lighthouse. The results, I'm hoping, are more profit.

Converting your Trac stuff to Lighthouse

Even if you're just a small fry like me, you've probably got quite a few milestones, and tons and tons of tickets associated with your Trac projects. It would be a shame to lose those and a much bigger shame to convert them manually (gross). Fortunately, Lighthouse has a rich API and some smart guy named Shay Arnett programmed a nice little Ruby script to do all of this for you. And while I may be ruby-retarded, I had no problems with this script. In fact, it saved me from a ton of bullshit.

Trachouse - utility to convert Trac to Lighthouse

Trachouse is the script that reads your Trac tickets and adds them to your Lighthouse application. You'll need a few dependencies with this, like the lighthouse api, but if you speak only a little Ruby, you should be able to handle it. If you are a little more ruby-retarded like me, make sure you have activeresource. If you don't know what I'm talking about, try first to get rubygems then install it via sudo gem install activeresource.

To (hopefully) save some time, I've put together an archive of exactly what you'll need (minus some of the more core dependencies that you'll need like activeresource). You can download that archive below:

Download Trachouse... with slight idiot modifications I needed

How to convert: 6 or so easy steps

  1. Signup for Lighthouse
  2. Create your project in Lighthouse
  3. Manually create your milestones in Lighthouse - if you leave some out (that you have in Trac), that's no big deal
  4. Download my trachouse archive above and get all the dependencies
  5. Open up trachouse.rb in an editor and setup the config. There are 2 sections - one for lighthouse and one for trac. For the lighthouse project and milestone ids, just look in the lighthouse url - they're pretty obvious.
  6. From the command line, run ruby doit.rb
  7. Watch and enjoy - this isn't really a step, more just an unnecessary comment

An error that I got

I did get one error during the process:

./trachouse.rb:321:in `+': can't convert nil into Array (TypeError)

This occurs because trachouse is looking for the following type of string in the html code of a certain ticket

<span class="status">(closed enhancement: invalid)</span>

But if finds only this:

<span class="status">(closed: invalid)</span>

This occurs if you've disabled all the "Ticket Types" in Trac Admin. By default, "Ticket Types" include "Enhancement" and "Defect". If you've deleted both of these and saved tickets, you'll get the above error. I'm sure someone more versed in Ruby could fix this - but for me it was just easier to re-eneable "Ticket Types" and resave the few tickets that were lacking.

Getting rid of my VPS!

My VPS was born out of the embarrassing situation of creating an application that absolutely required the curl option CURLOPT_FOLLOWLOCATION to be enabled (I had no idea shared hosts disable this due to a security hole). Over time, my VPS has gotten loaded down with a few other things I depend on like svn (available over webdav) and trac. Thankfully, Beanstalk rescued me from my svn problem yesterday and Lighthouse from my Trac problem today. It's time to put $52.95/month back in my pocket. Thanks Beanstalk + Lighthouse.