ruby/ruby — pull request #300 by goshakkk (2013-05-09 19:58:46+00:00)
Title: alias MatchData#captures to #to_ary

Currently, you can get something out of `MatchData` like this:

```ruby
m = "2_apples".match /(\d+)_(apple|orange)s?/
count, thing = m[1], m[2]
# or
_, count, thing = "2_apples".match(/(\d+)_(apple|orange)s?/).to_a
# or
count, thing = "2_apples".match(/(\d+)_(apple|orange)s?/).captures
```

However, this extra `#to_a` or `#captures` that you have to add makes things slightly more verbose.

With this PR, it would be possible to do the following:

```ruby
count, thing = "2_apples".match /(\d+)_(apple|orange)s?/
```

Which looks a bit cleaner and nicer.

I am unsure if we can get it into 1.9 but it would be still great to have it on 2.0.