Closed docwhat closed 9 years ago
Thanks for pointing me here!
The code we use invokes Resolv.new
not Resolv::DNS.new
as your example has.
I can confirm that Resolv::DNS.new.getaddress("google.com")
returns an object of type Resolv::IPv4
, however, this filter uses Resolv.new
and Resolv#getaddress
(both instance and class methods) return strings, not objects.
Does this clarify things?
I agree it's really weird that Resolv#getaddress and Resolv::DNS#getaddress return different object types :\
Hmm. I'm wondering where I got the second form from? Maybe I was setting the resolvers? I swear I duplicated the code in pry and got an object.
This isn't one of those things that "sometimes" returns a string?
Sorry to waste your time.
@docwhat wasn't a waste of time. I appreciate the extra eyes reviewing the code! :)
I was looking through the code and ran across these two statements:
dns.rb
Lines 114-115:and
dns.rb
Lines 173-174:Both try to run
.force_encoding()
on the results ofgetaddress()
andgetname()
but they return objects that don't have a.force_encoding()
method on them:Should there be a
.to_s
before the.force_encoding()
?