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

ruby-changes:37558

From: usa <ko1@a...>
Date: Wed, 18 Feb 2015 16:03:43 +0900 (JST)
Subject: [ruby-changes:37558] usa:r49639 (ruby_2_0_0): merge revision(s) 49620: [Backport #10857]

usa	2015-02-18 16:03:16 +0900 (Wed, 18 Feb 2015)

  New Revision: 49639

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

  Log:
    merge revision(s) 49620: [Backport #10857]
    
    * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
      returned by Kernel#instance_variables are Symbols now.
      [ruby-core:68128] [Bug #10857]

  Added files:
    branches/ruby_2_0_0/test/resolv/test_resource.rb
  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/resolv.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 49638)
+++ ruby_2_0_0/ChangeLog	(revision 49639)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Wed Feb 18 16:02:30 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
+	  returned by Kernel#instance_variables are Symbols now.
+	  [ruby-core:68128] [Bug #10857]
+
 Tue Feb 17 17:37:14 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/socket/getaddrinfo.c (get_addr): reject too long hostname to
Index: ruby_2_0_0/lib/resolv.rb
===================================================================
--- ruby_2_0_0/lib/resolv.rb	(revision 49638)
+++ ruby_2_0_0/lib/resolv.rb	(revision 49639)
@@ -1641,10 +1641,10 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/resolv.rb#L1641
         return false unless self.class == other.class
         s_ivars = self.instance_variables
         s_ivars.sort!
-        s_ivars.delete "@ttl"
+        s_ivars.delete :@ttl
         o_ivars = other.instance_variables
         o_ivars.sort!
-        o_ivars.delete "@ttl"
+        o_ivars.delete :@ttl
         return s_ivars == o_ivars &&
           s_ivars.collect {|name| self.instance_variable_get name} ==
             o_ivars.collect {|name| other.instance_variable_get name}
@@ -1657,7 +1657,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/resolv.rb#L1657
       def hash # :nodoc:
         h = 0
         vars = self.instance_variables
-        vars.delete "@ttl"
+        vars.delete :@ttl
         vars.each {|name|
           h ^= self.instance_variable_get(name).hash
         }
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 49638)
+++ ruby_2_0_0/version.h	(revision 49639)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2015-02-17"
-#define RUBY_PATCHLEVEL 633
+#define RUBY_RELEASE_DATE "2015-02-18"
+#define RUBY_PATCHLEVEL 634
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 17
+#define RUBY_RELEASE_DAY 18
 
 #include "ruby/version.h"
 
Index: ruby_2_0_0/test/resolv/test_resource.rb
===================================================================
--- ruby_2_0_0/test/resolv/test_resource.rb	(revision 0)
+++ ruby_2_0_0/test/resolv/test_resource.rb	(revision 49639)
@@ -0,0 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/resolv/test_resource.rb#L1
+require 'test/unit'
+require 'resolv'
+
+class TestResolvResource < Test::Unit::TestCase
+  def setup
+    address = "192.168.0.1"
+    @name1 = Resolv::DNS::Resource::IN::A.new(address)
+    @name1.instance_variable_set(:@ttl, 100)
+    @name2 = Resolv::DNS::Resource::IN::A.new(address)
+  end
+
+  def test_equality
+    bug10857 = '[ruby-core:68128] [Bug #10857]'
+    assert_equal(@name1, @name2, bug10857)
+  end
+
+  def test_hash
+    bug10857 = '[ruby-core:68128] [Bug #10857]'
+    assert_equal(@name1.hash, @name2.hash, bug10857)
+  end
+end

Property changes on: ruby_2_0_0/test/resolv/test_resource.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49620


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

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