Saturday, May 2, 2009

Productive Geekness

Having a few extra days off with absolutely nothing planned and nothing social on the agenda just begs for a time to nurture the inner geek. The amount of tech stuff I wanted to check up on or try has been piling up for the last weeks and I finally got some time for it.
Having nothing on the agenda whatsoever keeps the head clear and brings on a state of zen. There is no hurry and all the freedom to really dive into something and keep going at it until you understand or until something works.

I started off reading a few chapters from 'Practical Ruby Gems'. It's about Ruby Gems, a system for packaging and distributing ruby programs. It's much like the Advanced Package Manager on Debian and Ubuntu systems. It also lets you download and install Gems and has a handy versioning system that lets you install and use different versions. Some basic usage:

gem list shows all the Gems you have installed
gem list -r shows all the Gems from RubyForge, the internet Gem repository.
gem list -r foo shows Gems that have a name starting with foo
gem install Installs the Gem called 'bar'
gem uninstall Uninstalls the Gem called 'fubar'

Using a gem inside your Ruby code goes like this:

require 'rubygems'
require 'somegemname'

After that you can call the methods that the Gem provides just as if you had written the method in your own code already.

Being a total screencast fan these days, I watched a few screencasts on Ruby Gems as well. 'Under the hood, an intimate tour of some gems among gems' was the best.

Find some more info on the Ruby Gems website.

Yesterday I used the ActiveRecord Gem. ActiveRecord handles Database stuff for you in a way that's both easy and independent from what database management system you use. While I had some struggles with the code examples in the book (I really, really hate that), and some dependencies from mysql, I managed to get it working.

Usually, when you are confronted with some problem and figured it out after some time, you are confronted again by it a few months later. Usually I don't remember enough about it to solve the problem and must endure enhanced frustration 'why did I not write that down!'.

Since I was rather zen yesterday, I decided to implement a private wiki to document my stuff. The ammount of choice was overwhelming, I'll save you the whole story but in the end I wounded up with Instiki. A very simple Wiki, written in Ruby. It was running in a few seconds. I'm not completely happy with it though since it does not seem to support code markup.

Anyway, time for me to dive into something new!

1 comment:

  1. Very informative post. Though I am not too much into coding, it does look interesting and I will definitely have a look.

    I am curious about the wiki.