ruby-dns / net-dns

Net::DNS is a DNS library written in Ruby.
http://net-dns.rubyforge.org
Other
165 stars 42 forks source link

fix "undefined local variable or method `source_address_inet6' " #40

Closed simsicon closed 11 years ago

simsicon commented 12 years ago

when trying to new a resolver,

like,

res = Net::DNS::Resolver.new

will cause a error

"undefined local variable or method `source_address_inet6' for #<Net::DNS::Resolver:0x007fc124a406b8>"

that's because this commit added source_address_inet6 as option but forget to implement a reader, when method "state" in resolver trying to run the following

str << "#{key}: #{eval(key.to_s)} \t"

this error will be caused.

and also bump the version to 7.2.

thanks.

shaunbugler commented 12 years ago

Hi, I second this pull request.

weppos commented 12 years ago

@simsicon thank you for your patch. Could you please update the patch to avoid changes in the .gitignore and .gemspec file?

Also, I would really appreciate if you can provide a test for it.

Thank you for your contributions!

simsicon commented 12 years ago

Thanks for your suggestion. Since the code is pretty obvious and I am not sure how to test it, I might just skip it, hope it's alright to you! Thanks.

weppos commented 12 years ago

Unfortunately, I need to make sure every bug is properly tested. The library is already very poor in testing and the best way to reach a reasonable testing suite is to start with patches.

The way to test is pretty simple. First, every public method should have a test, even if obvious. Second, another test should reproduce the bug (aka the exception) and fail. Once the method is created, the test should pass.

simsicon commented 12 years ago

I appreciate the way, I will try to implement tests later.

weppos commented 12 years ago

Thanks! Feel free to ask me if you should have any question. I'm now maintaining several gems and, unfortunately, I'm running out of time, otherwise I would have contributed to the test on my own.

Thanks again for your cooperation.

simsicon commented 11 years ago

Thanks for your opinion, the latest commit hope will do.

calmyournerves commented 11 years ago

Bump

luxflux commented 11 years ago

Got into this as well. Any ETA, @weppos? @simsicon's stuff works for me.

weppos commented 11 years ago

I'm currently experiencing a really busy period.

I'm trying to schedule one day to review all the pull requests associated to the projects I maintain. I hope this day will arrive soon.

postmodern commented 11 years ago

Also hit this. Anyone have suggestions on an alternative library which can query CNAME, MX values?

aeden commented 11 years ago

I am seeing this as well.

mangelajo commented 11 years ago

same here..... going to be pulled?

weppos commented 11 years ago

Merged, thank you!

simsicon commented 11 years ago

Thank you!!!

postmodern commented 11 years ago

:sunglasses: finally! Thank you.