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

ruby-changes:38463

From: nagachika <ko1@a...>
Date: Wed, 20 May 2015 02:05:51 +0900 (JST)
Subject: [ruby-changes:38463] nagachika:r50544 (ruby_2_2): merge revision(s) 49095: [Backport #11150]

nagachika	2015-05-20 02:05:35 +0900 (Wed, 20 May 2015)

  New Revision: 50544

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

  Log:
    merge revision(s) 49095: [Backport #11150]
    
    * 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_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/lib/resolv.rb
    branches/ruby_2_2/test/resolv/test_dns.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 50543)
+++ ruby_2_2/ChangeLog	(revision 50544)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Wed May 20 01:58:12 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.
+
 Wed May 20 01:47:23 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* iseq.c (rb_iseq_compile_with_option): check source type, must be
Index: ruby_2_2/lib/resolv.rb
===================================================================
--- ruby_2_2/lib/resolv.rb	(revision 50543)
+++ ruby_2_2/lib/resolv.rb	(revision 50544)
@@ -1183,7 +1183,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/resolv.rb#L1183
         end
 
         def ==(other)
-          return @downcase == other.downcase
+          return self.class == other.class && @downcase == other.downcase
         end
 
         def eql?(other)
@@ -1219,6 +1219,14 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/resolv.rb#L1219
       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_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 50543)
+++ ruby_2_2/version.h	(revision 50544)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.3"
 #define RUBY_RELEASE_DATE "2015-05-20"
-#define RUBY_PATCHLEVEL 103
+#define RUBY_PATCHLEVEL 104
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5
Index: ruby_2_2/test/resolv/test_dns.rb
===================================================================
--- ruby_2_2/test/resolv/test_dns.rb	(revision 50543)
+++ ruby_2_2/test/resolv/test_dns.rb	(revision 50544)
@@ -190,4 +190,11 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/resolv/test_dns.rb#L190
     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_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49095


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

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