Module: RubyDNS
- Defined in:
- lib/rubydns.rb,
lib/rubydns/rule.rb,
lib/rubydns/server.rb,
lib/rubydns/version.rb
Overview
Released under the MIT License. Copyright, 2009-2025, by Samuel Williams.
Defined Under Namespace
Constant Summary collapse
- Resolver =
Backwards compatibility:
Async::DNS::Resolver
- VERSION =
"2.1.1"
Class Method Summary collapse
-
.run(*arguments, server_class: Server, **options, &block) ⇒ Object
Run a server with the given rules.
-
.run_server(*arguments, **options, &block) ⇒ Object
deprecated
Deprecated.
Use RubyDNS.run instead.
Class Method Details
.run(*arguments, server_class: Server, **options, &block) ⇒ Object
Run a server with the given rules.
18 19 20 21 22 23 24 25 26 |
# File 'lib/rubydns.rb', line 18 def self.run(*arguments, server_class: Server, **, &block) server = server_class.new(*arguments, **) if block_given? server.instance_eval(&block) end return server.run end |
.run_server(*arguments, **options, &block) ⇒ Object
Deprecated.
Use run instead.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rubydns.rb', line 29 def self.run_server(*arguments, **, &block) if arguments.first.is_a?(Array) warn "Using an array of interfaces is deprecated. Please use `Async::DNS::Endpoint` instead.", uplevel: 1 endpoints = arguments[0].map do |specification| IO::Endpoint.public_send(*specification) end arguments[0] = IO::Endpoint.composite(*endpoints) end self.run(*arguments, **, &block) end |