Ruby: The Next Generation

Captain's log, Stardate, uuuh, December 6th, eh, point five!

Okay, enough already with the lousy Star Trek reference. When you're a frequenter here on Planet Gentoo, you might have seen Diego talk about Ruby and mysterious new Eclasses. I think he covered the motivation and implementation details of what we call ruby-ng.eclass pretty well, so I'll try to give a little end-user info.

First of all, we, the Gentoo Ruby team are pleased to announce that this aforementioned Eclass was commited to the Portage tree yesterday, and that we made an important step towards to unmasking of Ruby 1.9.

Of course it will take more time to adapt all of our ~300 Packages (don't pin me down on that figure) to that new Eclass, but especially ~arch users should see them coming in gradually.

So, what is new for you?

The best thing about this new Eclass is that we finally have proper dependency structures even when dealing with multiple versions and implementations of Ruby, so you won't end up with mysterious failures in the middle of your emerge -vauDN world. Also, you now can control on a per-package base what Ruby versions you want a package installed for.

To accomplish this, we have introduced a new USE_EXPAND variable called RUBY_TARGETS. You might know this type of variable form APACHE2_MODULES, VIDEO_CARDS, or LINGUAS, they basically contain USE flags, just in their own variable.

By default, we set RUBY_TARGETS to ruby18 which means that your Ruby packages are all installed for Ruby 1.8. Later on, you will also be able to add ruby19 for Ruby 1.9, jruby for JRuby, or ree18 for the Ruby Enterprise Edition. (Please note that we do not recommend using any of these three yet, so install and use them with caution!)

RUBY_TARGETS can be as usual set system-wide in make.conf, or you can set ruby_targets_{target} in package.use for single packages. We recommend setting RUBY_TARGETS system wide.

In the emerge output you will see things like this: [ebuild U ] dev-ruby/test-unit-2.0.4 [2.0.3] USE="-doc -test%" RUBY_TARGETS="ruby18%* ruby19%* -jruby%" 128 kB

In that example, you would get test-unit installed for Ruby 1.8 and 1.9. It would also work on jruby, but you didn't want that.

So, that's what we were up to, as always, feel free to stop by in #gentoo-ruby on FreeNode and chat with us.

Posted by Alex Sun, 06 Dec 2009 12:12:00 GMT

Comments - (Leave a comment)

  1. Asheguy said 12 days later:

    I am teaching myself Ruby right now but have had trouble finding a distro that likes to keep pace with the Ruby development cycle, that goes for Rails as well. Good job guys!

Trackbacks

Use the following link to trackback from your own site:
http://a3li.li/trackbacks?article_id=9

  1. From Flameeyes's Weblog
    Gentoo's QA soft spots
    Gentoo’s quality assurance is a quite difficult task to keep running smoothly: there are problems at so many levels that it’s not funny at all. I’ve been doing my share of the work, both with the tinderbox effort and with manual ...

Leave a comment