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

ruby-changes:38401

From: usa <ko1@a...>
Date: Wed, 13 May 2015 14:34:04 +0900 (JST)
Subject: [ruby-changes:38401] usa:r50482 (ruby_2_1): merge revision(s) 49095: [Backport #11144]

usa	2015-05-13 14:33:45 +0900 (Wed, 13 May 2015)

  New Revision: 50482

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

  Log:
    merge revision(s) 49095: [Backport #11144]
    
    * lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
      (Resolv::DNS::Name#initialize): Normalize labels as
      Resolv::DNS::Label::Str objects.

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/lib/resolv.rb
    branches/ruby_2_1/test/resolv/test_dns.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50481)
+++ ruby_2_1/ChangeLog	(revision 50482)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Wed May 13 14:32:13 2015  Tanaka Akira  <akr@f...>
+
+	* lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
+	  (Resolv::DNS::Name#initialize): Normalize labels as
+	  Resolv::DNS::Label::Str objects.
+
 Tue May 12 16:11:55 2015  NAKAMURA Usaku  <usa@r...>
 
 	* ext/tk/extconf.rb: support Tcl/Tk8.6.
Index: ruby_2_1/lib/resolv.rb
===================================================================
--- ruby_2_1/lib/resolv.rb	(revision 50481)
+++ ruby_2_1/lib/resolv.rb	(revision 50482)
@@ -1187,7 +1187,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/resolv.rb#L1187
         end
 
         def ==(other)
-          return @downcase == other.downcase
+          return self.class == other.class && @downcase == other.downcase
         end
 
         def eql?(other)
@@ -1223,6 +1223,14 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/resolv.rb#L1223
       end
 
       def initialize(labels, absolute=true) # :nodoc:
+        labels = labels.map {|label|
+          case label
+          when String then Label::Str.new(label)
+          when Label::Str then label
+          else
+            raise ArgumentError, "unexpected label: #{label.inspect}"
+          end
+        }
         @labels = labels
         @absolute = absolute
       end
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50481)
+++ ruby_2_1/version.h	(revision 50482)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.7"
-#define RUBY_RELEASE_DATE "2015-05-12"
-#define RUBY_PATCHLEVEL 343
+#define RUBY_RELEASE_DATE "2015-05-13"
+#define RUBY_PATCHLEVEL 344
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 12
+#define RUBY_RELEASE_DAY 13
 
 #include "ruby/version.h"
 
Index: ruby_2_1/test/resolv/test_dns.rb
===================================================================
--- ruby_2_1/test/resolv/test_dns.rb	(revision 50481)
+++ ruby_2_1/test/resolv/test_dns.rb	(revision 50482)
@@ -188,4 +188,11 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/resolv/test_dns.rb#L188
     upper = Resolv::DNS::Name.create("Ruby-Lang.org")
     assert_equal(lower, upper, bug10550)
   end
+
+  def test_ipv6_name
+    addr = Resolv::IPv6.new("\0"*16)
+    labels = addr.to_name.to_a
+    expected = (['0'] * 32 + ['ip6', 'arpa']).map {|label| Resolv::DNS::Label::Str.new(label) }
+    assert_equal(expected, labels)
+  end
 end

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49095


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

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