1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) r49071,r49072,r49073,r49078: [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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2015-02-27 17:21:43 +00:00
parent 13112e5336
commit 02dcfb7873
4 changed files with 34 additions and 4 deletions

View file

@ -1,3 +1,19 @@
Sat Feb 28 02:13:17 2015 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
objects. Label#Str#== is case-insensitive.
Sat Feb 28 02:13:17 2015 Ben Miller <bmiller@rackspace.com>
* lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
comparison should be case-insensitive as well.
[ruby-core:66498] [Bug #10550]
Sat Feb 28 02:13:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/resolv.rb (Resolv::DNS::Name): names with different dots
should be different.
Thu Feb 19 19:14:34 2015 NARUSE, Yui <naruse@ruby-lang.org>
* lib/net/http/response.rb (Net::HTTPResponse): require one or more

View file

@ -1240,7 +1240,8 @@ class Resolv
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:

View file

@ -175,4 +175,17 @@ class TestResolvDNS < Test::Unit::TestCase
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

View file

@ -1,10 +1,10 @@
#define RUBY_VERSION "2.1.5"
#define RUBY_RELEASE_DATE "2015-02-19"
#define RUBY_PATCHLEVEL 299
#define RUBY_RELEASE_DATE "2015-02-28"
#define RUBY_PATCHLEVEL 300
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 2
#define RUBY_RELEASE_DAY 19
#define RUBY_RELEASE_DAY 28
#include "ruby/version.h"