better fix for gsub() on non-String values in the table. Fixes cachedump brokenness

git-svn-id: file:///home/svn/framework3/trunk@13944 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2011-10-16 00:23:29 +00:00
parent 8295bb0a4e
commit 643f2ab242
1 changed files with 3 additions and 5 deletions

View File

@ -121,11 +121,9 @@ class Table
rows.each { |row|
next if is_hr(row)
str << ( row.map{|x|
if x.nil?
""
else
x = x.to_s
x.gsub(/[\r\n]/, ' ').gsub(/\s+/, ' ').gsub('"', '""')
end
}.map{|x| "\"#{x}\"" }.join(",") + "\n" )
}
str