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

ruby-changes:20912

From: tenderlove <ko1@a...>
Date: Sat, 13 Aug 2011 09:30:06 +0900 (JST)
Subject: [ruby-changes:20912] tenderlove:r32961 (ruby_1_9_3): * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.

tenderlove	2011-08-13 09:29:56 +0900 (Sat, 13 Aug 2011)

  New Revision: 32961

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

  Log:
    * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
      [ruby-core:38913]
    * test/psych/test_yaml.rb: corresponding test.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/psych/lib/psych/core_ext.rb
    branches/ruby_1_9_3/test/psych/test_yaml.rb

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32960)
+++ ruby_1_9_3/ChangeLog	(revision 32961)
@@ -1,3 +1,9 @@
+Sat Aug 13 09:26:24 2011  Aaron Patterson <aaron@t...>
+
+	* ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
+	  [ruby-core:38913]
+	* test/psych/test_yaml.rb: corresponding test.
+
 Sat Aug 13 09:15:16 2011  Tadayoshi Funaba  <tadf@d...>
 
 	* ext/date/date_core.c (date_strftime_alloc): followed the change
Index: ruby_1_9_3/ext/psych/lib/psych/core_ext.rb
===================================================================
--- ruby_1_9_3/ext/psych/lib/psych/core_ext.rb	(revision 32960)
+++ ruby_1_9_3/ext/psych/lib/psych/core_ext.rb	(revision 32961)
@@ -36,4 +36,5 @@
   end
   remove_method :y rescue nil
   alias y psych_y
+  private :y
 end
Index: ruby_1_9_3/test/psych/test_yaml.rb
===================================================================
--- ruby_1_9_3/test/psych/test_yaml.rb	(revision 32960)
+++ ruby_1_9_3/test/psych/test_yaml.rb	(revision 32961)
@@ -3,6 +3,7 @@
 # $Id$
 #
 require 'psych/helper'
+require 'ostruct'
 
 # [ruby-core:01946]
 module Psych_Tests
@@ -14,6 +15,12 @@
         Psych.domain_types.clear
     end
 
+    def test_y_method
+      assert_raises(NoMethodError) do
+        OpenStruct.new.y 1
+      end
+    end
+
     def test_syck_compat
       time = Time.utc(2010, 10, 10)
       yaml = Psych.dump time

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

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