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

ruby-changes:21327

From: tenderlove <ko1@a...>
Date: Sun, 2 Oct 2011 11:29:36 +0900 (JST)
Subject: [ruby-changes:21327] tenderlove:r33376 (trunk): * lib/yaml/store.rb: make initialize method signature match the

tenderlove	2011-10-02 11:29:27 +0900 (Sun, 02 Oct 2011)

  New Revision: 33376

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

  Log:
    * lib/yaml/store.rb: make initialize method signature match the
      superclass signature.

  Modified files:
    trunk/ChangeLog
    trunk/lib/yaml/store.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33375)
+++ ChangeLog	(revision 33376)
@@ -1,3 +1,8 @@
+Sun Oct  2 11:28:09 2011  Aaron Patterson <aaron@t...>
+
+	* lib/yaml/store.rb: make initialize method signature match the
+	  superclass signature.
+
 Sun Oct  2 10:44:01 2011  Kazuki Tsujimoto  <kazuki@c...>
 
 	* io.c: fix documentation of ARGF.lineno=.
Index: lib/yaml/store.rb
===================================================================
--- lib/yaml/store.rb	(revision 33375)
+++ lib/yaml/store.rb	(revision 33376)
@@ -46,20 +46,15 @@
   #
   # Options passed in through +yaml_opts+ will be used when converting the
   # store to YAML via Hash#to_yaml().
-  def initialize( *o )
-    @opt = {}
-    if String === o.first
-      super(o.shift)
-    end
-    if o.last.is_a? Hash
-      @opt.update(o.pop)
-    end
+  def initialize file_name, yaml_opts = {}
+    @opt = yaml_opts
+    super
   end
 
   # :stopdoc:
 
   def dump(table)
-    @table.to_yaml(@opt)
+    YAML.dump @table
   end
 
   def load(content)
@@ -75,7 +70,7 @@
     false
   end
 
-  EMPTY_MARSHAL_DATA = {}.to_yaml
+  EMPTY_MARSHAL_DATA = YAML.dump({})
   EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
   def empty_marshal_data
     EMPTY_MARSHAL_DATA

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

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