The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
My Latest Projects - ZenLibrary and Graffle2SQL

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ryan Davis

Posts: 651
Nickname: zenspider
Registered: Oct, 2004

Ryan Davis is a ruby nerd.
My Latest Projects - ZenLibrary and Graffle2SQL Posted: Jan 23, 2005 3:02 AM
Reply to this message Reply

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...
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Ryan Davis
Latest Posts From Polishing Ruby

Advertisement
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):

library screenshot

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:

library 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):

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |   665 |   558 |      14 |      92 |   6 |     4 |
| Helpers              |   212 |   189 |       0 |       8 |   0 |    21 |
| Models               |   113 |    98 |      13 |      11 |   0 |     6 |
|   Units              |   120 |    84 |      12 |      12 |   1 |     5 |
|   Functionals        |   867 |   670 |      26 |     123 |   4 |     3 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  1977 |  1599 |      65 |     246 |   3 |     4 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 845     Test LOC: 754     Code to Test Ratio: 1.1:1

Read: My Latest Projects - ZenLibrary and Graffle2SQL

Topic: Lamp Switched On, Rails Illuminated Previous Topic   Next Topic Topic: Matz Will Talk At Developers Summit 2005

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use