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

ruby-changes:15243

From: naruse <ko1@a...>
Date: Wed, 31 Mar 2010 13:57:51 +0900 (JST)
Subject: [ruby-changes:15243] Ruby:r27125 (trunk): * test/rubygems/gemutilities.rb (setup, teardown):

naruse	2010-03-31 13:57:31 +0900 (Wed, 31 Mar 2010)

  New Revision: 27125

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

  Log:
    * test/rubygems/gemutilities.rb (setup, teardown):
      Object#to_yaml must use syck on RubyGem.

  Modified files:
    trunk/ChangeLog
    trunk/test/rubygems/gemutilities.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27124)
+++ ChangeLog	(revision 27125)
@@ -1,3 +1,8 @@
+Wed Mar 31 13:53:13 2010  NARUSE, Yui  <naruse@r...>
+
+	* test/rubygems/gemutilities.rb (setup, teardown):
+	  Object#to_yaml must use syck on RubyGem.
+
 Wed Mar 31 06:57:14 2010  Tanaka Akira  <akr@f...>
 
 	* time.c (timew2timespec): fix previous change.
Index: test/rubygems/gemutilities.rb
===================================================================
--- test/rubygems/gemutilities.rb	(revision 27124)
+++ test/rubygems/gemutilities.rb	(revision 27125)
@@ -20,6 +20,7 @@
 require 'rubygems/package'
 require 'rubygems/test_utilities'
 require 'pp'
+require 'yaml'
 
 begin
   gem 'rdoc'
@@ -136,9 +137,25 @@
     Gem.pre_uninstall do |uninstaller|
       @pre_uninstall_hook_arg = uninstaller
     end
+
+    Object.class_eval %q{
+      alias tmp_to_yaml to_yaml
+      def to_yaml( opts = {} )
+        YAML::quick_emit( self, opts ) do |out|
+          out.map( taguri, to_yaml_style ) do |map|
+            to_yaml_properties.each do |m|
+              map.add( m[1..-1], instance_variable_get( m ) )
+            end
+          end
+        end
+      end
+    }
   end
 
   def teardown
+    Object.class_eval %q{
+      alias to_yaml tmp_to_yaml
+    }
     Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
     Gem::ConfigMap[:arch] = @orig_arch
 

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

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