ruby method handedness

Mon, Dec 15, 2008

Once I’d binned Launchy and just used an OS X specific way of launching the browser for my new mini project, FlikBak, a Flickr backup utility, I got as far as listing all my photosets and getting down to image URLs. Then I ran the same code on the laptop. Big mistake! On the big mac I’m using 1.8.7-p72 and this works fine:

but on the laptop I’m running 1.8.6 and the same code gives the error:

So I looked a but more closely at the code. Seems I have the wrong mental model of how XPath.each works. I’ve been using XPath.first a lot and the result comes out the left side of the expression. XPath.each comes out the other end! This works:

At least it’s interesting and I’m getting somewhere with FlikBak. Might even add a UI to it.

comments powered by Disqus