Is there a gem or a library to get ruby 1.9 methods like
[1, 2, 3].combination(2)
[1, 2, 3].permutation(2)
[1, 2, 3].product([1, 2, 3])
[1, 2, 3, 4, 5].cycle
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is exactly the goal of my gem
backports.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,#productand#cycle.You can, for example:
The implementation in
backportspass most RubySpecs (which is not the case forfacets) to guarantee not having compatibility problems.