rubinius/rubinius — pull request #2723 by Mange (2013-10-22 09:00:27+00:00)
Title: Named captures fix

This fixes #2721.

**Points to discuss:**
* I could not find any Ruby Specs for `MatchData`, so I added a new file with the tests that I wanted in them. I could move them somewhere else, or expand them with more tests if needed.
* Implementation might be inefficient. It depends on the performance of chaining `Enumerable` methods together (`.reverse_each.find`).
* I decided to recurse another level in the implementation in order to avoid duplicating code.
* Code style and variable names in `MatchData#[]` isn't very pretty. I decided not to "clean up" anything as there might be a reason for that style. I tried to embrace it instead.
* Is `return num && self[num]` readable?

---

I must say that the rumors about accessibility of Rubinius are true. It's super easy to clone, write tests and implement a fix without ever having read the code before. Kudos!