lib/rubydns.rb in rubydns-2.0.0.pre.rc2 vs lib/rubydns.rb in rubydns-2.0.0
- old
+ new
@@ -26,11 +26,16 @@
module RubyDNS
# Backwards compatibility:
Resolver = Async::DNS::Resolver
# Run a server with the given rules.
- def self.run_server (server_class: RuleBasedServer, **options, &block)
- server = server_class.new(**options, &block)
+ def self.run_server (*args, server_class: RuleBasedServer, **options, &block)
+ if listen = options.delete(:listen)
+ warn "Using `listen:` option is deprecated, please pass as the first argument."
+ args.unshift(listen)
+ end
+
+ server = server_class.new(*args, **options, &block)
server.run
end
end