Ruby and the Photoblog

It is no secret that I like to publish photographs. My favorite subject, of course, is Hailey. For many months I have been trying to force myself to sit down and write an photo gallery package. I do web-based programming every day at work, and by the time I get home I don’t feel like doing any more. It just isn’t fun, or it wasn’t fun. The other day I discovered, from an almost non-topical link, a new and fun web programming framework written in a relatively new, and completely object orientated, language called Ruby.

I can program in Perl, and was starting to learn PHP. There are many photo gallery packages written in PHP that could be customized for my needs but programming in PHP seemed like work again.

Enter Ruby, and the application framework called Ruby On Rails. Rails follows the MVC pattern and was like Struts which I was interested in for a brief period of time.

I was able to learn enough Ruby to write my first Ruby On Rails application in about 8 – 12 hours. This time included many breaks to get caught up on the latest news at the various sites I like to visit. One of the great things about Rails is its documentation. There are two movie files to introduce the new users to the rails mindset.

My first application is a photo gallery tool called Ansel, named in honor of my favorite photographer. It has categories, or galleries, and supports thumbnails, web-sized images, and clicking back and forth through the pages of the gallery.

I also wrote a thumbnail generation script which will make square thumbnails for each photograph in my collection. This too was written in Ruby and it took about 5 minutes. My last attempt at thumbnail generation script was abandoned after 30 or so minutes.