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

ruby-changes:15560

From: tenderlove <ko1@a...>
Date: Sat, 24 Apr 2010 09:20:21 +0900 (JST)
Subject: [ruby-changes:15560] Ruby:r27465 (trunk): * ext/psych/lib/psych.rb: fixing documentation

tenderlove	2010-04-24 09:20:08 +0900 (Sat, 24 Apr 2010)

  New Revision: 27465

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

  Log:
    * ext/psych/lib/psych.rb: fixing documentation
    * ext/psych/lib/psych/deprecated.rb: moving deprecated method to
      deprecated file

  Modified files:
    trunk/ext/psych/lib/psych/deprecated.rb
    trunk/ext/psych/lib/psych.rb

Index: ext/psych/lib/psych/deprecated.rb
===================================================================
--- ext/psych/lib/psych/deprecated.rb	(revision 27464)
+++ ext/psych/lib/psych/deprecated.rb	(revision 27465)
@@ -20,6 +20,16 @@
     end
     target.psych_to_yaml unless opts[:nodump]
   end
+
+  def self.load_documents yaml, &block
+    if $VERBOSE
+      warn "#{caller[0]}: load_documents is deprecated, use load_stream"
+    end
+    list = load_stream yaml
+    return list unless block_given?
+    list.each(&block)
+  end
+
 end
 
 class Object
Index: ext/psych/lib/psych.rb
===================================================================
--- ext/psych/lib/psych.rb	(revision 27464)
+++ ext/psych/lib/psych.rb	(revision 27465)
@@ -191,21 +191,12 @@
   # Load multiple documents given in +yaml+.  Returns the parsed documents
   # as a list.  For example:
   #
-  #   Psych.load_documents("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']
+  #   Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']
   #
   def self.load_stream yaml
     parse_stream(yaml).children.map { |child| child.to_ruby }
   end
 
-  def self.load_documents yaml, &block
-    if $VERBOSE
-      warn "#{caller[0]}: load_documents is deprecated, use load_stream"
-    end
-    list = load_stream yaml
-    return list unless block_given?
-    list.each(&block)
-  end
-
   ###
   # Load the document contained in +filename+.  Returns the yaml contained in
   # +filename+ as a ruby object

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

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