Sunday, October 25, 2009

CSV to GeoRSS converter

A friend of mine was trying to mark on a map the location of 50 people as he read their names and addresses out of a database. The data changes slightly every month and he was doing it with a marker.

I told him I could plot the names on Google maps for him and so I built my first public web app. I've built a lot of web applications, but this is a first in many ways. It's the first time I've used Sinatra, DataMapper, Heroku, and Compass. It's the first time I imagined and created my own layout and styling, and it's my first app that I've tossed out there for people to use and play with. I'm trying to learn to participate more in the Ruby developer community.

The app converts a csv file into a georss feed and then redirects you to google maps with the url of the rss feed as the query string. That causes google maps to fetch the feed and display it's data an a map. The data isn't actually rss feed content, but the georss feed format is a super simple way of passing data to google maps.

Feel free to leave suggestions or check out the code.

Tuesday, October 20, 2009

RDoc: I'm converted

Working on a new rails app yesterday I happened upon a file I hadn't read before: doc/README_FOR_APP

Use this README file to introduce your application and point to useful places in the API for learning more. Run "rake doc:app" to generate API documentation for your models and controllers.

So I ran the rake task and looked at what it generated. Wow. I'm not a big fan of tests in rapidly changing prototype code, but I LOVE documentation when it is easy to add and easy to find. This rake task generates rdocs for your application. If you don't know, rdoc notes are very easy to add to your code.

The rdocs are hyperlinked and have the method bodies inline so you can drill down for more details when you need them. This really helps when you are working on a large code base and can't remember everything about it. Tests are good, but understanding the code you're working with is primary.