Ruby Future Roundup: Ruby 1.9.0-5 Released, JRuby Skips 1.8.7, Procs#=== For Case Testing
Ruby 1.9.0-5 Released
On Friday the 3rd, Ruby 1.9.0-5 was released by Yuki Sonoda, after the last delays, related to miniunit, were fixed by Ryan Davis. This release also marks the feature freeze for the upcoming version 1.9.1. (see the changelog for detailed information).
JRuby Not Going to Support 1.8.7
Marcin Mielżyński, one of the JRuby committers, proposed to drop support for Ruby 1.8.7 in JRuby:
Most 1.8.7 features that came from 1.9.1 are to make transition from 1.8 to 1.9 series easier. Majority of them is just a copy (with minor changes to match 1.8.x api), but there is a lot of tricky examples that behave differently under 1.9.x, 1.8.6 and 1.8.7 [...] it doesn't make sense to port all the behavior from 1.9.x to 1.8.7 since it would end up 1.9.x just without yarv and all the fancy syntax features (well, and encoding support of course).
Thomas Enebo and Charles Nutter agreed and added, that users should switch directly to 1.9 rather then writing code that only works in 1.8.7 (support for Ruby 1.9 in JRuby can be enabled with --1.9). Charles also posted their decision to the Ruby-core mailinglist., but no discussion has started yet.
Procs for Case Equality Testing
Ruby uses the ===-operator to compare the different cases in a case-statement. Ruby 1.9's Proc class just recently got a ===-method, basically just an alias for the call-method used to invoke the Proc. Now, this means that one can use a Proc object in a case-statement; it will get the case-argument as parameter. This trick was discovered by Aimred, who added the method themselves, before Matz integrated it into Ruby 1.9.
Dave Thomas shows an even more sophisticated application, using currying to create several Procs to check for the day of the week.
Dimitar Bakardzhiev Mar 29, 2015