Geekvicious Journal

Hands-off my global namespace.

We’ve using merb + datamapper lately at work. Since data mapper 0.3.0 was released recently I decided to upgrade my own branch today. After updating the gem I ran my tests…just to get some very strange behavior. NoMethodError exceptions from trying to access the method ‘suit’ in classes that had nothing to do with my tests nor the classes I was testing (testees?).

After hours minutes of frustration, I tracked down the exception to ruby’s Test::Unit::Collector, which relies on the standard behavior of the < operator between classes (A < B if A child of B). It turned out that data mapper 0.3.0 monkey patches Class, mixing-in Comparable and overwriting <=>, as a side effect Test::Unit becomes clueless about which classes are tests and which are not and starts calling ‘.suit’in every single class in the ObjectSpace.

Well, after all monkey patching might be destroying ruby.


Gvim + Rails

I’ve been using aptana’s RadRails Eclipse plug- in to develop RoR apps for over a year, it has lots of nice features and has been working fine for me, however it is resources consuming, and heavy. in one phrase: RadRails is a nice IDE although far from perfect.

Probably, because of its architecture Eclipse is not very compatible with the Unix and Rails approach: ” Do one thing and do it right” , instead it does everything, and works well most of the time but, still feels awkward when developing rails.

Lately I rediscovered Vim probably the best Unix editor ever ( no matter what emacs fans would say ) and a really nice and small plug-in , that makes rails integration immediate and unobtrusive. It includes syntax highlighting, auto completion, easy rails navigation, Rake integration… and some more features.


Yet another autotest desktop notifier … OSD

Being a big KDE fan I was glad when the people from snailbyte came up with KDE desktop notifier for autotest. Even though KDE is by far my favorite desktop environment, knofity has a big drawback; it is not possible to choose the color, for the notifications. So based in the growl autotest notifier, I wrote a version for osdsh an X OSD manager, it is not as pretty as growl ;) … but it gives me colorized desktop notifications on linux.

To use it just make sure you have installed osdsh, and it is running:


me@my_machine$ osdsh

Then put this in your .autotest file:


module OSD

  def self.osd  msg, color
    system "osdctl -e \"dset(C,#{color})\""
    system "osdctl -s '#{msg}' "
  end

  Autotest.add_hook :red do |at|
    res = at.results[/d+ tests.*$/]
    osd  res, 'red'
  end

  Autotest.add_hook :green do |at|
    res = at.results[/d+ tests.*$/]
    osd  res , 'green'
  end

end

Painless skype in 64 bits (K)ubuntu

I recently got a new laptop , a dell Inspiron 1501. Having a 64 bits processor, it seemed to me kind of wasteful to use a 32 bit OS, so I took the easiest road, a 64 bits Kubuntu install; all the hardware worked out of the box except for the expected Broadcom’s wi-fi problem.

But when it came to install Skype, well not so painless. I need to use Skype for various personal reasons, so I *had* to install it.

First I tried using linux32 and the debian package provided by the Skype’s download page, it just wouldn’t… since Skype 1.4beta uses QT4. Then I tried with the static version, same story, it kept complaining about libsigc2 not being found even after I installed all the versions reported by aptitude.

After some hours of frustration I found getlibs a little application that did everything for me in one command

getlibs skype_static-1.4.0.74/skype

and voila.. it just worked!


Wikinquisition

There aren’t many more experienced censors than our good old catholic friends, for centuries the Holy Inquisition burned at the stake whitches and heretics in order to purify the faith.

They also occupied a good deal of their time controlling the public opinion, baning and burning impious books. Thankfully except for the most backwards societies they can’t do that anymore; however they still try to manipulate the public opinion as much as they can.

Their last attempt: wikipedia , a usual they blame everything on some “bad guys” using the Vatican’s computers. Hard to believe knowing who is in charge now.