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

ruby-changes:37546

From: naruse <ko1@a...>
Date: Tue, 17 Feb 2015 18:58:00 +0900 (JST)
Subject: [ruby-changes:37546] naruse:r49627 (ruby_2_2): merge revision(s) 49620: [Backport #10857]

naruse	2015-02-17 18:57:39 +0900 (Tue, 17 Feb 2015)

  New Revision: 49627

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

  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_2/test/resolv/test_resource.rb
  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/lib/resolv.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 49626)
+++ ruby_2_2/ChangeLog	(revision 49627)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Tue Feb 17 18:57:13 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 15:39:01 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide
Index: ruby_2_2/lib/resolv.rb
===================================================================
--- ruby_2_2/lib/resolv.rb	(revision 49626)
+++ ruby_2_2/lib/resolv.rb	(revision 49627)
@@ -1666,10 +1666,10 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/resolv.rb#L1666
         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}
@@ -1682,7 +1682,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/resolv.rb#L1682
       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_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 49626)
+++ ruby_2_2/version.h	(revision 49627)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.0"
 #define RUBY_RELEASE_DATE "2015-02-17"
-#define RUBY_PATCHLEVEL 51
+#define RUBY_PATCHLEVEL 52
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_2/test/resolv/test_resource.rb
===================================================================
--- ruby_2_2/test/resolv/test_resource.rb	(revision 0)
+++ ruby_2_2/test/resolv/test_resource.rb	(revision 49627)
@@ -0,0 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/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_2/test/resolv/test_resource.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


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


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

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