Skip to content

Commit f3ba845

Browse files
author
jeg2
committed
* lib/csv/csv.rb: Improved the idea of whitespace and word characters used
in substitutions during header conversion as suggested by Michael Selig. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c1759a9 commit f3ba845

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tue Sep 23 23:39:25 2008 James Edward Gray II <jeg2@ruby-lang.org>
2+
3+
* lib/csv/csv.rb: Improved the idea of whitespace and word characters used
4+
in substitutions during header conversion as suggested by Michael Selig.
5+
16
Tue Sep 23 21:50:53 2008 Tanaka Akira <akr@fsij.org>
27

38
* io.c (io_binwrite): allocate wbuf if nosync.

lib/csv.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
#
200200
class CSV
201201
# The version of the installed library.
202-
VERSION = "2.4.0".freeze
202+
VERSION = "2.4.1".freeze
203203

204204
#
205205
# A CSV::Row is part Array and part Hash. It retains an order for the fields
@@ -933,8 +933,8 @@ class MalformedCSVError < RuntimeError; end
933933
HeaderConverters = {
934934
:downcase => lambda { |h| h.encode(ConverterEncoding).downcase },
935935
:symbol => lambda { |h|
936-
h.encode(ConverterEncoding).
937-
downcase.tr(" ", "_").delete("^a-z0-9_").to_sym
936+
h.encode(ConverterEncoding).downcase.gsub(/\s+/, "_").
937+
gsub(/\W+/, "").to_sym
938938
}
939939
}
940940

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy