且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ruby 1.8.6中的ruby 1.9方法

更新时间:2023-11-25 09:30:04

这正是我的瑰宝的目标 backports .

This is exactly the goal of my gem backports.

它在纯Ruby中实现Ruby 1.8.7以及Ruby 1.9.x和2.0的许多新功能.当然,这包括#combination#permutation#product#cycle.

It implements in pure Ruby all the new features of Ruby 1.8.7 and many of Ruby 1.9.x and 2.0. This of course includes #combination, #permutation, #product and #cycle.

您可以,例如:

require 'backports/1.8.7/array/combination'
[1, 2, 3].combination(2) # => works, even in Ruby 1.8.6

backports中的实现会通过大多数 RubySpecs (对于facets而言并非如此)来保证没有兼容性问题.

The implementation in backports pass most RubySpecs (which is not the case for facets) to guarantee not having compatibility problems.