socketry / async-dns

An asynchronous DNS resolver and server.
MIT License
96 stars 14 forks source link

README resolver addresses_for example improvements #16

Open tadman opened 3 years ago

tadman commented 3 years ago

The example given in the README is missing which require headers are necessary. Based on the errors you get when trying to run it bare the following would make sense:

require 'async'
require 'async/io/endpoint'
require 'async/dns/resolver'

Yet this results in:NoMethodError: undefined methodeach' for Async::IO::Endpoint:Class`

What's missing is:

require 'async'
require 'async/io'
require 'async/dns/resolver'

Ideally Async::DNS would just load whatever it needs as dependencies, at least if that doesn't cause any trouble. It'd be nice if require 'async/dns' or require 'async/dns/resolver' was sufficient.