Saturday, July 08, 2006

[tech] Ruby Rocks

Woke up too early today. So I spent the morning playing through the rocking Ruby tutorial at http://tryruby.hobix.com/. Guided tutorial with an interactive fully-working in-browser interpreter. Absolutely beautiful. I wish I made it.

Some fun bits:

>> Popup.make do
.. h1 "I should be watching Saturday morning cartoon instead"
.. p ".. but instead I'm playing with Ruby"
.. link "TryRuby", "http://tryruby.hobix.com"
.. end

>> Time.now - 2.weeks
=> Sat Jun 24 09:13:34 UTC 2006

>> def load_comics(path)
.. comics = {}
.. File.foreach(path) do |line|
.. url, name = line.split(': ')
.. comics[url] = name.strip
.. end
.. comics
.. end