Join GitHub today
If skip_lines is set to a String, convert it to a Regexp #455
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 an error similar to:
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.