Tuesday, November 25th, 2008 | Author: renaebair

I wrote my first little app in Ruby tonight. Well, that’s a lie. I’ve been writing cute little inapplicable apps for the last month but they’ve just been exercises out of Chris Pine’s “Learn to Program” book. Tonight I actually decided to write a very basic time tracking app armed only with the knowledge I’ve cultivated thus far and it came out swell. I know it’s quite basic and lame, so please laugh. I am laughing at it right now. But I’m learning as quickly as I can with only 2 hours of time a night available for learning Ruby. 

I did end up having to use a hack to display my time (from seconds) to a pretty-formatted date/time string. But I hope to come back to this problem later and come up with my own solution. It doesn’t store the data to a file yet but I’ll be adding that tomorrow evening. I know it will only take 5 minutes but the kids do wake up around 5am and I’d sure like to sleep now :)

Here’s the nuby code:

Category: Uncategorized
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses

  1. If you don’t want a hint on time formatting, don’t read this:

    You can feed the return value of time_track into a new Time object, which should handle readable formatting for you. I’ll leave it at that.

    I found your blog only recently, but I’m enjoying it so far.

  2. Thank you for the hint! I implemented it and it works!

  1. [...] app and it’s getting so out of hand. I took the advice of Ben regarding the time formatting (see advice here) and I’ve also added reading/writing to a yaml file. At this point it’s incredibly [...]

Leave a Reply