[Bug:trunk] some behavior changes of lib/csv.rb between 1.8 and 1.9

Hi jeg2, or anyone who knows the implementation of FasterCSV,

I’m now checking for ruby trunk to pass rubyspec. Are these behavior
changes of lib/csv.rb intended or bug?

  1. CSV.generate

$ ruby18 -rcsv -e ‘w = CSV.generate(“foo18.csv”); w << [1, 2, 3];
$ cat foo18.csv

$ ruby19 -rcsv -e ‘w = CSV.generate(“foo19.csv”); w << [1, 2, 3];
generate': no block given (yield) (LocalJumpError) from -e:1:in

There is the comment of csv.rb:

The old CSV’s Reader and Writer classes have been dropped.
CSV::generate() is different from the old method.
They mean this change, don’t they?

  1. CSV.generate_line

$ ruby18 -rcsv -e ‘p CSV.generate_line([])’

$ ruby19 -rcsv -e ‘p CSV.generate_line([])’

  1. CSV.generate_line (2)

$ ruby18 -rcsv -e ‘p CSV::generate_line([“foo”, “bar”], ?;)’

$ ruby19 -rcsv -e ‘p CSV::generate_line([“foo”, “bar”], ?;)’
/home/mame/work/ruby19/local/lib/ruby/1.9.1/csv.rb:1249:in merge': can't convert String into Hash (TypeError) from /home/mame/work/ruby19/local/lib/ruby/1.9.1/csv.rb:1249:ingenerate_line’
from -e:1:in `’

  1. CSV.parse

$ ruby18 -rcsv -ve ‘p CSV.parse “\nfoo”’
[[nil], [“foo”]]

$ ruby19 -rcsv -ve ‘p CSV.parse “\nfoo”’
[[], [“foo”]]

  1. CSV.parse_line

$ ruby18 -rcsv -ve ‘p CSV.parse_line “”’

$ ruby19 -rcsv -ve ‘p CSV.parse_line “”’

  1. CSV.parse_line (2)

$ ruby18 -rcsv -ve ‘p CSV.parse_line “\nfoo”’

$ ruby19 -rcsv -ve ‘p CSV.parse_line “\nfoo”’