From 2f348762fbcf97b1de3b91c0dd84ba8b8b430dfd Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 27 Apr 2011 21:07:04 +0000 Subject: * lib/csv.rb (CSV.read): no mode is needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/csv.rb | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2997714fb5..6fe9d662bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 28 06:07:02 2011 Nobuyoshi Nakada + + * lib/csv.rb (CSV.read): no mode is needed. + Thu Apr 28 06:06:56 2011 Nobuyoshi Nakada * io.c (rb_io_extract_modeenc, rb_f_backquote): set default text diff --git a/lib/csv.rb b/lib/csv.rb index 1aad2f3085..085ee8433d 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -1398,11 +1398,8 @@ class CSV # encoding: "UTF-32BE:UTF-8" would read UTF-32BE data from the file # but transcode it to UTF-8 before CSV parses it. # - def self.read(path, options = Hash.new) - encoding = options.delete(:encoding) - mode = "rb" - mode << ":#{encoding}" if encoding - open(path, mode, options) { |csv| csv.read } + def self.read(path, *options) + open(path, *options) { |csv| csv.read } end # Alias for CSV::read(). -- cgit v1.2.3