This post originated from an RSS feed registered with Ruby Buzz
by Ryan Davis.
Original Post: My Latest Projects - ZenLibrary and Graffle2SQL
Feed Title: Polishing Ruby
Feed URL: http://blog.zenspider.com/index.rdf
Feed Description: Musings on Ruby and the Ruby Community...
You have 323 books from 363 authors and 67 publishers, 274 CDs from 120 artists, 44 DVDs from 40 directors, 2 games on 2 platforms, filed in 26 categories and located in 6 locations.
that is the front page of my latest webapp. A learning project to learn Ruby On Rails, a very nice web app framework that combines MVC, dynamic coding, and ruby rather well.
milestone 1) book title and author - 10 minutes
milestone 2) separate author and book tables - 20 minutes
milestone 3) real data from my website + location and category tables - 30 minutes
one hour and I had a rather well functioning library app w/ all my books in it. Really.
several milestones later and I have a VERY well functioning library app, fully normalized using utilities I added to help me with that (FINALLY! LoC can bite my ass!), supporting books, music, video and games with all my data in it.
It even looks pretty (not that grayson thinks so...bastard):
Anyone who's coded with me knows that while I try to make my code pretty, I don't do interfaces. But... rails made it so easy to do everything else that I actually bothered to make it pretty.
To top it off, I started a side project. Using the latest (internal) version of omnigraffle and an applescript I wrote, I now have automatic SQL generation. No more SQL for me!
Check out the schema:
This was made with OmniGraffle (very very easily I might add, using OG4, which is not publicly available yet) and then automatically converted into an SQL schema via applescript.
Just to drive it home... I did this in 845 lines of ruby. (I think that number is model/controller only, not view):