Archive for February 2010

rails 3, finally

I’ve finally started diving into Rails 3, with a few issues. In general the way you code an application works the same, with some changes in syntax. Behind the scenes there are a lot of differences. Mostly I’m finding that the complications are with plugins and gems.

Also, it came up in an online conference that Rails3 and Ruby1.9 is easier on 1.9.2-head rather than 1.9.1. I’m not sure if some of my earlier problems were because I of this, but since updating ruby versions things have been stable. [Note: 1.9.2-head and 1.9.1-head may be the same thing based on what I'm seeing online, at least from rvm's point of view]

Last I touched cucumber was about a week and a half ago, but avoiding massive failure was painful enough that I stopped fiddling with it… at that time, it looked like the main repository was only Rails 2 compatible, and installing it at all required a link directly to @alg’s fork.

Rspec is a little further along, in that you can install it to the system using rubygems.

gem install rspec-rails --pre

This is not so bad. It’s a little rough around the edges, as features are being added group by group. As of yesterday, it’s in an a9 release. Route specs are not yet supported, causing some red in my terminal. But other than that it’s already very usable.

The main issue so far is that @ryanb’s CanCan is raising unexpected nil errors in my specs. This issue relates to the problem… at the moment I’m unclear whether the issue is in CanCan or with Rspec… my guess is the latter, but unfortunately they’ve taken down their issue tracker to avoid premature bug submissions. That said, digging through rspec-core is kind of fun.

img2png

I just pushed a new web tool live. It’s called Img2Png, and it provides a simple mechanism for converting online images into PNG files. Basically, all you have to do is rewrite the image URL into one that points to png.heroku.com.

http://png.heroku.com/http/path/to/image.gif

This will redirect to a new url, which has a .png extension:

http://png.heroku.com/http/path/to/image.gif/i.png

This is pretty rough so far, especially since it was thrown together in less than four hours. The main downside is that I’ve only tested it on GIF files. It also relies on ImageMagick, which is kind of wonky on my computer. So… I have tests written for everything, but I need to loop back in later and run them once I get libpng and IM to talk nicely on my laptop.

http://png.heroku.com
http://github.com/sax/img2png

Not sure if this will be interesting to anyone else, but if anyone has improvements shoot them my way or add tickets on github. I set up a Lighthouse page for the project, as well.