mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c1759a9f18
commit
f3ba845deb
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Sep 23 23:39:25 2008 James Edward Gray II <jeg2@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/csv/csv.rb: Improved the idea of whitespace and word characters used
|
||||||
|
in substitutions during header conversion as suggested by Michael Selig.
|
||||||
|
|
||||||
Tue Sep 23 21:50:53 2008 Tanaka Akira <akr@fsij.org>
|
Tue Sep 23 21:50:53 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* io.c (io_binwrite): allocate wbuf if nosync.
|
* io.c (io_binwrite): allocate wbuf if nosync.
|
||||||
|
|
|
@ -199,7 +199,7 @@ require "stringio"
|
||||||
#
|
#
|
||||||
class CSV
|
class CSV
|
||||||
# The version of the installed library.
|
# The version of the installed library.
|
||||||
VERSION = "2.4.0".freeze
|
VERSION = "2.4.1".freeze
|
||||||
|
|
||||||
#
|
#
|
||||||
# A CSV::Row is part Array and part Hash. It retains an order for the fields
|
# A CSV::Row is part Array and part Hash. It retains an order for the fields
|
||||||
|
@ -933,8 +933,8 @@ class CSV
|
||||||
HeaderConverters = {
|
HeaderConverters = {
|
||||||
:downcase => lambda { |h| h.encode(ConverterEncoding).downcase },
|
:downcase => lambda { |h| h.encode(ConverterEncoding).downcase },
|
||||||
:symbol => lambda { |h|
|
:symbol => lambda { |h|
|
||||||
h.encode(ConverterEncoding).
|
h.encode(ConverterEncoding).downcase.gsub(/\s+/, "_").
|
||||||
downcase.tr(" ", "_").delete("^a-z0-9_").to_sym
|
gsub(/\W+/, "").to_sym
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue