Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Ruby 1.8.7 Released: Enumeration Object Support Backported From 1.9

By Peter Cooper / June 2, 2008

ruby187.png

With all the excitement surrounding RailsConf 2008 and the Maglev announcement, news of the release of Ruby 1.8.7 passed rather quietly. The download URLs can be found here, but note that the official Ruby-Lang.org download page does not reflect 1.8.7's release yet.

Ruby 1.8.7 is a point release of the stable, production-ready 1.8.x branch, so it should be ready to roll out to your deployment environments but be cautious. It features many bug fixes, but also some performance enhancements and significant back-ports of Ruby 1.9 functionality (enumeration objects in particular). More information is available in the release NEWS file. The most interesting developments include:

vendor_ruby

A new library directory named `vendor_ruby' is introduced in addition to `site_ruby'. The idea is to separate libraries installed by the package system (`vendor') from manually (`site') installed libraries preventing the former from getting overwritten by the latter, while preserving the user option to override vendor libraries with site libraries. (`site_ruby' takes precedence over `vendor_ruby')

securerandom

securerandom is a Ruby 1.9 library that's now part of the Ruby 1.8 standard library too. Example: require 'securerandom'; SecureRandom.random_bytes(16)

Array#flatten changes

Array#flatten now takes an optional argument that determines how deep to perform flattening.

Array method changes

Array#collect!, Array#map!, Array#each, Array#each_index, Array#reverse_each, Array#reject, Array#reject! and Array#delete_if now return an enumerator if no block is given. Array#pop and Array#shift now take an optional argument specifying the number of elements to remove from the array.

Binding#eval

Binding#eval is a new method to enable evaluations to take place in the context of a binding.

Enumerable::Enumerator added

Enumerable::Enumerator adds support for enumerations to be dealt with as objects, as in Ruby 1.9.

Enumerator support on many classes

Many methods based on IO, Integer, Array (see above), ARGF, Numeric, ObjectSpace, Range, String, and Struct now support returning enumerator objects where no blocks are given.

net/smtp

net/smtp now supports SSL/TLS connections.

These items really only scratch the surface though. Dig into the NEWS file for more info.

Comments

  1. Giles Bowkett says:

    Somebody told me odd-number point releases mean experimental releases - check the history of 1.8.5 and 1.8.3 to be sure. That's why 1.8.7 hasn't gotten a huge response (and 1.8.8 probably will).

  2. Peter Cooper says:

    I thought the odd/even versioning concept had been dropped with Ruby sometime in the last couple of years? Perhaps not, but it's something I've heard a couple of times.

  3. Mike says:

    @Giles: That's what Linux kernels used and some projects copied. Ruby does not follow that.

  4. Daniel Berger says:

    Considering how little testing the core team does, every release is an experimental release Giles.

Other Posts to Enjoy

Twitter Mentions