mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73a48a1482
commit
39b89ceeb4
4 changed files with 23 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Wed May 20 01:58:12 2015 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Wed May 20 01:47:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* iseq.c (rb_iseq_compile_with_option): check source type, must be
|
* iseq.c (rb_iseq_compile_with_option): check source type, must be
|
||||||
|
|
|
@ -1183,7 +1183,7 @@ class Resolv
|
||||||
end
|
end
|
||||||
|
|
||||||
def ==(other)
|
def ==(other)
|
||||||
return @downcase == other.downcase
|
return self.class == other.class && @downcase == other.downcase
|
||||||
end
|
end
|
||||||
|
|
||||||
def eql?(other)
|
def eql?(other)
|
||||||
|
@ -1219,6 +1219,14 @@ class Resolv
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(labels, absolute=true) # :nodoc:
|
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
|
@labels = labels
|
||||||
@absolute = absolute
|
@absolute = absolute
|
||||||
end
|
end
|
||||||
|
|
|
@ -190,4 +190,11 @@ class TestResolvDNS < Test::Unit::TestCase
|
||||||
upper = Resolv::DNS::Name.create("Ruby-Lang.org")
|
upper = Resolv::DNS::Name.create("Ruby-Lang.org")
|
||||||
assert_equal(lower, upper, bug10550)
|
assert_equal(lower, upper, bug10550)
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define RUBY_VERSION "2.2.3"
|
#define RUBY_VERSION "2.2.3"
|
||||||
#define RUBY_RELEASE_DATE "2015-05-20"
|
#define RUBY_RELEASE_DATE "2015-05-20"
|
||||||
#define RUBY_PATCHLEVEL 103
|
#define RUBY_PATCHLEVEL 104
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2015
|
#define RUBY_RELEASE_YEAR 2015
|
||||||
#define RUBY_RELEASE_MONTH 5
|
#define RUBY_RELEASE_MONTH 5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue