[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — [email protected]
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:68132] [Ruby trunk - Bug #10857] Resolv::DNS::Resource ==() method incorrectly returns false due to TTL attrib
From:
nobu@...
Date:
2015-02-17 02:46:38 UTC
List:
ruby-core #68132
Issue #10857 has been updated by Nobuyoshi Nakada.
Description updated
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
Bug #10857: Resolv::DNS::Resource ==() method incorrectly returns false due to TTL attrib
https://bugs.ruby-lang.org/issues/10857#change-51516
* Author: Shayne Clausson
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
~~~ruby
require 'resolv'
resolver = Resolv::DNS.new(:nameserver => ['8.8.8.8'],
:search => [],
:ndots => 1)
hosts = resolver.getresources('ruby.org', Resolv::DNS::Resource::IN::A)
returned_record = hosts.first
a = Resolv::DNS::Resource::IN::A
#create an identical record
new_record = a.new(returned_record.address)
new_record == returned_record
=>false #but should return true
#If I change this
class Resolv::DNS::Resource
def ==(other) # :nodoc:
return false unless self.class == other.class
s_ivars = self.instance_variables
s_ivars.sort!
**s_ivars.delete "@ttl"**
o_ivars = other.instance_variables
o_ivars.sort!
**o_ivars.delete "@ttl"**
return s_ivars == o_ivars &&
s_ivars.collect {|name| self.instance_variable_get name} ==
o_ivars.collect {|name| other.instance_variable_get name}
end
end
#To this
class Resolv::DNS::Resource
def ==(other) # :nodoc:
return false unless self.class == other.class
s_ivars = self.instance_variables
s_ivars.sort!
**s_ivars.delete(:@ttl)**
o_ivars = other.instance_variables
o_ivars.sort!
**o_ivars.delete(:@ttl)**
return s_ivars == o_ivars &&
s_ivars.collect {|name| self.instance_variable_get name} ==
o_ivars.collect {|name| other.instance_variable_get name}
end
end
new_record == returned_record
=>true
~~~
--
https://bugs.ruby-lang.org/