[前][次][番号順一覧][スレッド一覧]

ruby-changes:19329

From: nobu <ko1@a...>
Date: Thu, 28 Apr 2011 06:07:11 +0900 (JST)
Subject: [ruby-changes:19329] Ruby:r31369 (trunk): * lib/csv.rb (CSV.read): no mode is needed.

nobu	2011-04-28 06:07:04 +0900 (Thu, 28 Apr 2011)

  New Revision: 31369

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31369

  Log:
    * lib/csv.rb (CSV.read): no mode is needed.

  Modified files:
    trunk/ChangeLog
    trunk/lib/csv.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31368)
+++ ChangeLog	(revision 31369)
@@ -1,3 +1,7 @@
+Thu Apr 28 06:07:02 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/csv.rb (CSV.read): no mode is needed.
+
 Thu Apr 28 06:06:56 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (rb_io_extract_modeenc, rb_f_backquote): set default text
Index: lib/csv.rb
===================================================================
--- lib/csv.rb	(revision 31368)
+++ lib/csv.rb	(revision 31369)
@@ -1398,11 +1398,8 @@
   # <tt>encoding: "UTF-32BE:UTF-8"</tt> 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().

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]