mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
Strip punctuation from CSV headers in symbol converter.
Patch by @cllns. [Fix GH-957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b77cb2a64
commit
87acdae43d
2 changed files with 9 additions and 2 deletions
|
@ -1014,8 +1014,8 @@ class CSV
|
|||
HeaderConverters = {
|
||||
downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
|
||||
symbol: lambda { |h|
|
||||
h.encode(ConverterEncoding).downcase.strip.gsub(/\s+/, "_").
|
||||
gsub(/\W+/, "").to_sym
|
||||
h.encode(ConverterEncoding).downcase.gsub(/[^[\s\w]]+/, "").strip.
|
||||
gsub(/\s+/, "_").to_sym
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue