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

ruby-changes:22742

From: naruse <ko1@a...>
Date: Fri, 24 Feb 2012 23:50:03 +0900 (JST)
Subject: [ruby-changes:22742] naruse:r34791 (ruby_1_9_3): merge revision(s) 34755:

naruse	2012-02-24 23:49:51 +0900 (Fri, 24 Feb 2012)

  New Revision: 34791

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

  Log:
    merge revision(s) 34755:
    
    * lib/ostruct.rb (delete_field): Bug fix so previous value is
      returned. Patch by Nick Recobra [Bug #6063]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/ostruct.rb
    branches/ruby_1_9_3/test/ostruct/test_ostruct.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34790)
+++ ruby_1_9_3/ChangeLog	(revision 34791)
@@ -1,3 +1,8 @@
+Fri Feb 24 23:49:05 2012  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* lib/ostruct.rb (delete_field): Bug fix so previous value is
+	  returned. Patch by Nick Recobra [Bug #6063]
+
 Fri Feb 24 08:53:28 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_tokadd_string, parser_yylex): insert a backslash
Index: ruby_1_9_3/lib/ostruct.rb
===================================================================
--- ruby_1_9_3/lib/ostruct.rb	(revision 34790)
+++ ruby_1_9_3/lib/ostruct.rb	(revision 34791)
@@ -189,8 +189,8 @@
   #
   def delete_field(name)
     sym = name.to_sym
+    singleton_class.__send__(:remove_method, sym, "#{name}=")
     @table.delete sym
-    singleton_class.__send__(:remove_method, sym, "#{name}=")
   end
 
   InspectKey = :__inspect_key__ # :nodoc:
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34790)
+++ ruby_1_9_3/version.h	(revision 34791)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 142
+#define RUBY_PATCHLEVEL 143
 
 #define RUBY_RELEASE_DATE "2012-02-24"
 #define RUBY_RELEASE_YEAR 2012
Index: ruby_1_9_3/test/ostruct/test_ostruct.rb
===================================================================
--- ruby_1_9_3/test/ostruct/test_ostruct.rb	(revision 34790)
+++ ruby_1_9_3/test/ostruct/test_ostruct.rb	(revision 34791)
@@ -57,9 +57,10 @@
     o.a = 'a'
     assert_respond_to(o, :a)
     assert_respond_to(o, :a=)
-    o.delete_field :a
+    a = o.delete_field :a
     assert_not_respond_to(o, :a, bug)
     assert_not_respond_to(o, :a=, bug)
+    assert_equal(a, 'a')
   end
 
   def test_method_missing_handles_square_bracket_equals

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

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