ruby-changes:37200
From: naruse <ko1@a...>
Date: Fri, 16 Jan 2015 18:28:25 +0900 (JST)
Subject: [ruby-changes:37200] naruse:r49281 (ruby_2_2): merge revision(s) 49071, 49072, 49073, 49078: [Backport #10550]
naruse 2015-01-16 18:28:08 +0900 (Fri, 16 Jan 2015) New Revision: 49281 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49281 Log: merge revision(s) 49071,49072,49073,49078: [Backport #10550] * lib/resolv.rb (Resolv::DNS::Name): names with different dots should be different. * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the comparison should be case-insensitive as well. [ruby-core:66498] [Bug #10550] * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str objects. Label#Str#== is case-insensitive. 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 49280) +++ ruby_2_2/ChangeLog (revision 49281) @@ -1,3 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Fri Jan 16 18:25:57 2015 Tanaka Akira <akr@f...> + + * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str + objects. Label#Str#== is case-insensitive. + +Fri Jan 16 18:25:57 2015 Ben Miller <bmiller@r...> + + * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the + comparison should be case-insensitive as well. + [ruby-core:66498] [Bug #10550] + +Fri Jan 16 18:25:57 2015 Nobuyoshi Nakada <nobu@r...> + + * lib/resolv.rb (Resolv::DNS::Name): names with different dots + should be different. + Fri Jan 16 17:34:57 2015 Nobuyoshi Nakada <nobu@r...> * parse.y (f_label): return tLABEL value as it is. Index: ruby_2_2/lib/resolv.rb =================================================================== --- ruby_2_2/lib/resolv.rb (revision 49280) +++ ruby_2_2/lib/resolv.rb (revision 49281) @@ -1236,7 +1236,8 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/resolv.rb#L1236 def ==(other) # :nodoc: return false unless Name === other - return @labels.join == other.to_a.join && @absolute == other.absolute? + return false unless @absolute == other.absolute? + return @labels == other.to_a end alias eql? == # :nodoc: Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 49280) +++ ruby_2_2/version.h (revision 49281) @@ -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-01-16" -#define RUBY_PATCHLEVEL 13 +#define RUBY_PATCHLEVEL 14 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 1 Index: ruby_2_2/test/resolv/test_dns.rb =================================================================== --- ruby_2_2/test/resolv/test_dns.rb (revision 49280) +++ ruby_2_2/test/resolv/test_dns.rb (revision 49281) @@ -177,4 +177,17 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/resolv/test_dns.rb#L177 end end end + + def test_dots_diffences + name1 = Resolv::DNS::Name.create("example.org") + name2 = Resolv::DNS::Name.create("ex.ampl.eo.rg") + assert_not_equal(name1, name2, "different dots") + end + + def test_case_insensitive_name + bug10550 = '[ruby-core:66498] [Bug #10550]' + lower = Resolv::DNS::Name.create("ruby-lang.org") + upper = Resolv::DNS::Name.create("Ruby-Lang.org") + assert_equal(lower, upper, bug10550) + end end Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r49071-49073,49078 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/