ruby/ruby — pull request #455 by kstevens715 (2013-11-23 05:17:55+00:00)
Title: If skip_lines is set to a String, convert it to a Regexp

This pull request fixes the issue I described in: https://bugs.ruby-lang.org/issues/8560

Basically, skip_lines takes any object that responds to match and passes in each line of the csv as an argument to match. But when skip_lines is a string, string#match converts it's argument to a Regexp. In our case, that argument is each line in the CSV. So each line gets converted to a Regexp one at a time.

It is very unexpected behavior for each line in the CSV to act as a Regexp. And in many cases, it will cause error similar to:
```
2.0.0-p247 :001 > "test".match "#("
RegexpError: end pattern with unmatched parenthesis: /#(/
from (irb):1:in `match'
from (irb):1
from /home/kyle/.rvm/rubies/ruby-2.0.0-p247/bin/irb:12:in `

'
```

Forced to make the choice between converting skip_lines to a Regexp if it's a String and converting each line in the CSV to a Regexp, I've chosen the former.