ruby-1.8.7 goodness

June 3, 2008 at 2:02 pm (Uncategorized) (, )

Version 1.8.7 of ruby has been released, with magical vendor-dir support that I don’t recall being in the first few pre releases. It looks like someone decided to hack the autofoo as well, to obey –libdir, although it seems that while the default site_ruby uses it, the default vendor_ruby doesn’t yet. Here’s an ebuild for it, if you need one, and I’ve already added it to arbor.

At work we’ve got an old app we still haven’t upgraded from rails-1.2.6, 1.8.7 broke it. The first breakage has been fixed in 1.8.7 with this patch, and the second breakage we’ve found is that String now has a .chars method, returning an enumerable, this doesn’t get on with activesupport-1.4.4/lib/active_support/core_ext/string/unicode.rb, which defines chars to return ActiveSupport::Multibyte::Chars.new(self). We’ve noticed this where using attachment_fu is trying to use String.first, and I’m sure we’d have noticed it in more places if we’d ever written our tests properly. For now, we’ll just cheat and use String.class_eval { remove_method(:chars) } to drop the new method, but soon I suppose we’ll actually have to get around to upgrading.

Permalink Leave a Comment

A present to the maintainers of the gentoo ruby herd

May 18, 2008 at 7:30 pm (Uncategorized) (, , , , )

A script that I liked to use, when I was a gentoo dev, was compare_gems.rb.

This script runs through a repository using Paludis::NoConfigEnvironment, so that it’s not actually necessary to configure paludis1. It grabs a list of all the packages that inherit the gems.eclass and then queries rubygems to find out which packages in the repository are lagging behind the published gems. It outputs all this infomation into a nice pretty html2 file.

This helped me to keep the gem ebuilds that I used up to date, and also told me all the other gems we had that had fallen behind. It’s not 100% perfect on matching, sometimes the gentoo package names don’t match the gem name, and it won’t do anything clever, like checking the src_uri, to find out what gem it should really match

1. This isn’t strictly speaking true at the moment, as I’ve just jiggled it around to work with the latest trunk of paludis, so you’d need paludis-scm installed to use it, but I’m sure ciaranm will tag another release soon.

2. OK, this is also somewhat truth deficient, as I’ve misplaced the stylesheet. The only copy I had was on dev.gentoo.org. I would ask for it back, as I understand they don’t generally delete your homedir straight away, but robbat2 is away, and he’s the only one I trust to do it competently, having seen another member of team infra announce “HERE’S YOUR HOME DIR IN A TAR >>> http://free.for.all” in a public IRC channel to someone else.

Permalink Leave a Comment

A present to the third world

May 17, 2008 at 7:52 pm (Uncategorized) (, , )

A few people, i.e. at least two, have come into #paludis to ask for help with fetching distfiles. Their specific problem is that the computer they want to update doesn’t have a fast connection to the internet, so they want to generate a list of files to download, take it to another machine that does have a relatively fast connection, download the files, and take them home again.

The usual answer these poor people receive is that they should upgrade their internets. Sometimes, they are told that the mysterious “dleverton” is thinking about possibly maybe one day writing a client that may achieve their goal for them. Today, I have made their dreams reality, with the world’s worst ruby script.

Run the script with just one target, and theoretically it will send to the files you need to download, in the format:

filename,download_location_1,download_location_2,…

The script is still in its first draft form, but it should work, and I may update it to be less stupid, to bind to more paludis source (rather than just copying it to ruby) and to have more polite variable names. To use it you will need paludis-scm installed, as I only commited the mirrors binding stuff today.

Good luck, you’ll need it.

Permalink Leave a Comment